Update Qt namespace flags
This commit is contained in:
@@ -26,8 +26,8 @@ from __future__ import annotations
|
||||
|
||||
import logging
|
||||
|
||||
from PyQt5.QtGui import QCloseEvent
|
||||
from PyQt5.QtCore import Qt, pyqtSlot
|
||||
from PyQt5.QtGui import QCloseEvent
|
||||
from PyQt5.QtWidgets import (
|
||||
QAbstractItemView, QDialog, QDialogButtonBox, QGridLayout, QLabel,
|
||||
QListWidget, QListWidgetItem, QVBoxLayout, QWidget
|
||||
@@ -36,13 +36,14 @@ from PyQt5.QtWidgets import (
|
||||
from novelwriter import CONFIG, SHARED
|
||||
from novelwriter.extensions.switch import NSwitch
|
||||
from novelwriter.extensions.configlayout import NColourLabel
|
||||
from novelwriter.types import QtUserRole
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class GuiDocMerge(QDialog):
|
||||
|
||||
D_HANDLE = Qt.ItemDataRole.UserRole
|
||||
D_HANDLE = QtUserRole
|
||||
|
||||
def __init__(self, parent: QWidget, sHandle: str, itemList: list[str]) -> None:
|
||||
super().__init__(parent=parent)
|
||||
@@ -120,7 +121,7 @@ class GuiDocMerge(QDialog):
|
||||
finalItems = []
|
||||
for i in range(self.listBox.count()):
|
||||
item = self.listBox.item(i)
|
||||
if item is not None and item.checkState() == Qt.Checked:
|
||||
if item is not None and item.checkState() == Qt.CheckState.Checked:
|
||||
finalItems.append(item.data(self.D_HANDLE))
|
||||
|
||||
self._data["moveToTrash"] = self.trashSwitch.isChecked()
|
||||
@@ -175,7 +176,7 @@ class GuiDocMerge(QDialog):
|
||||
newItem.setIcon(itemIcon)
|
||||
newItem.setText(nwItem.itemName)
|
||||
newItem.setData(self.D_HANDLE, tHandle)
|
||||
newItem.setCheckState(Qt.Checked)
|
||||
newItem.setCheckState(Qt.CheckState.Checked)
|
||||
|
||||
self.listBox.addItem(newItem)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user