View Single Post
Old 06-29-2022, 11:36 PM   #76
xxyzz
Evangelist
xxyzz ought to be getting tired of karma fortunes by now.xxyzz ought to be getting tired of karma fortunes by now.xxyzz ought to be getting tired of karma fortunes by now.xxyzz ought to be getting tired of karma fortunes by now.xxyzz ought to be getting tired of karma fortunes by now.xxyzz ought to be getting tired of karma fortunes by now.xxyzz ought to be getting tired of karma fortunes by now.xxyzz ought to be getting tired of karma fortunes by now.xxyzz ought to be getting tired of karma fortunes by now.xxyzz ought to be getting tired of karma fortunes by now.xxyzz ought to be getting tired of karma fortunes by now.
 
Posts: 442
Karma: 2666666
Join Date: Nov 2020
Device: none
I tested 5.99.11 on Arch Linux, here are the problems I found:
  • Placeholder texts are black on Gnome dark theme, example: Preferences->Searching->Grouped searches->Names and Values
  • `QAbstractScrollArea` is not included in `pyqt6_compat.py`, it has `SizeAdjustPolicy` enum.
  • Checkbox(`Qt.ItemDataRole.CheckStateRole`) in `QTableView` can be unchecked from checked state but can't be changed to checked state. It works on PyQt5, maybe it's a Qt6 bug?. Code:

    Code:
    class LemmasTableModle(QAbstractTableModel):
        def __init__(self):
            super().__init__()
            ...
    
        def data(self, index, role=Qt.ItemDataRole.DisplayRole):
            if not index.isValid():
                return None
            column = index.column()
            value = self.lemmas[index.row()][column]
            if role == Qt.ItemDataRole.CheckStateRole and column == 0:
                return Qt.CheckState.Checked if value else Qt.CheckState.Unchecked
            elif role == Qt.ItemDataRole.DisplayRole and column == 3:
                return self.pos_types[value]
            elif role == Qt.ItemDataRole.DisplayRole or role == Qt.ItemDataRole.EditRole:
                return value
            elif role == Qt.ItemDataRole.ToolTipRole and column == 4:
                return value
    
        def flags(self, index):
            if not index.isValid():
                return Qt.ItemFlag.ItemIsEnabled
            flag = QAbstractTableModel.flags(self, index)
            column = index.column()
            if column == 0:
                flag |= Qt.ItemFlag.ItemIsUserCheckable
            elif column == 5:
                flag |= Qt.ItemFlag.ItemIsEditable
            return flag
    
        def setData(self, index, value, role):
            if not index.isValid():
                return False
            column = index.column()
            if role == Qt.ItemDataRole.CheckStateRole and column == 0:
                self.lemmas[index.row()][0] = value == Qt.CheckState.Checked
                self.dataChanged.emit(index, index, [role])
                return True
            elif role == Qt.ItemDataRole.EditRole and column == 5:
                self.lemmas[index.row()][5] = int(value)
                self.dataChanged.emit(index, index, [role])
                return True
            return False
    Full code: https://github.com/xxyzz/WordDumb/bl...stom_lemmas.py

Last edited by xxyzz; 06-29-2022 at 11:40 PM.
xxyzz is offline