diff --git a/news.d/bugfix/1854.ui.md b/news.d/bugfix/1854.ui.md new file mode 100644 index 000000000..c877684b8 --- /dev/null +++ b/news.d/bugfix/1854.ui.md @@ -0,0 +1 @@ +Fix `_pythonToCppCopy: Cannot copy-convert to C++` warnings on startup. diff --git a/plover/gui_qt/dictionaries_widget.py b/plover/gui_qt/dictionaries_widget.py index c3787eea1..19eb78eaf 100644 --- a/plover/gui_qt/dictionaries_widget.py +++ b/plover/gui_qt/dictionaries_widget.py @@ -101,13 +101,13 @@ def config(self): def is_loaded(self): return self.state not in {"loading", "error"} - SUPPORTED_ROLES = { + SUPPORTED_ROLES = [ Qt.ItemDataRole.AccessibleTextRole, Qt.ItemDataRole.CheckStateRole, Qt.ItemDataRole.DecorationRole, Qt.ItemDataRole.DisplayRole, Qt.ItemDataRole.ToolTipRole, - } + ] FLAGS = ( Qt.ItemFlag.ItemIsEnabled diff --git a/test/gui_qt/test_dictionaries_widget.py b/test/gui_qt/test_dictionaries_widget.py index 9ad4fedba..96c1c4af8 100644 --- a/test/gui_qt/test_dictionaries_widget.py +++ b/test/gui_qt/test_dictionaries_widget.py @@ -35,12 +35,15 @@ } ENABLED_FROM_CHAR = {c: e for e, c in ENABLED_TO_CHAR.items()} -# TODO what does it mean that the MODEL_ROLES are now empty? -MODEL_ROLES = [] -# before PySide6 refactoring: -# MODEL_ROLES = sorted([Qt.ItemDataRole.AccessibleTextRole, Qt.ItemDataRole.CheckStateRole, -# Qt.ItemDataRole.DecorationRole, Qt.ItemDataRole.DisplayRole, -# Qt.ItemDataRole.ToolTipRole]) +MODEL_ROLES = sorted( + [ + Qt.ItemDataRole.AccessibleTextRole, + Qt.ItemDataRole.CheckStateRole, + Qt.ItemDataRole.DecorationRole, + Qt.ItemDataRole.DisplayRole, + Qt.ItemDataRole.ToolTipRole, + ] +) def parse_state(state_str):