Fix Qt.UserRole access warning
This commit is contained in:
@@ -61,6 +61,8 @@ class GuiManuscript(QDialog):
|
||||
a document directly to disk.
|
||||
"""
|
||||
|
||||
D_KEY = Qt.ItemDataRole.UserRole
|
||||
|
||||
def __init__(self, mainGui: GuiMain):
|
||||
super().__init__(parent=mainGui)
|
||||
|
||||
@@ -318,7 +320,7 @@ class GuiManuscript(QDialog):
|
||||
"""Get the currently selected build."""
|
||||
bItems = self.buildList.selectedItems()
|
||||
if bItems:
|
||||
build = self._builds.getBuild(bItems[0].data(Qt.UserRole))
|
||||
build = self._builds.getBuild(bItems[0].data(self.D_KEY))
|
||||
if isinstance(build, BuildSettings):
|
||||
return build
|
||||
return None
|
||||
@@ -364,7 +366,7 @@ class GuiManuscript(QDialog):
|
||||
for key, name in self._builds.builds():
|
||||
bItem = QListWidgetItem()
|
||||
bItem.setText(name)
|
||||
bItem.setData(Qt.UserRole, key)
|
||||
bItem.setData(self.D_KEY, key)
|
||||
self.buildList.addItem(bItem)
|
||||
self._buildMap[key] = bItem
|
||||
return
|
||||
|
||||
@@ -285,8 +285,8 @@ class _FilterTab(QWidget):
|
||||
C_ACTIVE = 1
|
||||
C_STATUS = 2
|
||||
|
||||
D_HANDLE = Qt.UserRole
|
||||
D_FILE = Qt.UserRole + 1
|
||||
D_HANDLE = Qt.ItemDataRole.UserRole
|
||||
D_FILE = Qt.ItemDataRole.UserRole + 1
|
||||
|
||||
F_NONE = 0
|
||||
F_FILTERED = 1
|
||||
|
||||
Reference in New Issue
Block a user