Fix Qt.UserRole access warning

This commit is contained in:
Veronica Berglyd Olsen
2023-06-05 00:08:11 +02:00
parent 033b9f2a59
commit 2f0ac4fe17
12 changed files with 51 additions and 41 deletions
+2 -2
View File
@@ -52,8 +52,8 @@ def testDlgMerge_Main(qtbot, nwGUI, projPath, mockRnd):
itemOne = nwMerge.listBox.item(0)
itemTwo = nwMerge.listBox.item(1)
assert itemOne.data(Qt.UserRole) == C.hChapterDoc
assert itemTwo.data(Qt.UserRole) == C.hSceneDoc
assert itemOne.data(Qt.ItemDataRole.UserRole) == C.hChapterDoc
assert itemTwo.data(Qt.ItemDataRole.UserRole) == C.hSceneDoc
assert itemOne.checkState() == Qt.Checked
assert itemTwo.checkState() == Qt.Checked
+1 -1
View File
@@ -51,7 +51,7 @@ def testDlgLoadProject_Main(qtbot, monkeypatch, nwGUI, projPath):
assert recentCount > 0
selItem = nwLoad.listBox.topLevelItem(0)
selPath = selItem.data(nwLoad.C_NAME, Qt.UserRole)
selPath = selItem.data(nwLoad.C_NAME, Qt.ItemDataRole.UserRole)
assert isinstance(selItem, QTreeWidgetItem)
nwLoad.selPath.setText("")