diff --git a/0001-Use-the-The-New-Python-Enums.patch b/0001-Use-the-The-New-Python-Enums.patch new file mode 100644 index 0000000..8fead1e --- /dev/null +++ b/0001-Use-the-The-New-Python-Enums.patch @@ -0,0 +1,1895 @@ +From abe184f4899cdab53f5b5c69f00c2eec64176517 Mon Sep 17 00:00:00 2001 +From: Petr Lautrbach +Date: Mon, 28 Aug 2023 19:07:06 +0200 +Subject: [PATCH] Use the The New Python Enums +Content-type: text/plain + +https://doc.qt.io/qtforpython-6/considerations.html#the-new-python-enums + +In PyQt5, it's possible to use members of enums in the same scope as +enums, e.g. Qt.red. This is not possible in PyQt6, but both PyQt5 and +PyQt6 support the new python enums - Qt.GlobalColor.red + +This change prepares the code for the future transition to PyQt6. + +Signed-off-by: Petr Lautrbach +--- + setoolsgui/apol/analysistab.py | 2 +- + setoolsgui/apol/boolquery.py | 8 +++---- + setoolsgui/apol/boundsquery.py | 6 +++--- + setoolsgui/apol/categoryquery.py | 8 +++---- + setoolsgui/apol/chooseanalysis.py | 2 +- + setoolsgui/apol/commonquery.py | 10 ++++----- + setoolsgui/apol/constraintquery.py | 10 ++++----- + setoolsgui/apol/defaultquery.py | 10 ++++----- + setoolsgui/apol/dta.py | 6 +++--- + setoolsgui/apol/excludetypes.py | 12 +++++------ + setoolsgui/apol/fsusequery.py | 6 +++--- + setoolsgui/apol/genfsconquery.py | 6 +++--- + setoolsgui/apol/ibendportconquery.py | 6 +++--- + setoolsgui/apol/ibpkeyconquery.py | 6 +++--- + setoolsgui/apol/infoflow.py | 8 +++---- + setoolsgui/apol/initsidquery.py | 6 +++--- + setoolsgui/apol/mainwindow.py | 32 ++++++++++++++-------------- + setoolsgui/apol/mlsrulequery.py | 8 +++---- + setoolsgui/apol/netifconquery.py | 6 +++--- + setoolsgui/apol/nodeconquery.py | 8 +++---- + setoolsgui/apol/objclassquery.py | 12 +++++------ + setoolsgui/apol/permmapedit.py | 12 +++++------ + setoolsgui/apol/portconquery.py | 8 +++---- + setoolsgui/apol/rbacrulequery.py | 8 +++---- + setoolsgui/apol/rolequery.py | 10 ++++----- + setoolsgui/apol/sensitivityquery.py | 8 +++---- + setoolsgui/apol/terulequery.py | 16 +++++++------- + setoolsgui/apol/typeattrquery.py | 10 ++++----- + setoolsgui/apol/typequery.py | 10 ++++----- + setoolsgui/apol/userquery.py | 10 ++++----- + setoolsgui/apol/workspace.py | 8 +++---- + setoolsgui/boolmodel.py | 4 ++-- + setoolsgui/boundsmodel.py | 4 ++-- + setoolsgui/commonmodel.py | 4 ++-- + setoolsgui/constraintmodel.py | 4 ++-- + setoolsgui/defaultmodel.py | 4 ++-- + setoolsgui/details.py | 6 +++--- + setoolsgui/fsusemodel.py | 4 ++-- + setoolsgui/genfsconmodel.py | 4 ++-- + setoolsgui/ibendportconmodel.py | 4 ++-- + setoolsgui/ibpkeyconmodel.py | 4 ++-- + setoolsgui/initsidmodel.py | 4 ++-- + setoolsgui/listview.py | 6 +++--- + setoolsgui/mlsmodel.py | 4 ++-- + setoolsgui/mlsrulemodel.py | 4 ++-- + setoolsgui/models.py | 12 +++++------ + setoolsgui/netifconmodel.py | 4 ++-- + setoolsgui/nodeconmodel.py | 4 ++-- + setoolsgui/objclassmodel.py | 4 ++-- + setoolsgui/portconmodel.py | 4 ++-- + setoolsgui/rbacrulemodel.py | 4 ++-- + setoolsgui/rolemodel.py | 4 ++-- + setoolsgui/tableview.py | 6 +++--- + setoolsgui/terulemodel.py | 4 ++-- + setoolsgui/typeattrmodel.py | 4 ++-- + setoolsgui/typemodel.py | 4 ++-- + setoolsgui/usermodel.py | 4 ++-- + 57 files changed, 198 insertions(+), 198 deletions(-) + +diff --git a/setoolsgui/apol/analysistab.py b/setoolsgui/apol/analysistab.py +index 1ed803419331..bc3629ff274a 100644 +--- a/setoolsgui/apol/analysistab.py ++++ b/setoolsgui/apol/analysistab.py +@@ -100,7 +100,7 @@ class AnalysisTab(SEToolsWidget, QScrollArea, metaclass=TabRegistry): + self._check_query() + + def _check_query(self): +- button = self.buttonBox.button(QDialogButtonBox.Apply) ++ button = self.buttonBox.button(QDialogButtonBox.StandardButton.Apply) + enabled = not self.errors + button.setEnabled(enabled) + button.setToolTip("Run the analysis." if enabled else "There are errors in the tab.") +diff --git a/setoolsgui/apol/boolquery.py b/setoolsgui/apol/boolquery.py +index 5b0cdd8b4322..6116fe48a846 100644 +--- a/setoolsgui/apol/boolquery.py ++++ b/setoolsgui/apol/boolquery.py +@@ -57,13 +57,13 @@ class BoolQueryTab(AnalysisTab): + self.sort_proxy = QSortFilterProxyModel(self) + self.sort_proxy.setSourceModel(self.table_results_model) + self.table_results.setModel(self.sort_proxy) +- self.table_results.sortByColumn(0, Qt.AscendingOrder) ++ self.table_results.sortByColumn(0, Qt.SortOrder.AscendingOrder) + + # setup indications of errors on level/range + self.errors = set() + self.orig_palette = self.name.palette() + self.error_palette = self.name.palette() +- self.error_palette.setColor(QPalette.Base, Qt.red) ++ self.error_palette.setColor(QPalette.ColorRole.Base, Qt.GlobalColor.red) + self.clear_name_error() + + # set up processing thread +@@ -105,7 +105,7 @@ class BoolQueryTab(AnalysisTab): + def get_detail(self): + # .ui is set for single item selection. + index = self.bools.selectedIndexes()[0] +- item = self.bool_model.data(index, Qt.UserRole) ++ item = self.bool_model.data(index, Qt.ItemDataRole.UserRole) + + self.log.debug("Generating detail window for {0}".format(item)) + boolean_detail(self, item) +@@ -187,6 +187,6 @@ class BoolQueryTab(AnalysisTab): + if not self.busy.wasCanceled(): + self.busy.setLabelText("Moving the raw result to top; GUI may be unresponsive") + self.busy.repaint() +- self.raw_results.moveCursor(QTextCursor.Start) ++ self.raw_results.moveCursor(QTextCursor.MoveOperation.Start) + + self.busy.reset() +diff --git a/setoolsgui/apol/boundsquery.py b/setoolsgui/apol/boundsquery.py +index 8944d1b7bf8a..5b90c2ee2ded 100644 +--- a/setoolsgui/apol/boundsquery.py ++++ b/setoolsgui/apol/boundsquery.py +@@ -52,13 +52,13 @@ class BoundsQueryTab(AnalysisTab): + self.sort_proxy = QSortFilterProxyModel(self) + self.sort_proxy.setSourceModel(self.table_results_model) + self.table_results.setModel(self.sort_proxy) +- self.table_results.sortByColumn(1, Qt.AscendingOrder) ++ self.table_results.sortByColumn(1, Qt.SortOrder.AscendingOrder) + + # setup indications of errors on level/range + self.errors = set() + self.orig_palette = self.parent.palette() + self.error_palette = self.parent.palette() +- self.error_palette.setColor(QPalette.Base, Qt.red) ++ self.error_palette.setColor(QPalette.ColorRole.Base, Qt.GlobalColor.red) + self.clear_parent_error() + self.clear_child_error() + +@@ -189,6 +189,6 @@ class BoundsQueryTab(AnalysisTab): + if not self.busy.wasCanceled(): + self.busy.setLabelText("Moving the raw result to top; GUI may be unresponsive") + self.busy.repaint() +- self.raw_results.moveCursor(QTextCursor.Start) ++ self.raw_results.moveCursor(QTextCursor.MoveOperation.Start) + + self.busy.reset() +diff --git a/setoolsgui/apol/categoryquery.py b/setoolsgui/apol/categoryquery.py +index 884b4156d75a..598f163c335f 100644 +--- a/setoolsgui/apol/categoryquery.py ++++ b/setoolsgui/apol/categoryquery.py +@@ -57,13 +57,13 @@ class CategoryQueryTab(AnalysisTab): + self.sort_proxy = QSortFilterProxyModel(self) + self.sort_proxy.setSourceModel(self.table_results_model) + self.table_results.setModel(self.sort_proxy) +- self.table_results.sortByColumn(0, Qt.AscendingOrder) ++ self.table_results.sortByColumn(0, Qt.SortOrder.AscendingOrder) + + # setup indications of errors on level/range + self.errors = set() + self.orig_palette = self.name.palette() + self.error_palette = self.name.palette() +- self.error_palette.setColor(QPalette.Base, Qt.red) ++ self.error_palette.setColor(QPalette.ColorRole.Base, Qt.GlobalColor.red) + self.clear_name_error() + + # set up processing thread +@@ -105,7 +105,7 @@ class CategoryQueryTab(AnalysisTab): + def get_detail(self): + # .ui is set for single item selection. + index = self.cats.selectedIndexes()[0] +- item = self.category_model.data(index, Qt.UserRole) ++ item = self.category_model.data(index, Qt.ItemDataRole.UserRole) + + self.log.debug("Generating detail window for {0}".format(item)) + category_detail(self, item) +@@ -186,6 +186,6 @@ class CategoryQueryTab(AnalysisTab): + if not self.busy.wasCanceled(): + self.busy.setLabelText("Moving the raw result to top; GUI may be unresponsive") + self.busy.repaint() +- self.raw_results.moveCursor(QTextCursor.Start) ++ self.raw_results.moveCursor(QTextCursor.MoveOperation.Start) + + self.busy.reset() +diff --git a/setoolsgui/apol/chooseanalysis.py b/setoolsgui/apol/chooseanalysis.py +index 892abdaac5f9..155ae6d2f4ae 100644 +--- a/setoolsgui/apol/chooseanalysis.py ++++ b/setoolsgui/apol/chooseanalysis.py +@@ -52,7 +52,7 @@ class ChooseAnalysis(SEToolsWidget, QDialog): + groupitem.addChild(item) + + self.analysisTypes.expandAll() +- self.analysisTypes.sortByColumn(0, Qt.AscendingOrder) ++ self.analysisTypes.sortByColumn(0, Qt.SortOrder.AscendingOrder) + super(ChooseAnalysis, self).show() + + def accept(self, item=None): +diff --git a/setoolsgui/apol/commonquery.py b/setoolsgui/apol/commonquery.py +index e90ec543666b..8fb11e87290d 100644 +--- a/setoolsgui/apol/commonquery.py ++++ b/setoolsgui/apol/commonquery.py +@@ -65,13 +65,13 @@ class CommonQueryTab(AnalysisTab): + self.sort_proxy = QSortFilterProxyModel(self) + self.sort_proxy.setSourceModel(self.table_results_model) + self.table_results.setModel(self.sort_proxy) +- self.table_results.sortByColumn(0, Qt.AscendingOrder) ++ self.table_results.sortByColumn(0, Qt.SortOrder.AscendingOrder) + + # setup indications of errors + self.errors = set() + self.orig_palette = self.name.palette() + self.error_palette = self.name.palette() +- self.error_palette.setColor(QPalette.Base, Qt.red) ++ self.error_palette.setColor(QPalette.ColorRole.Base, Qt.GlobalColor.red) + self.clear_name_error() + + # set up processing thread +@@ -116,7 +116,7 @@ class CommonQueryTab(AnalysisTab): + def get_detail(self): + # .ui is set for single item selection. + index = self.commons.selectedIndexes()[0] +- item = self.common_model.data(index, Qt.UserRole) ++ item = self.common_model.data(index, Qt.ItemDataRole.UserRole) + + self.log.debug("Generating detail window for {0}".format(item)) + common_detail(self, item) +@@ -146,7 +146,7 @@ class CommonQueryTab(AnalysisTab): + def set_perms(self): + selected_perms = [] + for index in self.perms.selectionModel().selectedIndexes(): +- selected_perms.append(self.perms_model.data(index, Qt.UserRole)) ++ selected_perms.append(self.perms_model.data(index, Qt.ItemDataRole.UserRole)) + + self.query.perms = selected_perms + +@@ -212,6 +212,6 @@ class CommonQueryTab(AnalysisTab): + if not self.busy.wasCanceled(): + self.busy.setLabelText("Moving the raw result to top; GUI may be unresponsive") + self.busy.repaint() +- self.raw_results.moveCursor(QTextCursor.Start) ++ self.raw_results.moveCursor(QTextCursor.MoveOperation.Start) + + self.busy.reset() +diff --git a/setoolsgui/apol/constraintquery.py b/setoolsgui/apol/constraintquery.py +index cfa841b22cb5..ee64db0ca1df 100644 +--- a/setoolsgui/apol/constraintquery.py ++++ b/setoolsgui/apol/constraintquery.py +@@ -84,7 +84,7 @@ class ConstraintQueryTab(AnalysisTab): + self.errors = set() + self.orig_palette = self.type_.palette() + self.error_palette = self.type_.palette() +- self.error_palette.setColor(QPalette.Base, Qt.red) ++ self.error_palette.setColor(QPalette.ColorRole.Base, Qt.GlobalColor.red) + self.clear_user_error() + self.clear_type_error() + self.clear_role_error() +@@ -94,7 +94,7 @@ class ConstraintQueryTab(AnalysisTab): + self.sort_proxy = QSortFilterProxyModel(self) + self.sort_proxy.setSourceModel(self.table_results_model) + self.table_results.setModel(self.sort_proxy) +- self.table_results.sortByColumn(0, Qt.AscendingOrder) ++ self.table_results.sortByColumn(0, Qt.SortOrder.AscendingOrder) + + # set up processing thread + self.thread = QThread() +@@ -173,7 +173,7 @@ class ConstraintQueryTab(AnalysisTab): + def set_tclass(self): + selected_classes = [] + for index in self.tclass.selectionModel().selectedIndexes(): +- selected_classes.append(self.class_model.data(index, Qt.UserRole)) ++ selected_classes.append(self.class_model.data(index, Qt.ItemDataRole.UserRole)) + + self.query.tclass = selected_classes + self.perms_model.set_classes(selected_classes) +@@ -187,7 +187,7 @@ class ConstraintQueryTab(AnalysisTab): + def set_perms(self): + selected_perms = [] + for index in self.perms.selectionModel().selectedIndexes(): +- selected_perms.append(self.perms_model.data(index, Qt.UserRole)) ++ selected_perms.append(self.perms_model.data(index, Qt.ItemDataRole.UserRole)) + + self.query.perms = selected_perms + +@@ -323,6 +323,6 @@ class ConstraintQueryTab(AnalysisTab): + if not self.busy.wasCanceled(): + self.busy.setLabelText("Moving the raw result to top; GUI may be unresponsive") + self.busy.repaint() +- self.raw_results.moveCursor(QTextCursor.Start) ++ self.raw_results.moveCursor(QTextCursor.MoveOperation.Start) + + self.busy.reset() +diff --git a/setoolsgui/apol/defaultquery.py b/setoolsgui/apol/defaultquery.py +index 1efa3c468738..e09692ee6a46 100644 +--- a/setoolsgui/apol/defaultquery.py ++++ b/setoolsgui/apol/defaultquery.py +@@ -52,7 +52,7 @@ class DefaultQueryTab(AnalysisTab): + self.sort_proxy = QSortFilterProxyModel(self) + self.sort_proxy.setSourceModel(self.table_results_model) + self.table_results.setModel(self.sort_proxy) +- self.table_results.sortByColumn(1, Qt.AscendingOrder) ++ self.table_results.sortByColumn(1, Qt.SortOrder.AscendingOrder) + + # populate class list + self.class_model = SEToolsListModel(self) +@@ -124,7 +124,7 @@ class DefaultQueryTab(AnalysisTab): + def set_tclass(self): + selected_classes = [] + for index in self.tclass.selectionModel().selectedIndexes(): +- selected_classes.append(self.class_model.data(index, Qt.UserRole)) ++ selected_classes.append(self.class_model.data(index, Qt.ItemDataRole.UserRole)) + + self.query.tclass = selected_classes + +@@ -163,10 +163,10 @@ class DefaultQueryTab(AnalysisTab): + rule_types.append(mode.objectName()) + + self.query.ruletype = rule_types +- self.query.default = self.default_value.currentData(Qt.UserRole) ++ self.query.default = self.default_value.currentData(Qt.ItemDataRole.UserRole) + + if self.default_range_value.isEnabled(): +- self.query.default_range = self.default_range_value.currentData(Qt.UserRole) ++ self.query.default_range = self.default_range_value.currentData(Qt.ItemDataRole.UserRole) + else: + self.query.default_range = None + +@@ -193,6 +193,6 @@ class DefaultQueryTab(AnalysisTab): + if not self.busy.wasCanceled(): + self.busy.setLabelText("Moving the raw result to top; GUI may be unresponsive") + self.busy.repaint() +- self.raw_results.moveCursor(QTextCursor.Start) ++ self.raw_results.moveCursor(QTextCursor.MoveOperation.Start) + + self.busy.reset() +diff --git a/setoolsgui/apol/dta.py b/setoolsgui/apol/dta.py +index a78d96095b28..8bbed4dbe21f 100644 +--- a/setoolsgui/apol/dta.py ++++ b/setoolsgui/apol/dta.py +@@ -62,7 +62,7 @@ class DomainTransitionAnalysisTab(AnalysisTab): + self.errors = set() + self.orig_palette = self.source.palette() + self.error_palette = self.source.palette() +- self.error_palette.setColor(QPalette.Base, Qt.red) ++ self.error_palette.setColor(QPalette.ColorRole.Base, Qt.GlobalColor.red) + self.clear_source_error() + self.clear_target_error() + +@@ -281,7 +281,7 @@ class DomainTransitionAnalysisTab(AnalysisTab): + + print_transition(self.browser_details.appendPlainText, current.rules) + +- self.browser_details.moveCursor(QTextCursor.Start) ++ self.browser_details.moveCursor(QTextCursor.MoveOperation.Start) + + if not current.child_populated: + self.busy.setLabelText("Gathering additional browser details for {0}...".format( +@@ -337,7 +337,7 @@ class DomainTransitionAnalysisTab(AnalysisTab): + if not self.busy.wasCanceled(): + self.busy.setLabelText("Moving the raw result to top; GUI may be unresponsive") + self.busy.repaint() +- self.raw_results.moveCursor(QTextCursor.Start) ++ self.raw_results.moveCursor(QTextCursor.MoveOperation.Start) + + if self.flows_in.isChecked() or self.flows_out.isChecked(): + # move to browser tab for transitions in/out +diff --git a/setoolsgui/apol/excludetypes.py b/setoolsgui/apol/excludetypes.py +index bee73c58dc66..1c4beaf84542 100644 +--- a/setoolsgui/apol/excludetypes.py ++++ b/setoolsgui/apol/excludetypes.py +@@ -40,14 +40,14 @@ class ExcludeTypes(SEToolsWidget, QDialog): + if t not in self.initial_excluded_list] + self.included_sort = FilterByAttributeProxy(self) + self.included_sort.setSourceModel(self.included_model) +- self.included_sort.sort(0, Qt.AscendingOrder) ++ self.included_sort.sort(0, Qt.SortOrder.AscendingOrder) + self.included_types.setModel(self.included_sort) + + self.excluded_model = SEToolsListModel(self) + self.excluded_model.item_list = self.initial_excluded_list + self.excluded_sort = FilterByAttributeProxy(self) + self.excluded_sort.setSourceModel(self.excluded_model) +- self.excluded_sort.sort(0, Qt.AscendingOrder) ++ self.excluded_sort.sort(0, Qt.SortOrder.AscendingOrder) + self.excluded_types.setModel(self.excluded_sort) + + # connect signals +@@ -62,7 +62,7 @@ class ExcludeTypes(SEToolsWidget, QDialog): + selected_types = [] + for index in self.excluded_types.selectionModel().selectedIndexes(): + source_index = self.excluded_sort.mapToSource(index) +- item = self.excluded_model.data(source_index, Qt.UserRole) ++ item = self.excluded_model.data(source_index, Qt.ItemDataRole.UserRole) + self.included_model.append(item) + selected_types.append(item) + +@@ -81,7 +81,7 @@ class ExcludeTypes(SEToolsWidget, QDialog): + selected_types = [] + for index in self.included_types.selectionModel().selectedIndexes(): + source_index = self.included_sort.mapToSource(index) +- item = self.included_model.data(source_index, Qt.UserRole) ++ item = self.included_model.data(source_index, Qt.ItemDataRole.UserRole) + self.excluded_model.append(item) + selected_types.append(item) + +@@ -95,7 +95,7 @@ class ExcludeTypes(SEToolsWidget, QDialog): + + def set_attr_filter(self, row): + index = self.attr_model.index(row) +- attr = self.attr_model.data(index, Qt.UserRole) ++ attr = self.attr_model.data(index, Qt.ItemDataRole.UserRole) + self.log.debug("Attribute set to {0!r}".format(attr)) + self.included_sort.attr = attr + self.excluded_sort.attr = attr +@@ -126,7 +126,7 @@ class FilterByAttributeProxy(QSortFilterProxyModel): + if self.attr: + source = self.sourceModel() + index = source.index(row) +- item = source.data(index, Qt.UserRole) ++ item = source.data(index, Qt.ItemDataRole.UserRole) + if item not in self.attr: + return False + +diff --git a/setoolsgui/apol/fsusequery.py b/setoolsgui/apol/fsusequery.py +index 9bb192b30232..4e7567f4e4c6 100644 +--- a/setoolsgui/apol/fsusequery.py ++++ b/setoolsgui/apol/fsusequery.py +@@ -74,7 +74,7 @@ class FSUseQueryTab(AnalysisTab): + self.errors = set() + self.orig_palette = self.type_.palette() + self.error_palette = self.type_.palette() +- self.error_palette.setColor(QPalette.Base, Qt.red) ++ self.error_palette.setColor(QPalette.ColorRole.Base, Qt.GlobalColor.red) + self.clear_fs_error() + self.clear_user_error() + self.clear_type_error() +@@ -86,7 +86,7 @@ class FSUseQueryTab(AnalysisTab): + self.sort_proxy = QSortFilterProxyModel(self) + self.sort_proxy.setSourceModel(self.table_results_model) + self.table_results.setModel(self.sort_proxy) +- self.table_results.sortByColumn(1, Qt.AscendingOrder) ++ self.table_results.sortByColumn(1, Qt.SortOrder.AscendingOrder) + + # set up processing thread + self.thread = QThread() +@@ -312,6 +312,6 @@ class FSUseQueryTab(AnalysisTab): + if not self.busy.wasCanceled(): + self.busy.setLabelText("Moving the raw result to top; GUI may be unresponsive") + self.busy.repaint() +- self.raw_results.moveCursor(QTextCursor.Start) ++ self.raw_results.moveCursor(QTextCursor.MoveOperation.Start) + + self.busy.reset() +diff --git a/setoolsgui/apol/genfsconquery.py b/setoolsgui/apol/genfsconquery.py +index 22112a8fb7bf..33dbed787cd6 100644 +--- a/setoolsgui/apol/genfsconquery.py ++++ b/setoolsgui/apol/genfsconquery.py +@@ -74,7 +74,7 @@ class GenfsconQueryTab(AnalysisTab): + self.errors = set() + self.orig_palette = self.type_.palette() + self.error_palette = self.type_.palette() +- self.error_palette.setColor(QPalette.Base, Qt.red) ++ self.error_palette.setColor(QPalette.ColorRole.Base, Qt.GlobalColor.red) + self.clear_fs_error() + self.clear_path_error() + self.clear_user_error() +@@ -87,7 +87,7 @@ class GenfsconQueryTab(AnalysisTab): + self.sort_proxy = QSortFilterProxyModel(self) + self.sort_proxy.setSourceModel(self.table_results_model) + self.table_results.setModel(self.sort_proxy) +- self.table_results.sortByColumn(0, Qt.AscendingOrder) ++ self.table_results.sortByColumn(0, Qt.SortOrder.AscendingOrder) + + # set up processing thread + self.thread = QThread() +@@ -312,6 +312,6 @@ class GenfsconQueryTab(AnalysisTab): + if not self.busy.wasCanceled(): + self.busy.setLabelText("Moving the raw result to top; GUI may be unresponsive") + self.busy.repaint() +- self.raw_results.moveCursor(QTextCursor.Start) ++ self.raw_results.moveCursor(QTextCursor.MoveOperation.Start) + + self.busy.reset() +diff --git a/setoolsgui/apol/ibendportconquery.py b/setoolsgui/apol/ibendportconquery.py +index 6db99c2b5e0f..18252dd23de0 100644 +--- a/setoolsgui/apol/ibendportconquery.py ++++ b/setoolsgui/apol/ibendportconquery.py +@@ -74,7 +74,7 @@ class IbendportconQueryTab(AnalysisTab): + self.errors = set() + self.orig_palette = self.type_.palette() + self.error_palette = self.type_.palette() +- self.error_palette.setColor(QPalette.Base, Qt.red) ++ self.error_palette.setColor(QPalette.ColorRole.Base, Qt.GlobalColor.red) + self.clear_name_error() + self.clear_port_error() + self.clear_user_error() +@@ -87,7 +87,7 @@ class IbendportconQueryTab(AnalysisTab): + self.sort_proxy = QSortFilterProxyModel(self) + self.sort_proxy.setSourceModel(self.table_results_model) + self.table_results.setModel(self.sort_proxy) +- self.table_results.sortByColumn(0, Qt.AscendingOrder) ++ self.table_results.sortByColumn(0, Qt.SortOrder.AscendingOrder) + + # set up processing thread + self.thread = QThread() +@@ -304,6 +304,6 @@ class IbendportconQueryTab(AnalysisTab): + if not self.busy.wasCanceled(): + self.busy.setLabelText("Moving the raw result to top; GUI may be unresponsive") + self.busy.repaint() +- self.raw_results.moveCursor(QTextCursor.Start) ++ self.raw_results.moveCursor(QTextCursor.MoveOperation.Start) + + self.busy.reset() +diff --git a/setoolsgui/apol/ibpkeyconquery.py b/setoolsgui/apol/ibpkeyconquery.py +index 3efd342145f1..b7a78bf908a0 100644 +--- a/setoolsgui/apol/ibpkeyconquery.py ++++ b/setoolsgui/apol/ibpkeyconquery.py +@@ -74,7 +74,7 @@ class IbpkeyconQueryTab(AnalysisTab): + self.errors = set() + self.orig_palette = self.type_.palette() + self.error_palette = self.type_.palette() +- self.error_palette.setColor(QPalette.Base, Qt.red) ++ self.error_palette.setColor(QPalette.ColorRole.Base, Qt.GlobalColor.red) + self.clear_subnet_prefix_error() + self.clear_pkeys_error() + self.clear_user_error() +@@ -87,7 +87,7 @@ class IbpkeyconQueryTab(AnalysisTab): + self.sort_proxy = QSortFilterProxyModel(self) + self.sort_proxy.setSourceModel(self.table_results_model) + self.table_results.setModel(self.sort_proxy) +- self.table_results.sortByColumn(0, Qt.AscendingOrder) ++ self.table_results.sortByColumn(0, Qt.SortOrder.AscendingOrder) + + # set up processing thread + self.thread = QThread() +@@ -317,6 +317,6 @@ class IbpkeyconQueryTab(AnalysisTab): + if not self.busy.wasCanceled(): + self.busy.setLabelText("Moving the raw result to top; GUI may be unresponsive") + self.busy.repaint() +- self.raw_results.moveCursor(QTextCursor.Start) ++ self.raw_results.moveCursor(QTextCursor.MoveOperation.Start) + + self.busy.reset() +diff --git a/setoolsgui/apol/infoflow.py b/setoolsgui/apol/infoflow.py +index fb9b4099cfc0..526f3074e143 100644 +--- a/setoolsgui/apol/infoflow.py ++++ b/setoolsgui/apol/infoflow.py +@@ -75,7 +75,7 @@ class InfoFlowAnalysisTab(AnalysisTab): + + # set up error message for missing perm map + self.error_msg = QMessageBox(self) +- self.error_msg.setStandardButtons(QMessageBox.Ok) ++ self.error_msg.setStandardButtons(QMessageBox.StandardButton.Ok) + + # set up perm map editor + self.permmap_editor = PermissionMapEditor(self, False) +@@ -93,7 +93,7 @@ class InfoFlowAnalysisTab(AnalysisTab): + self.errors = set() + self.orig_palette = self.source.palette() + self.error_palette = self.source.palette() +- self.error_palette.setColor(QPalette.Base, Qt.red) ++ self.error_palette.setColor(QPalette.ColorRole.Base, Qt.GlobalColor.red) + self.clear_source_error() + self.clear_target_error() + +@@ -325,7 +325,7 @@ class InfoFlowAnalysisTab(AnalysisTab): + for rule in current.rules: + self.browser_details.appendPlainText(rule) + +- self.browser_details.moveCursor(QTextCursor.Start) ++ self.browser_details.moveCursor(QTextCursor.MoveOperation.Start) + + if not current.child_populated: + self.busy.setLabelText("Gathering additional browser details for {0}...".format( +@@ -390,7 +390,7 @@ class InfoFlowAnalysisTab(AnalysisTab): + if not self.busy.wasCanceled(): + self.busy.setLabelText("Moving the raw result to top; GUI may be unresponsive") + self.busy.repaint() +- self.raw_results.moveCursor(QTextCursor.Start) ++ self.raw_results.moveCursor(QTextCursor.MoveOperation.Start) + + if self.flows_in.isChecked() or self.flows_out.isChecked(): + # move to browser tab for flows in/out +diff --git a/setoolsgui/apol/initsidquery.py b/setoolsgui/apol/initsidquery.py +index b31c9986b3a5..d01f87130925 100644 +--- a/setoolsgui/apol/initsidquery.py ++++ b/setoolsgui/apol/initsidquery.py +@@ -74,7 +74,7 @@ class InitialSIDQueryTab(AnalysisTab): + self.errors = set() + self.orig_palette = self.type_.palette() + self.error_palette = self.type_.palette() +- self.error_palette.setColor(QPalette.Base, Qt.red) ++ self.error_palette.setColor(QPalette.ColorRole.Base, Qt.GlobalColor.red) + self.clear_name_error() + self.clear_user_error() + self.clear_type_error() +@@ -86,7 +86,7 @@ class InitialSIDQueryTab(AnalysisTab): + self.sort_proxy = QSortFilterProxyModel(self) + self.sort_proxy.setSourceModel(self.table_results_model) + self.table_results.setModel(self.sort_proxy) +- self.table_results.sortByColumn(0, Qt.AscendingOrder) ++ self.table_results.sortByColumn(0, Qt.SortOrder.AscendingOrder) + + # set up processing thread + self.thread = QThread() +@@ -287,6 +287,6 @@ class InitialSIDQueryTab(AnalysisTab): + if not self.busy.wasCanceled(): + self.busy.setLabelText("Moving the raw result to top; GUI may be unresponsive") + self.busy.repaint() +- self.raw_results.moveCursor(QTextCursor.Start) ++ self.raw_results.moveCursor(QTextCursor.MoveOperation.Start) + + self.busy.reset() +diff --git a/setoolsgui/apol/mainwindow.py b/setoolsgui/apol/mainwindow.py +index 3cdb11d3e32e..dcbfb7590ef7 100644 +--- a/setoolsgui/apol/mainwindow.py ++++ b/setoolsgui/apol/mainwindow.py +@@ -60,20 +60,20 @@ class ApolMainWindow(SEToolsWidget, QMainWindow): + + # set up error message dialog + self.error_msg = QMessageBox(self) +- self.error_msg.setStandardButtons(QMessageBox.Ok) ++ self.error_msg.setStandardButtons(QMessageBox.StandardButton.Ok) + + # set up permission map editor + self.permmap_editor = PermissionMapEditor(self, True) + + # set up tab name editor + self.tab_editor = QLineEdit(self.AnalysisTabs) +- self.tab_editor.setWindowFlags(Qt.Popup) ++ self.tab_editor.setWindowFlags(Qt.WindowType.Popup) + + # configure tab bar context menu + tabBar = self.AnalysisTabs.tabBar() + tabBar.addAction(self.rename_tab_action) + tabBar.addAction(self.close_tab_action) +- tabBar.setContextMenuPolicy(Qt.ActionsContextMenu) ++ tabBar.setContextMenuPolicy(Qt.ContextMenuPolicy.ActionsContextMenu) + + # capture INFO and higher Python messages from setools lib for status bar + handler = LogHandlerToSignal() +@@ -127,9 +127,9 @@ class ApolMainWindow(SEToolsWidget, QMainWindow): + reply = QMessageBox.question( + self, "Continue?", + "Loading a policy will close all existing analyses. Continue?", +- QMessageBox.Yes | QMessageBox.No) ++ QMessageBox.StandardButton.Yes | QMessageBox.StandardButton.No) + +- if reply == QMessageBox.No: ++ if reply == QMessageBox.StandardButton.No: + return + + filename = QFileDialog.getOpenFileName(self, "Open policy file", ".", +@@ -163,9 +163,9 @@ class ApolMainWindow(SEToolsWidget, QMainWindow): + reply = QMessageBox.question( + self, "Continue?", + "Closing a policy will close all existing analyses. Continue?", +- QMessageBox.Yes | QMessageBox.No) ++ QMessageBox.StandardButton.Yes | QMessageBox.StandardButton.No) + +- if reply == QMessageBox.No: ++ if reply == QMessageBox.StandardButton.No: + return + + self.AnalysisTabs.clear() +@@ -245,7 +245,7 @@ class ApolMainWindow(SEToolsWidget, QMainWindow): + counted_name = "{0}: {1}".format(self.tab_counter, tabtitle) + + newanalysis = tabclass(self, self._policy, self._permmap) +- newanalysis.setAttribute(Qt.WA_DeleteOnClose) ++ newanalysis.setAttribute(Qt.WidgetAttribute.WA_DeleteOnClose) + newanalysis.setObjectName(counted_name) + + index = self.AnalysisTabs.addTab(newanalysis, counted_name) +@@ -444,9 +444,9 @@ class ApolMainWindow(SEToolsWidget, QMainWindow): + reply = QMessageBox.question( + self, "Continue?", + "Loading a workspace will close all existing analyses. Continue?", +- QMessageBox.Yes | QMessageBox.No) ++ QMessageBox.StandardButton.Yes | QMessageBox.StandardButton.No) + +- if reply == QMessageBox.No: ++ if reply == QMessageBox.StandardButton.No: + return + + # 2. try to load the workspace file, if we fail, bail +@@ -633,7 +633,7 @@ class ApolMainWindow(SEToolsWidget, QMainWindow): + + def apol_help(self): + """Open the main help window.""" +- if self.help_process.state() != QProcess.NotRunning: ++ if self.help_process.state() != QProcess.ProcessState.NotRunning: + return + + distro = pkg_resources.get_distribution("setools") +@@ -648,7 +648,7 @@ class ApolMainWindow(SEToolsWidget, QMainWindow): + @pyqtSlot(QProcess.ProcessError) + def help_failed(self, error): + """Starting assistant failed.""" +- if error != QProcess.FailedToStart: ++ if error != QProcess.ProcessError.FailedToStart: + return + + self.log.error("Failed to start Qt assistant {}.".format(self.config.assistant)) +@@ -669,9 +669,9 @@ class ApolMainWindow(SEToolsWidget, QMainWindow): + "This is typically in the assistant or qt5-assistant package. " + "Choose location of Qt Assistant executable?".format( + self.config.assistant), +- QMessageBox.Yes | QMessageBox.No) ++ QMessageBox.StandardButton.Yes | QMessageBox.StandardButton.No) + +- if reply == QMessageBox.No: ++ if reply == QMessageBox.StandardButton.No: + return + + filename = QFileDialog.getOpenFileName(self, "Location of qt-assistant executable", +@@ -689,12 +689,12 @@ class ApolMainWindow(SEToolsWidget, QMainWindow): + @pyqtSlot(str) + def set_help(self, location): + """Set the help window to the specified document.""" +- if self.help_process.state() == QProcess.NotStarted: ++ if self.help_process.state() == QProcess.ProcessState.NotRunning: + self.apol_help() + if not self.help_process.waitForStarted(): + self.log.warning("Timed out waiting for Qt assistant to start.") + return +- elif self.help_process.state() == QProcess.Starting: ++ elif self.help_process.state() == QProcess.ProcessState.Starting: + if not self.help_process.waitForStarted(): + self.log.warning("Timed out waiting for Qt assistant to start.") + return +diff --git a/setoolsgui/apol/mlsrulequery.py b/setoolsgui/apol/mlsrulequery.py +index ba2be4597982..bb554ade6657 100644 +--- a/setoolsgui/apol/mlsrulequery.py ++++ b/setoolsgui/apol/mlsrulequery.py +@@ -61,7 +61,7 @@ class MLSRuleQueryTab(AnalysisTab): + self.errors = set() + self.orig_palette = self.source.palette() + self.error_palette = self.source.palette() +- self.error_palette.setColor(QPalette.Base, Qt.red) ++ self.error_palette.setColor(QPalette.ColorRole.Base, Qt.GlobalColor.red) + self.clear_source_error() + self.clear_target_error() + self.clear_default_error() +@@ -76,7 +76,7 @@ class MLSRuleQueryTab(AnalysisTab): + self.sort_proxy = QSortFilterProxyModel(self) + self.sort_proxy.setSourceModel(self.table_results_model) + self.table_results.setModel(self.sort_proxy) +- self.table_results.sortByColumn(1, Qt.AscendingOrder) ++ self.table_results.sortByColumn(1, Qt.SortOrder.AscendingOrder) + + # set up processing thread + self.thread = QThread() +@@ -181,7 +181,7 @@ class MLSRuleQueryTab(AnalysisTab): + def set_tclass(self): + selected_classes = [] + for index in self.tclass.selectionModel().selectedIndexes(): +- selected_classes.append(self.class_model.data(index, Qt.UserRole)) ++ selected_classes.append(self.class_model.data(index, Qt.ItemDataRole.UserRole)) + + self.query.tclass = selected_classes + +@@ -264,6 +264,6 @@ class MLSRuleQueryTab(AnalysisTab): + if not self.busy.wasCanceled(): + self.busy.setLabelText("Moving the raw result to top; GUI may be unresponsive") + self.busy.repaint() +- self.raw_results.moveCursor(QTextCursor.Start) ++ self.raw_results.moveCursor(QTextCursor.MoveOperation.Start) + + self.busy.reset() +diff --git a/setoolsgui/apol/netifconquery.py b/setoolsgui/apol/netifconquery.py +index ca2405f7cae6..4cf3de1a9f5c 100644 +--- a/setoolsgui/apol/netifconquery.py ++++ b/setoolsgui/apol/netifconquery.py +@@ -74,7 +74,7 @@ class NetifconQueryTab(AnalysisTab): + self.errors = set() + self.orig_palette = self.type_.palette() + self.error_palette = self.type_.palette() +- self.error_palette.setColor(QPalette.Base, Qt.red) ++ self.error_palette.setColor(QPalette.ColorRole.Base, Qt.GlobalColor.red) + self.clear_name_error() + self.clear_user_error() + self.clear_type_error() +@@ -86,7 +86,7 @@ class NetifconQueryTab(AnalysisTab): + self.sort_proxy = QSortFilterProxyModel(self) + self.sort_proxy.setSourceModel(self.table_results_model) + self.table_results.setModel(self.sort_proxy) +- self.table_results.sortByColumn(0, Qt.AscendingOrder) ++ self.table_results.sortByColumn(0, Qt.SortOrder.AscendingOrder) + + # set up processing thread + self.thread = QThread() +@@ -287,6 +287,6 @@ class NetifconQueryTab(AnalysisTab): + if not self.busy.wasCanceled(): + self.busy.setLabelText("Moving the raw result to top; GUI may be unresponsive") + self.busy.repaint() +- self.raw_results.moveCursor(QTextCursor.Start) ++ self.raw_results.moveCursor(QTextCursor.MoveOperation.Start) + + self.busy.reset() +diff --git a/setoolsgui/apol/nodeconquery.py b/setoolsgui/apol/nodeconquery.py +index 320b0d616a67..81a33a794c05 100644 +--- a/setoolsgui/apol/nodeconquery.py ++++ b/setoolsgui/apol/nodeconquery.py +@@ -80,7 +80,7 @@ class NodeconQueryTab(AnalysisTab): + self.errors = set() + self.orig_palette = self.type_.palette() + self.error_palette = self.type_.palette() +- self.error_palette.setColor(QPalette.Base, Qt.red) ++ self.error_palette.setColor(QPalette.ColorRole.Base, Qt.GlobalColor.red) + self.clear_network_error() + self.clear_user_error() + self.clear_type_error() +@@ -92,7 +92,7 @@ class NodeconQueryTab(AnalysisTab): + self.sort_proxy = QSortFilterProxyModel(self) + self.sort_proxy.setSourceModel(self.table_results_model) + self.table_results.setModel(self.sort_proxy) +- self.table_results.sortByColumn(0, Qt.AscendingOrder) ++ self.table_results.sortByColumn(0, Qt.SortOrder.AscendingOrder) + + # set up processing thread + self.thread = QThread() +@@ -263,7 +263,7 @@ class NodeconQueryTab(AnalysisTab): + def run(self, button): + # right now there is only one button. + self.query.network_overlap = self.network_overlap.isChecked() +- self.query.ip_version = self.ip_version.currentData(Qt.UserRole) ++ self.query.ip_version = self.ip_version.currentData(Qt.ItemDataRole.UserRole) + self.query.range_overlap = self.range_overlap.isChecked() + self.query.range_subset = self.range_subset.isChecked() + self.query.range_superset = self.range_superset.isChecked() +@@ -291,6 +291,6 @@ class NodeconQueryTab(AnalysisTab): + if not self.busy.wasCanceled(): + self.busy.setLabelText("Moving the raw result to top; GUI may be unresponsive") + self.busy.repaint() +- self.raw_results.moveCursor(QTextCursor.Start) ++ self.raw_results.moveCursor(QTextCursor.MoveOperation.Start) + + self.busy.reset() +diff --git a/setoolsgui/apol/objclassquery.py b/setoolsgui/apol/objclassquery.py +index 9744a187ade7..23c8188e8bbd 100644 +--- a/setoolsgui/apol/objclassquery.py ++++ b/setoolsgui/apol/objclassquery.py +@@ -66,13 +66,13 @@ class ObjClassQueryTab(AnalysisTab): + self.sort_proxy = QSortFilterProxyModel(self) + self.sort_proxy.setSourceModel(self.table_results_model) + self.table_results.setModel(self.sort_proxy) +- self.table_results.sortByColumn(0, Qt.AscendingOrder) ++ self.table_results.sortByColumn(0, Qt.SortOrder.AscendingOrder) + + # setup indications of errors on level/range + self.errors = set() + self.orig_palette = self.name.palette() + self.error_palette = self.name.palette() +- self.error_palette.setColor(QPalette.Base, Qt.red) ++ self.error_palette.setColor(QPalette.ColorRole.Base, Qt.GlobalColor.red) + self.clear_name_error() + + # set up processing thread +@@ -117,7 +117,7 @@ class ObjClassQueryTab(AnalysisTab): + def get_detail(self): + # .ui is set for single item selection. + index = self.classes.selectedIndexes()[0] +- item = self.class_model.data(index, Qt.UserRole) ++ item = self.class_model.data(index, Qt.ItemDataRole.UserRole) + + self.log.debug("Generating detail window for {0}".format(item)) + class_detail(self, item) +@@ -146,7 +146,7 @@ class ObjClassQueryTab(AnalysisTab): + # + def set_common(self): + for index in self.common.selectionModel().selectedIndexes(): +- self.query.common = self.common_model.data(index, Qt.UserRole) ++ self.query.common = self.common_model.data(index, Qt.ItemDataRole.UserRole) + break + else: + self.query.common = None +@@ -157,7 +157,7 @@ class ObjClassQueryTab(AnalysisTab): + def set_perms(self): + selected_perms = [] + for index in self.perms.selectionModel().selectedIndexes(): +- selected_perms.append(self.perms_model.data(index, Qt.UserRole)) ++ selected_perms.append(self.perms_model.data(index, Qt.ItemDataRole.UserRole)) + + self.query.perms = selected_perms + +@@ -224,6 +224,6 @@ class ObjClassQueryTab(AnalysisTab): + if not self.busy.wasCanceled(): + self.busy.setLabelText("Moving the raw result to top; GUI may be unresponsive") + self.busy.repaint() +- self.raw_results.moveCursor(QTextCursor.Start) ++ self.raw_results.moveCursor(QTextCursor.MoveOperation.Start) + + self.busy.reset() +diff --git a/setoolsgui/apol/permmapedit.py b/setoolsgui/apol/permmapedit.py +index 97482b30e1a2..d1e0b01ce854 100644 +--- a/setoolsgui/apol/permmapedit.py ++++ b/setoolsgui/apol/permmapedit.py +@@ -86,7 +86,7 @@ class PermissionMapEditor(SEToolsWidget, QDialog): + def class_selected(self): + # the .ui is set to 1 selection + for index in self.classes.selectionModel().selectedIndexes(): +- class_name = self.class_model.data(index, Qt.DisplayRole) ++ class_name = self.class_model.data(index, Qt.ItemDataRole.DisplayRole) + + self.log.debug("Setting class to {0}".format(class_name)) + +@@ -99,15 +99,15 @@ class PermissionMapEditor(SEToolsWidget, QDialog): + for perm in sorted(self.perm_map.perms(class_name)): + # create permission mapping + mapping = PermissionMapping(self, perm, self.edit) +- mapping.setAttribute(Qt.WA_DeleteOnClose) ++ mapping.setAttribute(Qt.WidgetAttribute.WA_DeleteOnClose) + self.class_toggle.connect(mapping.enabled.setChecked) + self.perm_mappings.addWidget(mapping) + self.widgets.append(mapping) + + # add horizonal line + line = QFrame(self) +- line.setFrameShape(QFrame.HLine) +- line.setFrameShadow(QFrame.Sunken) ++ line.setFrameShape(QFrame.Shape.HLine) ++ line.setFrameShadow(QFrame.Shadow.Sunken) + self.perm_mappings.addWidget(line) + self.widgets.append(line) + +@@ -179,8 +179,8 @@ class PermissionMapping(SEToolsWidget, QWidget): + # setup color palettes for direction + self.orig_palette = self.direction.palette() + self.error_palette = self.direction.palette() +- self.error_palette.setColor(QPalette.Button, Qt.red) +- self.error_palette.setColor(QPalette.ButtonText, Qt.white) ++ self.error_palette.setColor(QPalette.ColorRole.Button, Qt.GlobalColor.red) ++ self.error_palette.setColor(QPalette.ColorRole.ButtonText, Qt.GlobalColor.white) + + # setup direction + self.direction.insertItems(0, index_to_word) +diff --git a/setoolsgui/apol/portconquery.py b/setoolsgui/apol/portconquery.py +index 50d054f867a5..de0a16567f1c 100644 +--- a/setoolsgui/apol/portconquery.py ++++ b/setoolsgui/apol/portconquery.py +@@ -75,7 +75,7 @@ class PortconQueryTab(AnalysisTab): + self.errors = set() + self.orig_palette = self.type_.palette() + self.error_palette = self.type_.palette() +- self.error_palette.setColor(QPalette.Base, Qt.red) ++ self.error_palette.setColor(QPalette.ColorRole.Base, Qt.GlobalColor.red) + self.clear_ports_error() + self.clear_user_error() + self.clear_type_error() +@@ -92,7 +92,7 @@ class PortconQueryTab(AnalysisTab): + self.sort_proxy = QSortFilterProxyModel(self) + self.sort_proxy.setSourceModel(self.table_results_model) + self.table_results.setModel(self.sort_proxy) +- self.table_results.sortByColumn(0, Qt.AscendingOrder) ++ self.table_results.sortByColumn(0, Qt.SortOrder.AscendingOrder) + + # set up processing thread + self.thread = QThread() +@@ -280,7 +280,7 @@ class PortconQueryTab(AnalysisTab): + self.query.ports_overlap = self.ports_overlap.isChecked() + self.query.ports_subset = self.ports_subset.isChecked() + self.query.ports_superset = self.ports_superset.isChecked() +- self.query.protocol = self.protocol.currentData(Qt.UserRole) ++ self.query.protocol = self.protocol.currentData(Qt.ItemDataRole.UserRole) + self.query.range_overlap = self.range_overlap.isChecked() + self.query.range_subset = self.range_subset.isChecked() + self.query.range_superset = self.range_superset.isChecked() +@@ -308,6 +308,6 @@ class PortconQueryTab(AnalysisTab): + if not self.busy.wasCanceled(): + self.busy.setLabelText("Moving the raw result to top; GUI may be unresponsive") + self.busy.repaint() +- self.raw_results.moveCursor(QTextCursor.Start) ++ self.raw_results.moveCursor(QTextCursor.MoveOperation.Start) + + self.busy.reset() +diff --git a/setoolsgui/apol/rbacrulequery.py b/setoolsgui/apol/rbacrulequery.py +index 0ce4bb9ad6c6..4749d324d858 100644 +--- a/setoolsgui/apol/rbacrulequery.py ++++ b/setoolsgui/apol/rbacrulequery.py +@@ -71,7 +71,7 @@ class RBACRuleQueryTab(AnalysisTab): + self.errors = set() + self.orig_palette = self.source.palette() + self.error_palette = self.source.palette() +- self.error_palette.setColor(QPalette.Base, Qt.red) ++ self.error_palette.setColor(QPalette.ColorRole.Base, Qt.GlobalColor.red) + self.clear_source_error() + self.clear_target_error() + self.clear_default_error() +@@ -86,7 +86,7 @@ class RBACRuleQueryTab(AnalysisTab): + self.sort_proxy = QSortFilterProxyModel(self) + self.sort_proxy.setSourceModel(self.table_results_model) + self.table_results.setModel(self.sort_proxy) +- self.table_results.sortByColumn(0, Qt.AscendingOrder) ++ self.table_results.sortByColumn(0, Qt.SortOrder.AscendingOrder) + + # set up processing thread + self.thread = QThread() +@@ -194,7 +194,7 @@ class RBACRuleQueryTab(AnalysisTab): + def set_tclass(self): + selected_classes = [] + for index in self.tclass.selectionModel().selectedIndexes(): +- selected_classes.append(self.class_model.data(index, Qt.UserRole)) ++ selected_classes.append(self.class_model.data(index, Qt.ItemDataRole.UserRole)) + + self.query.tclass = selected_classes + +@@ -292,6 +292,6 @@ class RBACRuleQueryTab(AnalysisTab): + if not self.busy.wasCanceled(): + self.busy.setLabelText("Moving the raw result to top; GUI may be unresponsive") + self.busy.repaint() +- self.raw_results.moveCursor(QTextCursor.Start) ++ self.raw_results.moveCursor(QTextCursor.MoveOperation.Start) + + self.busy.reset() +diff --git a/setoolsgui/apol/rolequery.py b/setoolsgui/apol/rolequery.py +index 29983a5961ee..e75614d9a992 100644 +--- a/setoolsgui/apol/rolequery.py ++++ b/setoolsgui/apol/rolequery.py +@@ -62,13 +62,13 @@ class RoleQueryTab(AnalysisTab): + self.sort_proxy = QSortFilterProxyModel(self) + self.sort_proxy.setSourceModel(self.table_results_model) + self.table_results.setModel(self.sort_proxy) +- self.table_results.sortByColumn(0, Qt.AscendingOrder) ++ self.table_results.sortByColumn(0, Qt.SortOrder.AscendingOrder) + + # setup indications of errors on level/range + self.errors = set() + self.orig_palette = self.name.palette() + self.error_palette = self.name.palette() +- self.error_palette.setColor(QPalette.Base, Qt.red) ++ self.error_palette.setColor(QPalette.ColorRole.Base, Qt.GlobalColor.red) + self.clear_name_error() + + # set up processing thread +@@ -112,7 +112,7 @@ class RoleQueryTab(AnalysisTab): + def get_detail(self): + # .ui is set for single item selection. + index = self.roles.selectedIndexes()[0] +- item = self.role_model.data(index, Qt.UserRole) ++ item = self.role_model.data(index, Qt.ItemDataRole.UserRole) + + self.log.debug("Generating detail window for {0}".format(item)) + role_detail(self, item) +@@ -142,7 +142,7 @@ class RoleQueryTab(AnalysisTab): + def set_types(self): + selected_types = [] + for index in self.types.selectionModel().selectedIndexes(): +- selected_types.append(self.type_model.data(index, Qt.UserRole)) ++ selected_types.append(self.type_model.data(index, Qt.ItemDataRole.UserRole)) + + self.query.types = selected_types + +@@ -209,6 +209,6 @@ class RoleQueryTab(AnalysisTab): + if not self.busy.wasCanceled(): + self.busy.setLabelText("Moving the raw result to top; GUI may be unresponsive") + self.busy.repaint() +- self.raw_results.moveCursor(QTextCursor.Start) ++ self.raw_results.moveCursor(QTextCursor.MoveOperation.Start) + + self.busy.reset() +diff --git a/setoolsgui/apol/sensitivityquery.py b/setoolsgui/apol/sensitivityquery.py +index d5bcbec53fda..c8a27891ae97 100644 +--- a/setoolsgui/apol/sensitivityquery.py ++++ b/setoolsgui/apol/sensitivityquery.py +@@ -57,13 +57,13 @@ class SensitivityQueryTab(AnalysisTab): + self.sort_proxy = QSortFilterProxyModel(self) + self.sort_proxy.setSourceModel(self.table_results_model) + self.table_results.setModel(self.sort_proxy) +- self.table_results.sortByColumn(0, Qt.AscendingOrder) ++ self.table_results.sortByColumn(0, Qt.SortOrder.AscendingOrder) + + # setup indications of errors on level/range + self.errors = set() + self.orig_palette = self.name.palette() + self.error_palette = self.name.palette() +- self.error_palette.setColor(QPalette.Base, Qt.red) ++ self.error_palette.setColor(QPalette.ColorRole.Base, Qt.GlobalColor.red) + self.clear_name_error() + + # set up processing thread +@@ -105,7 +105,7 @@ class SensitivityQueryTab(AnalysisTab): + def get_detail(self): + # .ui is set for single item selection. + index = self.sens.selectedIndexes()[0] +- item = self.sensitivity_model.data(index, Qt.UserRole) ++ item = self.sensitivity_model.data(index, Qt.ItemDataRole.UserRole) + + self.log.debug("Generating detail window for {0}".format(item)) + sensitivity_detail(self, item) +@@ -186,6 +186,6 @@ class SensitivityQueryTab(AnalysisTab): + if not self.busy.wasCanceled(): + self.busy.setLabelText("Moving the raw result to top; GUI may be unresponsive") + self.busy.repaint() +- self.raw_results.moveCursor(QTextCursor.Start) ++ self.raw_results.moveCursor(QTextCursor.MoveOperation.Start) + + self.busy.reset() +diff --git a/setoolsgui/apol/terulequery.py b/setoolsgui/apol/terulequery.py +index 3064710550f5..7c99469edc87 100644 +--- a/setoolsgui/apol/terulequery.py ++++ b/setoolsgui/apol/terulequery.py +@@ -69,7 +69,7 @@ class TERuleQueryTab(AnalysisTab): + self.errors = set() + self.orig_palette = self.source.palette() + self.error_palette = self.source.palette() +- self.error_palette.setColor(QPalette.Base, Qt.red) ++ self.error_palette.setColor(QPalette.ColorRole.Base, Qt.GlobalColor.red) + self.clear_source_error() + self.clear_target_error() + self.clear_default_error() +@@ -94,7 +94,7 @@ class TERuleQueryTab(AnalysisTab): + self.sort_proxy = QSortFilterProxyModel(self) + self.sort_proxy.setSourceModel(self.table_results_model) + self.table_results.setModel(self.sort_proxy) +- self.table_results.sortByColumn(0, Qt.AscendingOrder) ++ self.table_results.sortByColumn(0, Qt.SortOrder.AscendingOrder) + + # set up processing thread + self.thread = QThread() +@@ -221,7 +221,7 @@ class TERuleQueryTab(AnalysisTab): + def set_tclass(self): + selected_classes = [] + for index in self.tclass.selectionModel().selectedIndexes(): +- selected_classes.append(self.class_model.data(index, Qt.UserRole)) ++ selected_classes.append(self.class_model.data(index, Qt.ItemDataRole.UserRole)) + + self.query.tclass = selected_classes + self.perms_model.set_classes(selected_classes) +@@ -236,7 +236,7 @@ class TERuleQueryTab(AnalysisTab): + def set_perms(self): + selected_perms = [] + for index in self.perms.selectionModel().selectedIndexes(): +- selected_perms.append(self.perms_model.data(index, Qt.UserRole)) ++ selected_perms.append(self.perms_model.data(index, Qt.ItemDataRole.UserRole)) + + self.query.perms = selected_perms + +@@ -302,7 +302,7 @@ class TERuleQueryTab(AnalysisTab): + def set_bools(self): + selected_bools = [] + for index in self.bool_criteria.selectionModel().selectedIndexes(): +- selected_bools.append(self.bool_model.data(index, Qt.UserRole)) ++ selected_bools.append(self.bool_model.data(index, Qt.ItemDataRole.UserRole)) + + self.query.boolean = selected_bools + +@@ -407,9 +407,9 @@ class TERuleQueryTab(AnalysisTab): + reply = QMessageBox.question( + self, "Continue?", + "This is a broad query, estimated to return {0} results. Continue?". +- format(max_results), QMessageBox.Yes | QMessageBox.No) ++ format(max_results), QMessageBox.StandardButton.Yes | QMessageBox.StandardButton.No) + +- if reply == QMessageBox.No: ++ if reply == QMessageBox.StandardButton.No: + return + + # start processing +@@ -440,6 +440,6 @@ class TERuleQueryTab(AnalysisTab): + if not self.busy.wasCanceled(): + self.busy.setLabelText("Moving the raw result to top; GUI may be unresponsive") + self.busy.repaint() +- self.raw_results.moveCursor(QTextCursor.Start) ++ self.raw_results.moveCursor(QTextCursor.MoveOperation.Start) + + self.busy.reset() +diff --git a/setoolsgui/apol/typeattrquery.py b/setoolsgui/apol/typeattrquery.py +index 14a4141d922a..67a087a7e3f0 100644 +--- a/setoolsgui/apol/typeattrquery.py ++++ b/setoolsgui/apol/typeattrquery.py +@@ -62,13 +62,13 @@ class TypeAttributeQueryTab(AnalysisTab): + self.sort_proxy = QSortFilterProxyModel(self) + self.sort_proxy.setSourceModel(self.table_results_model) + self.table_results.setModel(self.sort_proxy) +- self.table_results.sortByColumn(0, Qt.AscendingOrder) ++ self.table_results.sortByColumn(0, Qt.SortOrder.AscendingOrder) + + # setup indications of errors on level/range + self.errors = set() + self.orig_palette = self.name.palette() + self.error_palette = self.name.palette() +- self.error_palette.setColor(QPalette.Base, Qt.red) ++ self.error_palette.setColor(QPalette.ColorRole.Base, Qt.GlobalColor.red) + self.clear_name_error() + + # set up processing thread +@@ -112,7 +112,7 @@ class TypeAttributeQueryTab(AnalysisTab): + def get_detail(self): + # .ui is set for single item selection. + index = self.attrs.selectedIndexes()[0] +- item = self.attr_model.data(index, Qt.UserRole) ++ item = self.attr_model.data(index, Qt.ItemDataRole.UserRole) + + self.log.debug("Generating detail window for {0}".format(item)) + typeattr_detail(self, item) +@@ -142,7 +142,7 @@ class TypeAttributeQueryTab(AnalysisTab): + def set_types(self): + selected_types = [] + for index in self.types.selectionModel().selectedIndexes(): +- selected_types.append(self.type_model.data(index, Qt.UserRole)) ++ selected_types.append(self.type_model.data(index, Qt.ItemDataRole.UserRole)) + + self.query.types = selected_types + +@@ -209,6 +209,6 @@ class TypeAttributeQueryTab(AnalysisTab): + if not self.busy.wasCanceled(): + self.busy.setLabelText("Moving the raw result to top; GUI may be unresponsive") + self.busy.repaint() +- self.raw_results.moveCursor(QTextCursor.Start) ++ self.raw_results.moveCursor(QTextCursor.MoveOperation.Start) + + self.busy.reset() +diff --git a/setoolsgui/apol/typequery.py b/setoolsgui/apol/typequery.py +index 2e261ccd52db..a22e3547cd16 100644 +--- a/setoolsgui/apol/typequery.py ++++ b/setoolsgui/apol/typequery.py +@@ -62,13 +62,13 @@ class TypeQueryTab(AnalysisTab): + self.sort_proxy = QSortFilterProxyModel(self) + self.sort_proxy.setSourceModel(self.table_results_model) + self.table_results.setModel(self.sort_proxy) +- self.table_results.sortByColumn(0, Qt.AscendingOrder) ++ self.table_results.sortByColumn(0, Qt.SortOrder.AscendingOrder) + + # setup indications of errors on level/range + self.errors = set() + self.orig_palette = self.name.palette() + self.error_palette = self.name.palette() +- self.error_palette.setColor(QPalette.Base, Qt.red) ++ self.error_palette.setColor(QPalette.ColorRole.Base, Qt.GlobalColor.red) + self.clear_name_error() + + # set up processing thread +@@ -112,7 +112,7 @@ class TypeQueryTab(AnalysisTab): + def get_detail(self): + # .ui is set for single item selection. + index = self.types.selectedIndexes()[0] +- item = self.type_model.data(index, Qt.UserRole) ++ item = self.type_model.data(index, Qt.ItemDataRole.UserRole) + + self.log.debug("Generating detail window for {0}".format(item)) + type_detail(self, item) +@@ -142,7 +142,7 @@ class TypeQueryTab(AnalysisTab): + def set_attrs(self): + selected_attrs = [] + for index in self.attrs.selectionModel().selectedIndexes(): +- selected_attrs.append(self.attr_model.data(index, Qt.UserRole)) ++ selected_attrs.append(self.attr_model.data(index, Qt.ItemDataRole.UserRole)) + + self.query.attrs = selected_attrs + +@@ -213,6 +213,6 @@ class TypeQueryTab(AnalysisTab): + if not self.busy.wasCanceled(): + self.busy.setLabelText("Moving the raw result to top; GUI may be unresponsive") + self.busy.repaint() +- self.raw_results.moveCursor(QTextCursor.Start) ++ self.raw_results.moveCursor(QTextCursor.MoveOperation.Start) + + self.busy.reset() +diff --git a/setoolsgui/apol/userquery.py b/setoolsgui/apol/userquery.py +index c325888db8ec..19ffb03c2975 100644 +--- a/setoolsgui/apol/userquery.py ++++ b/setoolsgui/apol/userquery.py +@@ -62,13 +62,13 @@ class UserQueryTab(AnalysisTab): + self.sort_proxy = QSortFilterProxyModel(self) + self.sort_proxy.setSourceModel(self.table_results_model) + self.table_results.setModel(self.sort_proxy) +- self.table_results.sortByColumn(0, Qt.AscendingOrder) ++ self.table_results.sortByColumn(0, Qt.SortOrder.AscendingOrder) + + # setup indications of errors on level/range + self.errors = set() + self.orig_palette = self.name.palette() + self.error_palette = self.name.palette() +- self.error_palette.setColor(QPalette.Base, Qt.red) ++ self.error_palette.setColor(QPalette.ColorRole.Base, Qt.GlobalColor.red) + self.clear_name_error() + + if self.policy.mls: +@@ -135,7 +135,7 @@ class UserQueryTab(AnalysisTab): + def get_detail(self): + # .ui is set for single item selection. + index = self.users.selectedIndexes()[0] +- item = self.user_model.data(index, Qt.UserRole) ++ item = self.user_model.data(index, Qt.ItemDataRole.UserRole) + + self.log.debug("Generating detail window for {0}".format(item)) + user_detail(self, item) +@@ -165,7 +165,7 @@ class UserQueryTab(AnalysisTab): + def set_roles(self): + selected_roles = [] + for index in self.roles.selectionModel().selectedIndexes(): +- selected_roles.append(self.role_model.data(index, Qt.UserRole)) ++ selected_roles.append(self.role_model.data(index, Qt.ItemDataRole.UserRole)) + + self.query.roles = selected_roles + +@@ -262,6 +262,6 @@ class UserQueryTab(AnalysisTab): + if not self.busy.wasCanceled(): + self.busy.setLabelText("Moving the raw result to top; GUI may be unresponsive") + self.busy.repaint() +- self.raw_results.moveCursor(QTextCursor.Start) ++ self.raw_results.moveCursor(QTextCursor.MoveOperation.Start) + + self.busy.reset() +diff --git a/setoolsgui/apol/workspace.py b/setoolsgui/apol/workspace.py +index 0f8ec82cdaea..2b4229224b85 100644 +--- a/setoolsgui/apol/workspace.py ++++ b/setoolsgui/apol/workspace.py +@@ -141,7 +141,7 @@ def save_listviews(tab, settings, listviews): + + selections = [] + for index in listview.selectedIndexes(): +- item = datamodel.data(index, Qt.DisplayRole) ++ item = datamodel.data(index, Qt.ItemDataRole.DisplayRole) + selections.append(item) + + settings[entry] = selections +@@ -181,10 +181,10 @@ def load_listviews(tab, settings, listviews): + + for row in range(datamodel.rowCount()): + index = datamodel.createIndex(row, 0) +- item = datamodel.data(index, Qt.DisplayRole) ++ item = datamodel.data(index, Qt.ItemDataRole.DisplayRole) + + if item in selections: +- selectionmodel.select(index, QItemSelectionModel.Select) ++ selectionmodel.select(index, QItemSelectionModel.SelectionFlag.Select) + + + def save_comboboxes(tab, settings, comboboxes): +@@ -199,7 +199,7 @@ def save_comboboxes(tab, settings, comboboxes): + + for entry in comboboxes: + combobox = getattr(tab, entry) +- settings[entry] = combobox.currentData(Qt.DisplayRole) ++ settings[entry] = combobox.currentData(Qt.ItemDataRole.DisplayRole) + + + def load_comboboxes(tab, settings, comboboxes): +diff --git a/setoolsgui/boolmodel.py b/setoolsgui/boolmodel.py +index 0d698c92f51b..c331fdd5057d 100644 +--- a/setoolsgui/boolmodel.py ++++ b/setoolsgui/boolmodel.py +@@ -38,12 +38,12 @@ class BooleanTableModel(SEToolsTableModel): + col = index.column() + boolean = self.resultlist[row] + +- if role == Qt.DisplayRole: ++ if role == Qt.ItemDataRole.DisplayRole: + if col == 0: + return boolean.name + elif col == 1: + return str(boolean.state) + +- elif role == Qt.UserRole: ++ elif role == Qt.ItemDataRole.UserRole: + # get the whole rule for boolean boolean + return boolean +diff --git a/setoolsgui/boundsmodel.py b/setoolsgui/boundsmodel.py +index c84f612a3b3a..c7ed1e7c227f 100644 +--- a/setoolsgui/boundsmodel.py ++++ b/setoolsgui/boundsmodel.py +@@ -20,7 +20,7 @@ class BoundsTableModel(SEToolsTableModel): + col = index.column() + item = self.resultlist[row] + +- if role == Qt.DisplayRole: ++ if role == Qt.ItemDataRole.DisplayRole: + if col == 0: + return item.ruletype.name + elif col == 1: +@@ -28,5 +28,5 @@ class BoundsTableModel(SEToolsTableModel): + elif col == 2: + return item.child.name + +- elif role == Qt.UserRole: ++ elif role == Qt.ItemDataRole.UserRole: + return item +diff --git a/setoolsgui/commonmodel.py b/setoolsgui/commonmodel.py +index a6f6fed53840..2ceb57f4f0a3 100644 +--- a/setoolsgui/commonmodel.py ++++ b/setoolsgui/commonmodel.py +@@ -42,11 +42,11 @@ class CommonTableModel(SEToolsTableModel): + col = index.column() + item = self.resultlist[row] + +- if role == Qt.DisplayRole: ++ if role == Qt.ItemDataRole.DisplayRole: + if col == 0: + return item.name + elif col == 1: + return ", ".join(sorted(item.perms)) + +- elif role == Qt.UserRole: ++ elif role == Qt.ItemDataRole.UserRole: + return item +diff --git a/setoolsgui/constraintmodel.py b/setoolsgui/constraintmodel.py +index 122dff0b5139..d295f28f208b 100644 +--- a/setoolsgui/constraintmodel.py ++++ b/setoolsgui/constraintmodel.py +@@ -21,7 +21,7 @@ class ConstraintTableModel(SEToolsTableModel): + col = index.column() + rule = self.resultlist[row] + +- if role == Qt.DisplayRole: ++ if role == Qt.ItemDataRole.DisplayRole: + if col == 0: + return rule.ruletype.name + elif col == 1: +@@ -34,5 +34,5 @@ class ConstraintTableModel(SEToolsTableModel): + elif col == 3: + return str(rule.expression) + +- elif role == Qt.UserRole: ++ elif role == Qt.ItemDataRole.UserRole: + return rule +diff --git a/setoolsgui/defaultmodel.py b/setoolsgui/defaultmodel.py +index b9a6a58ebfea..3a699c49ce8c 100644 +--- a/setoolsgui/defaultmodel.py ++++ b/setoolsgui/defaultmodel.py +@@ -22,7 +22,7 @@ class DefaultTableModel(SEToolsTableModel): + col = index.column() + item = self.resultlist[row] + +- if role == Qt.DisplayRole: ++ if role == Qt.ItemDataRole.DisplayRole: + if col == 0: + return item.ruletype.name + elif col == 1: +@@ -33,5 +33,5 @@ class DefaultTableModel(SEToolsTableModel): + with suppress(AttributeError): + return item.default_range.name + +- elif role == Qt.UserRole: ++ elif role == Qt.ItemDataRole.UserRole: + return item +diff --git a/setoolsgui/details.py b/setoolsgui/details.py +index 4eb70066cfdb..8d4882cd6a1e 100644 +--- a/setoolsgui/details.py ++++ b/setoolsgui/details.py +@@ -37,15 +37,15 @@ class DetailsPopup(SEToolsWidget, QDialog): + self.setWindowTitle(text) + + def append(self, text): +- self.contents.setFontWeight(QFont.Normal) ++ self.contents.setFontWeight(QFont.Weight.Normal) + self.contents.setFontPointSize(9) + self.contents.append(text) + + def append_header(self, text): +- self.contents.setFontWeight(QFont.Black) ++ self.contents.setFontWeight(QFont.Weight.Black) + self.contents.setFontPointSize(11) + self.contents.append(text) + + def show(self): +- self.contents.moveCursor(QTextCursor.Start) ++ self.contents.moveCursor(QTextCursor.MoveOperation.Start) + super(DetailsPopup, self).show() +diff --git a/setoolsgui/fsusemodel.py b/setoolsgui/fsusemodel.py +index 2b3a3f402af9..bc100784c490 100644 +--- a/setoolsgui/fsusemodel.py ++++ b/setoolsgui/fsusemodel.py +@@ -20,7 +20,7 @@ class FSUseTableModel(SEToolsTableModel): + col = index.column() + rule = self.resultlist[row] + +- if role == Qt.DisplayRole: ++ if role == Qt.ItemDataRole.DisplayRole: + if col == 0: + return rule.ruletype.name + elif col == 1: +@@ -28,5 +28,5 @@ class FSUseTableModel(SEToolsTableModel): + elif col == 2: + return str(rule.context) + +- elif role == Qt.UserRole: ++ elif role == Qt.ItemDataRole.UserRole: + return rule +diff --git a/setoolsgui/genfsconmodel.py b/setoolsgui/genfsconmodel.py +index 6fc46408865c..1e50d929446a 100644 +--- a/setoolsgui/genfsconmodel.py ++++ b/setoolsgui/genfsconmodel.py +@@ -32,7 +32,7 @@ class GenfsconTableModel(SEToolsTableModel): + col = index.column() + rule = self.resultlist[row] + +- if role == Qt.DisplayRole: ++ if role == Qt.ItemDataRole.DisplayRole: + if col == 0: + return rule.fs + elif col == 1: +@@ -42,5 +42,5 @@ class GenfsconTableModel(SEToolsTableModel): + elif col == 3: + return str(rule.context) + +- elif role == Qt.UserRole: ++ elif role == Qt.ItemDataRole.UserRole: + return rule +diff --git a/setoolsgui/ibendportconmodel.py b/setoolsgui/ibendportconmodel.py +index 199932d39415..37b7a8d74948 100644 +--- a/setoolsgui/ibendportconmodel.py ++++ b/setoolsgui/ibendportconmodel.py +@@ -20,7 +20,7 @@ class IbendportconTableModel(SEToolsTableModel): + col = index.column() + rule = self.resultlist[row] + +- if role == Qt.DisplayRole: ++ if role == Qt.ItemDataRole.DisplayRole: + if col == 0: + return rule.name + elif col == 1: +@@ -28,5 +28,5 @@ class IbendportconTableModel(SEToolsTableModel): + elif col == 2: + return str(rule.context) + +- elif role == Qt.UserRole: ++ elif role == Qt.ItemDataRole.UserRole: + return rule +diff --git a/setoolsgui/ibpkeyconmodel.py b/setoolsgui/ibpkeyconmodel.py +index f3cd95205d51..160425504521 100644 +--- a/setoolsgui/ibpkeyconmodel.py ++++ b/setoolsgui/ibpkeyconmodel.py +@@ -20,7 +20,7 @@ class IbpkeyconTableModel(SEToolsTableModel): + col = index.column() + rule = self.resultlist[row] + +- if role == Qt.DisplayRole: ++ if role == Qt.ItemDataRole.DisplayRole: + if col == 0: + return str(rule.subnet_prefix) + elif col == 1: +@@ -32,5 +32,5 @@ class IbpkeyconTableModel(SEToolsTableModel): + elif col == 2: + return str(rule.context) + +- elif role == Qt.UserRole: ++ elif role == Qt.ItemDataRole.UserRole: + return rule +diff --git a/setoolsgui/initsidmodel.py b/setoolsgui/initsidmodel.py +index 1155a50fccb9..9ffb408024fd 100644 +--- a/setoolsgui/initsidmodel.py ++++ b/setoolsgui/initsidmodel.py +@@ -20,11 +20,11 @@ class InitialSIDTableModel(SEToolsTableModel): + col = index.column() + rule = self.resultlist[row] + +- if role == Qt.DisplayRole: ++ if role == Qt.ItemDataRole.DisplayRole: + if col == 0: + return rule.name + elif col == 1: + return str(rule.context) + +- elif role == Qt.UserRole: ++ elif role == Qt.ItemDataRole.UserRole: + return rule +diff --git a/setoolsgui/listview.py b/setoolsgui/listview.py +index a4beda50b9f6..e803975c52c6 100644 +--- a/setoolsgui/listview.py ++++ b/setoolsgui/listview.py +@@ -34,14 +34,14 @@ class SEToolsListView(QListView): + + for row in range(model.rowCount()): + index = model.createIndex(row, 0) +- selection_model.select(index, QItemSelectionModel.Toggle) ++ selection_model.select(index, QItemSelectionModel.SelectionFlag.Toggle) + +- def selection(self, qt_role=Qt.UserRole): ++ def selection(self, qt_role=Qt.ItemDataRole.UserRole): + """ + Generator which returns the selection. + + Parameter: +- qt_role The Qt model role. Default is Qt.UserRole. ++ qt_role The Qt model role. Default is Qt.ItemDataRole.UserRole. + + Yield: tuple(row, data) + row The row number of the selection. +diff --git a/setoolsgui/mlsmodel.py b/setoolsgui/mlsmodel.py +index 8dfb28066d34..147378ef585a 100644 +--- a/setoolsgui/mlsmodel.py ++++ b/setoolsgui/mlsmodel.py +@@ -63,11 +63,11 @@ class MLSComponentTableModel(SEToolsTableModel): + col = index.column() + item = self.resultlist[row] + +- if role == Qt.DisplayRole: ++ if role == Qt.ItemDataRole.DisplayRole: + if col == 0: + return item.name + elif col == 1: + return ", ".join(sorted(a for a in item.aliases())) + +- elif role == Qt.UserRole: ++ elif role == Qt.ItemDataRole.UserRole: + return item +diff --git a/setoolsgui/mlsrulemodel.py b/setoolsgui/mlsrulemodel.py +index 4fa4f186a6cf..54ad4c216c72 100644 +--- a/setoolsgui/mlsrulemodel.py ++++ b/setoolsgui/mlsrulemodel.py +@@ -20,7 +20,7 @@ class MLSRuleTableModel(SEToolsTableModel): + col = index.column() + rule = self.resultlist[row] + +- if role == Qt.DisplayRole: ++ if role == Qt.ItemDataRole.DisplayRole: + if col == 0: + return rule.ruletype.name + elif col == 1: +@@ -32,5 +32,5 @@ class MLSRuleTableModel(SEToolsTableModel): + elif col == 4: + return str(rule.default) + +- elif role == Qt.UserRole: ++ elif role == Qt.ItemDataRole.UserRole: + return rule +diff --git a/setoolsgui/models.py b/setoolsgui/models.py +index fc7bf3df9ccf..dd864e932fbc 100644 +--- a/setoolsgui/models.py ++++ b/setoolsgui/models.py +@@ -19,7 +19,7 @@ def invert_list_selection(selection_model): + rowcount = model.rowCount() + for row in range(rowcount): + index = model.createIndex(row, 0) +- selection_model.select(index, QItemSelectionModel.Toggle) ++ selection_model.select(index, QItemSelectionModel.SelectionFlag.Toggle) + + + class SEToolsListModel(QAbstractListModel): +@@ -27,8 +27,8 @@ class SEToolsListModel(QAbstractListModel): + """ + The purpose of this model is to have the + objects return their string representations +- for Qt.DisplayRole and return the object +- for Qt.UserRole. ++ for Qt.ItemDataRole.DisplayRole and return the object ++ for Qt.ItemDataRole.UserRole. + + Some Python list-like functions are provided + for altering the model: append and remove +@@ -81,9 +81,9 @@ class SEToolsListModel(QAbstractListModel): + row = index.row() + item = self.item_list[row] + +- if role == Qt.DisplayRole: ++ if role == Qt.ItemDataRole.DisplayRole: + return str(item) +- elif role == Qt.UserRole: ++ elif role == Qt.ItemDataRole.UserRole: + return item + + +@@ -133,7 +133,7 @@ class SEToolsTableModel(QAbstractTableModel): + self.resultlist = [] + + def headerData(self, section, orientation, role): +- if role == Qt.DisplayRole and orientation == Qt.Horizontal: ++ if role == Qt.ItemDataRole.DisplayRole and orientation == Qt.Orientation.Horizontal: + return self.headers[section] + + def rowCount(self, parent=QModelIndex()): +diff --git a/setoolsgui/netifconmodel.py b/setoolsgui/netifconmodel.py +index 3d2e4b8b6ee1..54659203e7e5 100644 +--- a/setoolsgui/netifconmodel.py ++++ b/setoolsgui/netifconmodel.py +@@ -20,7 +20,7 @@ class NetifconTableModel(SEToolsTableModel): + col = index.column() + rule = self.resultlist[row] + +- if role == Qt.DisplayRole: ++ if role == Qt.ItemDataRole.DisplayRole: + if col == 0: + return rule.netif + elif col == 1: +@@ -28,5 +28,5 @@ class NetifconTableModel(SEToolsTableModel): + elif col == 2: + return str(rule.packet) + +- elif role == Qt.UserRole: ++ elif role == Qt.ItemDataRole.UserRole: + return rule +diff --git a/setoolsgui/nodeconmodel.py b/setoolsgui/nodeconmodel.py +index ec4d66e9a026..f8055fca194d 100644 +--- a/setoolsgui/nodeconmodel.py ++++ b/setoolsgui/nodeconmodel.py +@@ -20,11 +20,11 @@ class NodeconTableModel(SEToolsTableModel): + col = index.column() + rule = self.resultlist[row] + +- if role == Qt.DisplayRole: ++ if role == Qt.ItemDataRole.DisplayRole: + if col == 0: + return str(rule.network.with_netmask) + elif col == 1: + return str(rule.context) + +- elif role == Qt.UserRole: ++ elif role == Qt.ItemDataRole.UserRole: + return rule +diff --git a/setoolsgui/objclassmodel.py b/setoolsgui/objclassmodel.py +index 9823b73b30ee..ff1641f8cc3e 100644 +--- a/setoolsgui/objclassmodel.py ++++ b/setoolsgui/objclassmodel.py +@@ -58,7 +58,7 @@ class ObjClassTableModel(SEToolsTableModel): + col = index.column() + item = self.resultlist[row] + +- if role == Qt.DisplayRole: ++ if role == Qt.ItemDataRole.DisplayRole: + if col == 0: + return item.name + elif col == 1: +@@ -69,5 +69,5 @@ class ObjClassTableModel(SEToolsTableModel): + + return ", ".join(sorted(chain(com_perms, item.perms))) + +- elif role == Qt.UserRole: ++ elif role == Qt.ItemDataRole.UserRole: + return item +diff --git a/setoolsgui/portconmodel.py b/setoolsgui/portconmodel.py +index 39d2c72e4625..1c3de4494af9 100644 +--- a/setoolsgui/portconmodel.py ++++ b/setoolsgui/portconmodel.py +@@ -20,7 +20,7 @@ class PortconTableModel(SEToolsTableModel): + col = index.column() + rule = self.resultlist[row] + +- if role == Qt.DisplayRole: ++ if role == Qt.ItemDataRole.DisplayRole: + if col == 0: + low, high = rule.ports + if low == high: +@@ -32,5 +32,5 @@ class PortconTableModel(SEToolsTableModel): + elif col == 2: + return str(rule.context) + +- elif role == Qt.UserRole: ++ elif role == Qt.ItemDataRole.UserRole: + return rule +diff --git a/setoolsgui/rbacrulemodel.py b/setoolsgui/rbacrulemodel.py +index d8df9409ed56..84d2ff09e4fc 100644 +--- a/setoolsgui/rbacrulemodel.py ++++ b/setoolsgui/rbacrulemodel.py +@@ -21,7 +21,7 @@ class RBACRuleTableModel(SEToolsTableModel): + col = index.column() + rule = self.resultlist[row] + +- if role == Qt.DisplayRole: ++ if role == Qt.ItemDataRole.DisplayRole: + if col == 0: + return rule.ruletype.name + elif col == 1: +@@ -41,5 +41,5 @@ class RBACRuleTableModel(SEToolsTableModel): + except RuleUseError: + return None + +- elif role == Qt.UserRole: ++ elif role == Qt.ItemDataRole.UserRole: + return rule +diff --git a/setoolsgui/rolemodel.py b/setoolsgui/rolemodel.py +index 004f4e7614ba..2dd7fe64d37e 100644 +--- a/setoolsgui/rolemodel.py ++++ b/setoolsgui/rolemodel.py +@@ -47,11 +47,11 @@ class RoleTableModel(SEToolsTableModel): + col = index.column() + item = self.resultlist[row] + +- if role == Qt.DisplayRole: ++ if role == Qt.ItemDataRole.DisplayRole: + if col == 0: + return item.name + elif col == 1: + return ", ".join(sorted(t.name for t in item.types())) +- elif role == Qt.UserRole: ++ elif role == Qt.ItemDataRole.UserRole: + # get the whole object + return item +diff --git a/setoolsgui/tableview.py b/setoolsgui/tableview.py +index 9726cb053466..9ba49aa50fa3 100644 +--- a/setoolsgui/tableview.py ++++ b/setoolsgui/tableview.py +@@ -45,7 +45,7 @@ class SEToolsTableView(QTableView): + elif prev_col is not None and current_col != prev_col: + selected_text.append('\t') + +- selected_text.append(datamodel.data(index, Qt.DisplayRole)) ++ selected_text.append(datamodel.data(index, Qt.ItemDataRole.DisplayRole)) + + prev_row = current_row + prev_col = current_col +@@ -76,7 +76,7 @@ class SEToolsTableView(QTableView): + # write headers + csv_row = [] + for col in range(col_count): +- csv_row.append(datamodel.headerData(col, Qt.Horizontal, Qt.DisplayRole)) ++ csv_row.append(datamodel.headerData(col, Qt.Orientation.Horizontal, Qt.ItemDataRole.DisplayRole)) + + writer.writerow(csv_row) + +@@ -86,6 +86,6 @@ class SEToolsTableView(QTableView): + + for col in range(col_count): + index = datamodel.index(row, col) +- csv_row.append(datamodel.data(index, Qt.DisplayRole)) ++ csv_row.append(datamodel.data(index, Qt.ItemDataRole.DisplayRole)) + + writer.writerow(csv_row) +diff --git a/setoolsgui/terulemodel.py b/setoolsgui/terulemodel.py +index 4d51ac8e9b25..53b61a06d152 100644 +--- a/setoolsgui/terulemodel.py ++++ b/setoolsgui/terulemodel.py +@@ -22,7 +22,7 @@ class TERuleTableModel(SEToolsTableModel): + col = index.column() + rule = self.resultlist[row] + +- if role == Qt.DisplayRole: ++ if role == Qt.ItemDataRole.DisplayRole: + if col == 0: + return rule.ruletype.name + elif col == 1: +@@ -50,5 +50,5 @@ class TERuleTableModel(SEToolsTableModel): + except RuleNotConditional: + return None + +- elif role == Qt.UserRole: ++ elif role == Qt.ItemDataRole.UserRole: + return rule +diff --git a/setoolsgui/typeattrmodel.py b/setoolsgui/typeattrmodel.py +index 1a752fcd82f0..0b7c7ffe65a5 100644 +--- a/setoolsgui/typeattrmodel.py ++++ b/setoolsgui/typeattrmodel.py +@@ -44,11 +44,11 @@ class TypeAttributeTableModel(SEToolsTableModel): + col = index.column() + item = self.resultlist[row] + +- if role == Qt.DisplayRole: ++ if role == Qt.ItemDataRole.DisplayRole: + if col == 0: + return item.name + elif col == 1: + return ", ".join(sorted(t.name for t in item.expand())) + +- elif role == Qt.UserRole: ++ elif role == Qt.ItemDataRole.UserRole: + return item +diff --git a/setoolsgui/typemodel.py b/setoolsgui/typemodel.py +index 841cc42a52d3..037996b96a8c 100644 +--- a/setoolsgui/typemodel.py ++++ b/setoolsgui/typemodel.py +@@ -50,7 +50,7 @@ class TypeTableModel(SEToolsTableModel): + col = index.column() + item = self.resultlist[row] + +- if role == Qt.DisplayRole: ++ if role == Qt.ItemDataRole.DisplayRole: + if col == 0: + return item.name + elif col == 1: +@@ -60,5 +60,5 @@ class TypeTableModel(SEToolsTableModel): + elif col == 3 and item.ispermissive: + return "Permissive" + +- elif role == Qt.UserRole: ++ elif role == Qt.ItemDataRole.UserRole: + return item +diff --git a/setoolsgui/usermodel.py b/setoolsgui/usermodel.py +index d0a4b0ed1a63..d5aca7bc11a0 100644 +--- a/setoolsgui/usermodel.py ++++ b/setoolsgui/usermodel.py +@@ -56,7 +56,7 @@ class UserTableModel(SEToolsTableModel): + + def data(self, index, role): + if self.resultlist and index.isValid(): +- if role == Qt.DisplayRole: ++ if role == Qt.ItemDataRole.DisplayRole: + row = index.row() + col = index.column() + user = self.resultlist[row] +@@ -76,5 +76,5 @@ class UserTableModel(SEToolsTableModel): + except MLSDisabled: + return None + +- elif role == Qt.UserRole: ++ elif role == Qt.ItemDataRole.UserRole: + return user +-- +2.41.0 + diff --git a/0002-Use-PyQt6.patch b/0002-Use-PyQt6.patch new file mode 100644 index 0000000..8b0285c --- /dev/null +++ b/0002-Use-PyQt6.patch @@ -0,0 +1,1121 @@ +From a9a062004e9974e06880e57ddb2c9699de2696f0 Mon Sep 17 00:00:00 2001 +From: Petr Lautrbach +Date: Mon, 4 Sep 2023 16:12:59 +0200 +Subject: [PATCH] Use PyQt6 +Content-type: text/plain + +Signed-off-by: Petr Lautrbach +--- + .mypy.ini | 2 +- + README.md | 6 +++--- + apol | 4 ++-- + setoolsgui/apol/analysistab.py | 4 ++-- + setoolsgui/apol/boolquery.py | 6 +++--- + setoolsgui/apol/boundsquery.py | 6 +++--- + setoolsgui/apol/categoryquery.py | 6 +++--- + setoolsgui/apol/chooseanalysis.py | 4 ++-- + setoolsgui/apol/commonquery.py | 6 +++--- + setoolsgui/apol/constraintquery.py | 6 +++--- + setoolsgui/apol/defaultquery.py | 6 +++--- + setoolsgui/apol/dta.py | 6 +++--- + setoolsgui/apol/excludetypes.py | 4 ++-- + setoolsgui/apol/fsusequery.py | 6 +++--- + setoolsgui/apol/genfsconquery.py | 6 +++--- + setoolsgui/apol/ibendportconquery.py | 6 +++--- + setoolsgui/apol/ibpkeyconquery.py | 6 +++--- + setoolsgui/apol/infoflow.py | 6 +++--- + setoolsgui/apol/initsidquery.py | 6 +++--- + setoolsgui/apol/mainwindow.py | 8 ++++---- + setoolsgui/apol/mlsrulequery.py | 6 +++--- + setoolsgui/apol/netifconquery.py | 6 +++--- + setoolsgui/apol/nodeconquery.py | 6 +++--- + setoolsgui/apol/objclassquery.py | 6 +++--- + setoolsgui/apol/permmapedit.py | 6 +++--- + setoolsgui/apol/portconquery.py | 6 +++--- + setoolsgui/apol/queryupdater.py | 2 +- + setoolsgui/apol/rbacrulequery.py | 6 +++--- + setoolsgui/apol/rolequery.py | 6 +++--- + setoolsgui/apol/sensitivityquery.py | 6 +++--- + setoolsgui/apol/summary.py | 6 +++--- + setoolsgui/apol/terulequery.py | 6 +++--- + setoolsgui/apol/typeattrquery.py | 6 +++--- + setoolsgui/apol/typequery.py | 6 +++--- + setoolsgui/apol/userquery.py | 6 +++--- + setoolsgui/apol/workspace.py | 2 +- + setoolsgui/boolmodel.py | 4 ++-- + setoolsgui/boundsmodel.py | 2 +- + setoolsgui/commonmodel.py | 4 ++-- + setoolsgui/constraintmodel.py | 2 +- + setoolsgui/defaultmodel.py | 2 +- + setoolsgui/details.py | 4 ++-- + setoolsgui/fsusemodel.py | 2 +- + setoolsgui/genfsconmodel.py | 2 +- + setoolsgui/getdetailslist.py | 4 ++-- + setoolsgui/ibendportconmodel.py | 2 +- + setoolsgui/ibpkeyconmodel.py | 2 +- + setoolsgui/initsidmodel.py | 2 +- + setoolsgui/listview.py | 6 +++--- + setoolsgui/logtosignal.py | 2 +- + setoolsgui/mlsmodel.py | 4 ++-- + setoolsgui/mlsrulemodel.py | 2 +- + setoolsgui/models.py | 2 +- + setoolsgui/netifconmodel.py | 2 +- + setoolsgui/nodeconmodel.py | 2 +- + setoolsgui/objclassmodel.py | 4 ++-- + setoolsgui/portconmodel.py | 2 +- + setoolsgui/rbacrulemodel.py | 2 +- + setoolsgui/rolemodel.py | 4 ++-- + setoolsgui/tableview.py | 6 +++--- + setoolsgui/terulemodel.py | 2 +- + setoolsgui/treeview.py | 6 +++--- + setoolsgui/typeattrmodel.py | 4 ++-- + setoolsgui/typemodel.py | 4 ++-- + setoolsgui/usermodel.py | 2 +- + setoolsgui/widget.py | 2 +- + 66 files changed, 144 insertions(+), 144 deletions(-) + +diff --git a/.mypy.ini b/.mypy.ini +index b45560b7d8d0..7d3aef848b4a 100644 +--- a/.mypy.ini ++++ b/.mypy.ini +@@ -9,7 +9,7 @@ ignore_missing_imports = True + [mypy-networkx.*] + ignore_missing_imports = True + +-[mypy-PyQt5.*] ++[mypy-PyQt6.*] + ignore_missing_imports = True + + [mypy-sip] +diff --git a/README.md b/README.md +index b5a05c9376c3..d291e0d5693d 100644 +--- a/README.md ++++ b/README.md +@@ -20,8 +20,8 @@ To run SETools command line tools, the following packages are required: + * libsepol 3.2+ + + To run SETools graphical tools, the following packages are also required: +-* PyQt5 +-* qt5-assistant ++* PyQt6 ++* qt6-assistant + * qt-devel (only if rebuilding the help file) + + To build SETools, the following development packages are required, in +@@ -73,7 +73,7 @@ the tools can be ran from the current directory (e.g. ```./seinfo```). + ### Rebuilding the Apol Help File + + For convenience, a prebuilt copy of the apol help data file is included. +-To rebuild this file, the Qt5 development tools are required ++To rebuild this file, the Qt6 development tools are required + (particularly, the ```qcollectiongenerator``` tool). At the root + of the SETools sources, perform the following: + ``` +diff --git a/apol b/apol +index 400832199eae..f32b29bf8c5c 100755 +--- a/apol ++++ b/apol +@@ -8,7 +8,7 @@ import sys + import argparse + import logging + +-from PyQt5.QtWidgets import QApplication ++from PyQt6.QtWidgets import QApplication + import setools + import setoolsgui + +@@ -42,7 +42,7 @@ logging.getLogger().addHandler(console_handler) + try: + app = QApplication(sys.argv) + mainwindow = setoolsgui.ApolMainWindow(args.policy) +- sys.exit(app.exec_()) ++ sys.exit(app.exec()) + + except Exception as err: + if args.debug: +diff --git a/setoolsgui/apol/analysistab.py b/setoolsgui/apol/analysistab.py +index bc3629ff274a..13f89db32277 100644 +--- a/setoolsgui/apol/analysistab.py ++++ b/setoolsgui/apol/analysistab.py +@@ -6,8 +6,8 @@ + from typing import Dict, NamedTuple + from enum import Enum + +-import sip +-from PyQt5.QtWidgets import QDialogButtonBox, QScrollArea ++import PyQt6.sip as sip ++from PyQt6.QtWidgets import QDialogButtonBox, QScrollArea + + from ..widget import SEToolsWidget + +diff --git a/setoolsgui/apol/boolquery.py b/setoolsgui/apol/boolquery.py +index 6116fe48a846..d7bf529fa267 100644 +--- a/setoolsgui/apol/boolquery.py ++++ b/setoolsgui/apol/boolquery.py +@@ -7,9 +7,9 @@ + import logging + from contextlib import suppress + +-from PyQt5.QtCore import Qt, QSortFilterProxyModel, QStringListModel, QThread +-from PyQt5.QtGui import QPalette, QTextCursor +-from PyQt5.QtWidgets import QCompleter, QHeaderView, QMessageBox, QProgressDialog ++from PyQt6.QtCore import Qt, QSortFilterProxyModel, QStringListModel, QThread ++from PyQt6.QtGui import QPalette, QTextCursor ++from PyQt6.QtWidgets import QCompleter, QHeaderView, QMessageBox, QProgressDialog + from setools import BoolQuery + + from ..logtosignal import LogHandlerToSignal +diff --git a/setoolsgui/apol/boundsquery.py b/setoolsgui/apol/boundsquery.py +index 5b90c2ee2ded..5c53803dbb7a 100644 +--- a/setoolsgui/apol/boundsquery.py ++++ b/setoolsgui/apol/boundsquery.py +@@ -7,9 +7,9 @@ + import logging + from contextlib import suppress + +-from PyQt5.QtCore import Qt, QSortFilterProxyModel, QStringListModel, QThread +-from PyQt5.QtGui import QPalette, QTextCursor +-from PyQt5.QtWidgets import QCompleter, QHeaderView, QMessageBox, QProgressDialog ++from PyQt6.QtCore import Qt, QSortFilterProxyModel, QStringListModel, QThread ++from PyQt6.QtGui import QPalette, QTextCursor ++from PyQt6.QtWidgets import QCompleter, QHeaderView, QMessageBox, QProgressDialog + from setools import BoundsQuery + + from ..logtosignal import LogHandlerToSignal +diff --git a/setoolsgui/apol/categoryquery.py b/setoolsgui/apol/categoryquery.py +index 598f163c335f..7df35566f672 100644 +--- a/setoolsgui/apol/categoryquery.py ++++ b/setoolsgui/apol/categoryquery.py +@@ -7,9 +7,9 @@ + import logging + from contextlib import suppress + +-from PyQt5.QtCore import Qt, QSortFilterProxyModel, QStringListModel, QThread +-from PyQt5.QtGui import QPalette, QTextCursor +-from PyQt5.QtWidgets import QCompleter, QHeaderView, QMessageBox, QProgressDialog ++from PyQt6.QtCore import Qt, QSortFilterProxyModel, QStringListModel, QThread ++from PyQt6.QtGui import QPalette, QTextCursor ++from PyQt6.QtWidgets import QCompleter, QHeaderView, QMessageBox, QProgressDialog + from setools import CategoryQuery + + from ..logtosignal import LogHandlerToSignal +diff --git a/setoolsgui/apol/chooseanalysis.py b/setoolsgui/apol/chooseanalysis.py +index 155ae6d2f4ae..d7d192a94c2a 100644 +--- a/setoolsgui/apol/chooseanalysis.py ++++ b/setoolsgui/apol/chooseanalysis.py +@@ -5,8 +5,8 @@ + # + from collections import defaultdict + +-from PyQt5.QtCore import Qt +-from PyQt5.QtWidgets import QDialog, QTreeWidgetItem ++from PyQt6.QtCore import Qt ++from PyQt6.QtWidgets import QDialog, QTreeWidgetItem + + from ..widget import SEToolsWidget + from .analysistab import AnalysisSection, AnalysisTab, TAB_REGISTRY +diff --git a/setoolsgui/apol/commonquery.py b/setoolsgui/apol/commonquery.py +index 8fb11e87290d..1c73a42aff4b 100644 +--- a/setoolsgui/apol/commonquery.py ++++ b/setoolsgui/apol/commonquery.py +@@ -7,9 +7,9 @@ + import logging + from contextlib import suppress + +-from PyQt5.QtCore import Qt, QSortFilterProxyModel, QStringListModel, QThread +-from PyQt5.QtGui import QPalette, QTextCursor +-from PyQt5.QtWidgets import QCompleter, QHeaderView, QMessageBox, QProgressDialog ++from PyQt6.QtCore import Qt, QSortFilterProxyModel, QStringListModel, QThread ++from PyQt6.QtGui import QPalette, QTextCursor ++from PyQt6.QtWidgets import QCompleter, QHeaderView, QMessageBox, QProgressDialog + from setools import CommonQuery + + from ..logtosignal import LogHandlerToSignal +diff --git a/setoolsgui/apol/constraintquery.py b/setoolsgui/apol/constraintquery.py +index ee64db0ca1df..efda65f4c55e 100644 +--- a/setoolsgui/apol/constraintquery.py ++++ b/setoolsgui/apol/constraintquery.py +@@ -7,9 +7,9 @@ + import logging + from contextlib import suppress + +-from PyQt5.QtCore import Qt, QSortFilterProxyModel, QStringListModel, QThread +-from PyQt5.QtGui import QPalette, QTextCursor +-from PyQt5.QtWidgets import QCompleter, QHeaderView, QMessageBox, QProgressDialog ++from PyQt6.QtCore import Qt, QSortFilterProxyModel, QStringListModel, QThread ++from PyQt6.QtGui import QPalette, QTextCursor ++from PyQt6.QtWidgets import QCompleter, QHeaderView, QMessageBox, QProgressDialog + from setools import ConstraintQuery + + from ..logtosignal import LogHandlerToSignal +diff --git a/setoolsgui/apol/defaultquery.py b/setoolsgui/apol/defaultquery.py +index e09692ee6a46..cad78d03e8a8 100644 +--- a/setoolsgui/apol/defaultquery.py ++++ b/setoolsgui/apol/defaultquery.py +@@ -8,9 +8,9 @@ + import logging + from contextlib import suppress + +-from PyQt5.QtCore import Qt, QSortFilterProxyModel, QStringListModel, QThread +-from PyQt5.QtGui import QPalette, QTextCursor +-from PyQt5.QtWidgets import QCompleter, QHeaderView, QMessageBox, QProgressDialog ++from PyQt6.QtCore import Qt, QSortFilterProxyModel, QStringListModel, QThread ++from PyQt6.QtGui import QPalette, QTextCursor ++from PyQt6.QtWidgets import QCompleter, QHeaderView, QMessageBox, QProgressDialog + from setools import DefaultQuery, DefaultValue, DefaultRangeValue + + from ..logtosignal import LogHandlerToSignal +diff --git a/setoolsgui/apol/dta.py b/setoolsgui/apol/dta.py +index 8bbed4dbe21f..bdbe6f448150 100644 +--- a/setoolsgui/apol/dta.py ++++ b/setoolsgui/apol/dta.py +@@ -7,9 +7,9 @@ + import logging + from contextlib import suppress + +-from PyQt5.QtCore import pyqtSignal, Qt, QStringListModel, QThread +-from PyQt5.QtGui import QPalette, QTextCursor +-from PyQt5.QtWidgets import QCompleter, QHeaderView, QMessageBox, QProgressDialog, \ ++from PyQt6.QtCore import pyqtSignal, Qt, QStringListModel, QThread ++from PyQt6.QtGui import QPalette, QTextCursor ++from PyQt6.QtWidgets import QCompleter, QHeaderView, QMessageBox, QProgressDialog, \ + QTreeWidgetItem + from setools import DomainTransitionAnalysis + +diff --git a/setoolsgui/apol/excludetypes.py b/setoolsgui/apol/excludetypes.py +index 1c4beaf84542..a764597cc1cd 100644 +--- a/setoolsgui/apol/excludetypes.py ++++ b/setoolsgui/apol/excludetypes.py +@@ -7,8 +7,8 @@ + import logging + import copy + +-from PyQt5.QtCore import Qt, QSortFilterProxyModel +-from PyQt5.QtWidgets import QDialog ++from PyQt6.QtCore import Qt, QSortFilterProxyModel ++from PyQt6.QtWidgets import QDialog + + from ..models import SEToolsListModel + from ..widget import SEToolsWidget +diff --git a/setoolsgui/apol/fsusequery.py b/setoolsgui/apol/fsusequery.py +index 4e7567f4e4c6..e0b77af58ef0 100644 +--- a/setoolsgui/apol/fsusequery.py ++++ b/setoolsgui/apol/fsusequery.py +@@ -7,9 +7,9 @@ + import logging + from contextlib import suppress + +-from PyQt5.QtCore import Qt, QSortFilterProxyModel, QStringListModel, QThread +-from PyQt5.QtGui import QPalette, QTextCursor +-from PyQt5.QtWidgets import QCompleter, QHeaderView, QMessageBox, QProgressDialog ++from PyQt6.QtCore import Qt, QSortFilterProxyModel, QStringListModel, QThread ++from PyQt6.QtGui import QPalette, QTextCursor ++from PyQt6.QtWidgets import QCompleter, QHeaderView, QMessageBox, QProgressDialog + from setools import FSUseQuery + + from ..logtosignal import LogHandlerToSignal +diff --git a/setoolsgui/apol/genfsconquery.py b/setoolsgui/apol/genfsconquery.py +index 33dbed787cd6..5294e9042857 100644 +--- a/setoolsgui/apol/genfsconquery.py ++++ b/setoolsgui/apol/genfsconquery.py +@@ -7,9 +7,9 @@ + import logging + from contextlib import suppress + +-from PyQt5.QtCore import Qt, QSortFilterProxyModel, QStringListModel, QThread +-from PyQt5.QtGui import QPalette, QTextCursor +-from PyQt5.QtWidgets import QCompleter, QHeaderView, QMessageBox, QProgressDialog ++from PyQt6.QtCore import Qt, QSortFilterProxyModel, QStringListModel, QThread ++from PyQt6.QtGui import QPalette, QTextCursor ++from PyQt6.QtWidgets import QCompleter, QHeaderView, QMessageBox, QProgressDialog + from setools import GenfsconQuery + + from ..logtosignal import LogHandlerToSignal +diff --git a/setoolsgui/apol/ibendportconquery.py b/setoolsgui/apol/ibendportconquery.py +index 18252dd23de0..e688773eac5a 100644 +--- a/setoolsgui/apol/ibendportconquery.py ++++ b/setoolsgui/apol/ibendportconquery.py +@@ -7,9 +7,9 @@ + import logging + from contextlib import suppress + +-from PyQt5.QtCore import Qt, QSortFilterProxyModel, QStringListModel, QThread +-from PyQt5.QtGui import QPalette, QTextCursor +-from PyQt5.QtWidgets import QCompleter, QProgressDialog ++from PyQt6.QtCore import Qt, QSortFilterProxyModel, QStringListModel, QThread ++from PyQt6.QtGui import QPalette, QTextCursor ++from PyQt6.QtWidgets import QCompleter, QProgressDialog + from setools import IbendportconQuery + + from ..logtosignal import LogHandlerToSignal +diff --git a/setoolsgui/apol/ibpkeyconquery.py b/setoolsgui/apol/ibpkeyconquery.py +index b7a78bf908a0..27be270f6602 100644 +--- a/setoolsgui/apol/ibpkeyconquery.py ++++ b/setoolsgui/apol/ibpkeyconquery.py +@@ -7,9 +7,9 @@ + import logging + from contextlib import suppress + +-from PyQt5.QtCore import Qt, QSortFilterProxyModel, QStringListModel, QThread +-from PyQt5.QtGui import QPalette, QTextCursor +-from PyQt5.QtWidgets import QCompleter, QProgressDialog ++from PyQt6.QtCore import Qt, QSortFilterProxyModel, QStringListModel, QThread ++from PyQt6.QtGui import QPalette, QTextCursor ++from PyQt6.QtWidgets import QCompleter, QProgressDialog + from setools import IbpkeyconQuery + + from ..logtosignal import LogHandlerToSignal +diff --git a/setoolsgui/apol/infoflow.py b/setoolsgui/apol/infoflow.py +index 526f3074e143..a57c232ccc3e 100644 +--- a/setoolsgui/apol/infoflow.py ++++ b/setoolsgui/apol/infoflow.py +@@ -9,9 +9,9 @@ import copy + from collections import defaultdict + from contextlib import suppress + +-from PyQt5.QtCore import pyqtSignal, Qt, QStringListModel, QThread +-from PyQt5.QtGui import QPalette, QTextCursor +-from PyQt5.QtWidgets import QCompleter, QHeaderView, QMessageBox, QProgressDialog, \ ++from PyQt6.QtCore import pyqtSignal, Qt, QStringListModel, QThread ++from PyQt6.QtGui import QPalette, QTextCursor ++from PyQt6.QtWidgets import QCompleter, QHeaderView, QMessageBox, QProgressDialog, \ + QTreeWidgetItem + from setools import InfoFlowAnalysis + from setools.exception import UnmappedClass, UnmappedPermission +diff --git a/setoolsgui/apol/initsidquery.py b/setoolsgui/apol/initsidquery.py +index d01f87130925..f84e4c2260a9 100644 +--- a/setoolsgui/apol/initsidquery.py ++++ b/setoolsgui/apol/initsidquery.py +@@ -7,9 +7,9 @@ + import logging + from contextlib import suppress + +-from PyQt5.QtCore import Qt, QSortFilterProxyModel, QStringListModel, QThread +-from PyQt5.QtGui import QPalette, QTextCursor +-from PyQt5.QtWidgets import QCompleter, QHeaderView, QMessageBox, QProgressDialog ++from PyQt6.QtCore import Qt, QSortFilterProxyModel, QStringListModel, QThread ++from PyQt6.QtGui import QPalette, QTextCursor ++from PyQt6.QtWidgets import QCompleter, QHeaderView, QMessageBox, QProgressDialog + from setools import InitialSIDQuery + + from ..logtosignal import LogHandlerToSignal +diff --git a/setoolsgui/apol/mainwindow.py b/setoolsgui/apol/mainwindow.py +index dcbfb7590ef7..7dc3cd852820 100644 +--- a/setoolsgui/apol/mainwindow.py ++++ b/setoolsgui/apol/mainwindow.py +@@ -11,8 +11,8 @@ import json + from contextlib import suppress + + import pkg_resources +-from PyQt5.QtCore import pyqtSlot, Qt, QProcess +-from PyQt5.QtWidgets import QApplication, QFileDialog, QLineEdit, QMainWindow, QMessageBox ++from PyQt6.QtCore import pyqtSlot, Qt, QProcess ++from PyQt6.QtWidgets import QApplication, QFileDialog, QLineEdit, QMainWindow, QMessageBox + from setools import __version__, PermissionMap, SELinuxPolicy + + from ..widget import SEToolsWidget +@@ -26,7 +26,7 @@ from .summary import SummaryTab + + + BIN_SEARCH_PATHS = ("/usr/local/bin:/usr/bin:/bin") +-POSSIBLE_ASSISTANT = ("assistant", "assistant-qt5") ++POSSIBLE_ASSISTANT = ("assistant", "assistant-qt6") + + + class ApolMainWindow(SEToolsWidget, QMainWindow): +@@ -666,7 +666,7 @@ class ApolMainWindow(SEToolsWidget, QMainWindow): + reply = QMessageBox.question( + self, "Qt Assistant Package Installed?", + "Failed to start QT Assistant program {}. " +- "This is typically in the assistant or qt5-assistant package. " ++ "This is typically in the assistant or qt6-assistant package. " + "Choose location of Qt Assistant executable?".format( + self.config.assistant), + QMessageBox.StandardButton.Yes | QMessageBox.StandardButton.No) +diff --git a/setoolsgui/apol/mlsrulequery.py b/setoolsgui/apol/mlsrulequery.py +index bb554ade6657..ec0a20955ed8 100644 +--- a/setoolsgui/apol/mlsrulequery.py ++++ b/setoolsgui/apol/mlsrulequery.py +@@ -7,9 +7,9 @@ + import logging + from contextlib import suppress + +-from PyQt5.QtCore import Qt, QSortFilterProxyModel, QStringListModel, QThread +-from PyQt5.QtGui import QPalette, QTextCursor +-from PyQt5.QtWidgets import QCompleter, QHeaderView, QMessageBox, QProgressDialog ++from PyQt6.QtCore import Qt, QSortFilterProxyModel, QStringListModel, QThread ++from PyQt6.QtGui import QPalette, QTextCursor ++from PyQt6.QtWidgets import QCompleter, QHeaderView, QMessageBox, QProgressDialog + from setools import MLSRuleQuery + + from ..logtosignal import LogHandlerToSignal +diff --git a/setoolsgui/apol/netifconquery.py b/setoolsgui/apol/netifconquery.py +index 4cf3de1a9f5c..3c828edb26c6 100644 +--- a/setoolsgui/apol/netifconquery.py ++++ b/setoolsgui/apol/netifconquery.py +@@ -7,9 +7,9 @@ + import logging + from contextlib import suppress + +-from PyQt5.QtCore import Qt, QSortFilterProxyModel, QStringListModel, QThread +-from PyQt5.QtGui import QPalette, QTextCursor +-from PyQt5.QtWidgets import QCompleter, QHeaderView, QMessageBox, QProgressDialog ++from PyQt6.QtCore import Qt, QSortFilterProxyModel, QStringListModel, QThread ++from PyQt6.QtGui import QPalette, QTextCursor ++from PyQt6.QtWidgets import QCompleter, QHeaderView, QMessageBox, QProgressDialog + from setools import NetifconQuery + + from ..logtosignal import LogHandlerToSignal +diff --git a/setoolsgui/apol/nodeconquery.py b/setoolsgui/apol/nodeconquery.py +index 81a33a794c05..dddfa069b9ad 100644 +--- a/setoolsgui/apol/nodeconquery.py ++++ b/setoolsgui/apol/nodeconquery.py +@@ -8,9 +8,9 @@ import sys + import logging + from contextlib import suppress + +-from PyQt5.QtCore import Qt, QSortFilterProxyModel, QStringListModel, QThread +-from PyQt5.QtGui import QPalette, QTextCursor +-from PyQt5.QtWidgets import QCompleter, QHeaderView, QMessageBox, QProgressDialog ++from PyQt6.QtCore import Qt, QSortFilterProxyModel, QStringListModel, QThread ++from PyQt6.QtGui import QPalette, QTextCursor ++from PyQt6.QtWidgets import QCompleter, QHeaderView, QMessageBox, QProgressDialog + from setools import NodeconQuery, NodeconIPVersion + + from ..logtosignal import LogHandlerToSignal +diff --git a/setoolsgui/apol/objclassquery.py b/setoolsgui/apol/objclassquery.py +index 23c8188e8bbd..4f0355dd3176 100644 +--- a/setoolsgui/apol/objclassquery.py ++++ b/setoolsgui/apol/objclassquery.py +@@ -7,9 +7,9 @@ + import logging + from contextlib import suppress + +-from PyQt5.QtCore import Qt, QSortFilterProxyModel, QStringListModel, QThread +-from PyQt5.QtGui import QPalette, QTextCursor +-from PyQt5.QtWidgets import QCompleter, QHeaderView, QMessageBox, QProgressDialog ++from PyQt6.QtCore import Qt, QSortFilterProxyModel, QStringListModel, QThread ++from PyQt6.QtGui import QPalette, QTextCursor ++from PyQt6.QtWidgets import QCompleter, QHeaderView, QMessageBox, QProgressDialog + from setools import ObjClassQuery + + from ..logtosignal import LogHandlerToSignal +diff --git a/setoolsgui/apol/permmapedit.py b/setoolsgui/apol/permmapedit.py +index d1e0b01ce854..ee01917a7bc5 100644 +--- a/setoolsgui/apol/permmapedit.py ++++ b/setoolsgui/apol/permmapedit.py +@@ -6,9 +6,9 @@ + import logging + import copy + +-from PyQt5.QtCore import pyqtSignal, pyqtSlot, Qt +-from PyQt5.QtGui import QPalette +-from PyQt5.QtWidgets import QDialog, QFrame, QWidget ++from PyQt6.QtCore import pyqtSignal, pyqtSlot, Qt ++from PyQt6.QtGui import QPalette ++from PyQt6.QtWidgets import QDialog, QFrame, QWidget + + from ..models import SEToolsListModel + from ..widget import SEToolsWidget +diff --git a/setoolsgui/apol/portconquery.py b/setoolsgui/apol/portconquery.py +index de0a16567f1c..2afdd16e9f9c 100644 +--- a/setoolsgui/apol/portconquery.py ++++ b/setoolsgui/apol/portconquery.py +@@ -8,9 +8,9 @@ + import logging + from contextlib import suppress + +-from PyQt5.QtCore import Qt, QSortFilterProxyModel, QStringListModel, QThread +-from PyQt5.QtGui import QPalette, QTextCursor +-from PyQt5.QtWidgets import QCompleter, QHeaderView, QMessageBox, QProgressDialog ++from PyQt6.QtCore import Qt, QSortFilterProxyModel, QStringListModel, QThread ++from PyQt6.QtGui import QPalette, QTextCursor ++from PyQt6.QtWidgets import QCompleter, QHeaderView, QMessageBox, QProgressDialog + from setools import PortconQuery, PortconProtocol + + from ..logtosignal import LogHandlerToSignal +diff --git a/setoolsgui/apol/queryupdater.py b/setoolsgui/apol/queryupdater.py +index 9b6c155caa0a..07dc21a7d83d 100644 +--- a/setoolsgui/apol/queryupdater.py ++++ b/setoolsgui/apol/queryupdater.py +@@ -3,7 +3,7 @@ + # SPDX-License-Identifier: LGPL-2.1-only + # + # +-from PyQt5.QtCore import pyqtSignal, QObject, QThread ++from PyQt6.QtCore import pyqtSignal, QObject, QThread + + + class QueryResultsUpdater(QObject): +diff --git a/setoolsgui/apol/rbacrulequery.py b/setoolsgui/apol/rbacrulequery.py +index 4749d324d858..505a1858d015 100644 +--- a/setoolsgui/apol/rbacrulequery.py ++++ b/setoolsgui/apol/rbacrulequery.py +@@ -7,9 +7,9 @@ + import logging + from contextlib import suppress + +-from PyQt5.QtCore import Qt, QSortFilterProxyModel, QStringListModel, QThread +-from PyQt5.QtGui import QPalette, QTextCursor +-from PyQt5.QtWidgets import QCompleter, QHeaderView, QMessageBox, QProgressDialog ++from PyQt6.QtCore import Qt, QSortFilterProxyModel, QStringListModel, QThread ++from PyQt6.QtGui import QPalette, QTextCursor ++from PyQt6.QtWidgets import QCompleter, QHeaderView, QMessageBox, QProgressDialog + from setools import RBACRuleQuery + + from ..logtosignal import LogHandlerToSignal +diff --git a/setoolsgui/apol/rolequery.py b/setoolsgui/apol/rolequery.py +index e75614d9a992..bd1a02a1d614 100644 +--- a/setoolsgui/apol/rolequery.py ++++ b/setoolsgui/apol/rolequery.py +@@ -7,9 +7,9 @@ + import logging + from contextlib import suppress + +-from PyQt5.QtCore import Qt, QSortFilterProxyModel, QStringListModel, QThread +-from PyQt5.QtGui import QPalette, QTextCursor +-from PyQt5.QtWidgets import QCompleter, QHeaderView, QMessageBox, QProgressDialog ++from PyQt6.QtCore import Qt, QSortFilterProxyModel, QStringListModel, QThread ++from PyQt6.QtGui import QPalette, QTextCursor ++from PyQt6.QtWidgets import QCompleter, QHeaderView, QMessageBox, QProgressDialog + from setools import RoleQuery + + from ..logtosignal import LogHandlerToSignal +diff --git a/setoolsgui/apol/sensitivityquery.py b/setoolsgui/apol/sensitivityquery.py +index c8a27891ae97..aac7e2971b6d 100644 +--- a/setoolsgui/apol/sensitivityquery.py ++++ b/setoolsgui/apol/sensitivityquery.py +@@ -7,9 +7,9 @@ + import logging + from contextlib import suppress + +-from PyQt5.QtCore import Qt, QSortFilterProxyModel, QStringListModel, QThread +-from PyQt5.QtGui import QPalette, QTextCursor +-from PyQt5.QtWidgets import QCompleter, QHeaderView, QMessageBox, QProgressDialog ++from PyQt6.QtCore import Qt, QSortFilterProxyModel, QStringListModel, QThread ++from PyQt6.QtGui import QPalette, QTextCursor ++from PyQt6.QtWidgets import QCompleter, QHeaderView, QMessageBox, QProgressDialog + from setools import SensitivityQuery + + from ..logtosignal import LogHandlerToSignal +diff --git a/setoolsgui/apol/summary.py b/setoolsgui/apol/summary.py +index 1aeb2b303bd6..32b6c5fcfbe5 100644 +--- a/setoolsgui/apol/summary.py ++++ b/setoolsgui/apol/summary.py +@@ -7,9 +7,9 @@ + + import logging + +-from PyQt5.QtCore import Qt, QSortFilterProxyModel, QStringListModel, QThread +-from PyQt5.QtGui import QPalette, QTextCursor +-from PyQt5.QtWidgets import QCompleter, QHeaderView, QMessageBox, QProgressDialog ++from PyQt6.QtCore import Qt, QSortFilterProxyModel, QStringListModel, QThread ++from PyQt6.QtGui import QPalette, QTextCursor ++from PyQt6.QtWidgets import QCompleter, QHeaderView, QMessageBox, QProgressDialog + from setools import MLSRuleQuery + + from ..logtosignal import LogHandlerToSignal +diff --git a/setoolsgui/apol/terulequery.py b/setoolsgui/apol/terulequery.py +index 7c99469edc87..4aba54cc59d0 100644 +--- a/setoolsgui/apol/terulequery.py ++++ b/setoolsgui/apol/terulequery.py +@@ -7,9 +7,9 @@ + import logging + from contextlib import suppress + +-from PyQt5.QtCore import Qt, QSortFilterProxyModel, QStringListModel, QThread +-from PyQt5.QtGui import QPalette, QTextCursor +-from PyQt5.QtWidgets import QCompleter, QHeaderView, QMessageBox, QProgressDialog ++from PyQt6.QtCore import Qt, QSortFilterProxyModel, QStringListModel, QThread ++from PyQt6.QtGui import QPalette, QTextCursor ++from PyQt6.QtWidgets import QCompleter, QHeaderView, QMessageBox, QProgressDialog + from setools import TERuleQuery, xperm_str_to_tuple_ranges + + from ..logtosignal import LogHandlerToSignal +diff --git a/setoolsgui/apol/typeattrquery.py b/setoolsgui/apol/typeattrquery.py +index 67a087a7e3f0..f76de94e93d7 100644 +--- a/setoolsgui/apol/typeattrquery.py ++++ b/setoolsgui/apol/typeattrquery.py +@@ -7,9 +7,9 @@ + import logging + from contextlib import suppress + +-from PyQt5.QtCore import Qt, QSortFilterProxyModel, QStringListModel, QThread +-from PyQt5.QtGui import QPalette, QTextCursor +-from PyQt5.QtWidgets import QCompleter, QHeaderView, QMessageBox, QProgressDialog ++from PyQt6.QtCore import Qt, QSortFilterProxyModel, QStringListModel, QThread ++from PyQt6.QtGui import QPalette, QTextCursor ++from PyQt6.QtWidgets import QCompleter, QHeaderView, QMessageBox, QProgressDialog + from setools import TypeAttributeQuery + + from ..logtosignal import LogHandlerToSignal +diff --git a/setoolsgui/apol/typequery.py b/setoolsgui/apol/typequery.py +index a22e3547cd16..4859364576e4 100644 +--- a/setoolsgui/apol/typequery.py ++++ b/setoolsgui/apol/typequery.py +@@ -7,9 +7,9 @@ + import logging + from contextlib import suppress + +-from PyQt5.QtCore import Qt, QSortFilterProxyModel, QStringListModel, QThread +-from PyQt5.QtGui import QPalette, QTextCursor +-from PyQt5.QtWidgets import QCompleter, QHeaderView, QMessageBox, QProgressDialog ++from PyQt6.QtCore import Qt, QSortFilterProxyModel, QStringListModel, QThread ++from PyQt6.QtGui import QPalette, QTextCursor ++from PyQt6.QtWidgets import QCompleter, QHeaderView, QMessageBox, QProgressDialog + from setools import TypeQuery + + from ..logtosignal import LogHandlerToSignal +diff --git a/setoolsgui/apol/userquery.py b/setoolsgui/apol/userquery.py +index 19ffb03c2975..6200ddcb8398 100644 +--- a/setoolsgui/apol/userquery.py ++++ b/setoolsgui/apol/userquery.py +@@ -7,9 +7,9 @@ + import logging + from contextlib import suppress + +-from PyQt5.QtCore import Qt, QSortFilterProxyModel, QStringListModel, QThread +-from PyQt5.QtGui import QPalette, QTextCursor +-from PyQt5.QtWidgets import QCompleter, QHeaderView, QMessageBox, QProgressDialog ++from PyQt6.QtCore import Qt, QSortFilterProxyModel, QStringListModel, QThread ++from PyQt6.QtGui import QPalette, QTextCursor ++from PyQt6.QtWidgets import QCompleter, QHeaderView, QMessageBox, QProgressDialog + from setools import UserQuery + + from ..logtosignal import LogHandlerToSignal +diff --git a/setoolsgui/apol/workspace.py b/setoolsgui/apol/workspace.py +index 2b4229224b85..8db9d1478d4d 100644 +--- a/setoolsgui/apol/workspace.py ++++ b/setoolsgui/apol/workspace.py +@@ -9,7 +9,7 @@ import logging + import setools + + +-from PyQt5.QtCore import Qt, QItemSelectionModel ++from PyQt6.QtCore import Qt, QItemSelectionModel + + + def save_checkboxes(tab, settings, checkboxes): +diff --git a/setoolsgui/boolmodel.py b/setoolsgui/boolmodel.py +index c331fdd5057d..a1a733987258 100644 +--- a/setoolsgui/boolmodel.py ++++ b/setoolsgui/boolmodel.py +@@ -3,8 +3,8 @@ + # SPDX-License-Identifier: LGPL-2.1-only + # + # +-from PyQt5.QtCore import Qt +-from PyQt5.QtGui import QPalette, QTextCursor ++from PyQt6.QtCore import Qt ++from PyQt6.QtGui import QPalette, QTextCursor + + from .details import DetailsPopup + from .models import SEToolsTableModel +diff --git a/setoolsgui/boundsmodel.py b/setoolsgui/boundsmodel.py +index c7ed1e7c227f..fdc1462b0a9b 100644 +--- a/setoolsgui/boundsmodel.py ++++ b/setoolsgui/boundsmodel.py +@@ -3,7 +3,7 @@ + # SPDX-License-Identifier: LGPL-2.1-only + # + # +-from PyQt5.QtCore import Qt ++from PyQt6.QtCore import Qt + + from .models import SEToolsTableModel + +diff --git a/setoolsgui/commonmodel.py b/setoolsgui/commonmodel.py +index 2ceb57f4f0a3..a5c656deac15 100644 +--- a/setoolsgui/commonmodel.py ++++ b/setoolsgui/commonmodel.py +@@ -3,8 +3,8 @@ + # SPDX-License-Identifier: LGPL-2.1-only + # + # +-from PyQt5.QtCore import Qt +-from PyQt5.QtGui import QPalette, QTextCursor ++from PyQt6.QtCore import Qt ++from PyQt6.QtGui import QPalette, QTextCursor + + from setools.exception import NoCommon + +diff --git a/setoolsgui/constraintmodel.py b/setoolsgui/constraintmodel.py +index d295f28f208b..2ae8dc5ba025 100644 +--- a/setoolsgui/constraintmodel.py ++++ b/setoolsgui/constraintmodel.py +@@ -3,7 +3,7 @@ + # SPDX-License-Identifier: LGPL-2.1-only + # + # +-from PyQt5.QtCore import Qt ++from PyQt6.QtCore import Qt + from setools.exception import ConstraintUseError + + from .models import SEToolsTableModel +diff --git a/setoolsgui/defaultmodel.py b/setoolsgui/defaultmodel.py +index 3a699c49ce8c..fe29b3f3179b 100644 +--- a/setoolsgui/defaultmodel.py ++++ b/setoolsgui/defaultmodel.py +@@ -5,7 +5,7 @@ + # + from contextlib import suppress + +-from PyQt5.QtCore import Qt ++from PyQt6.QtCore import Qt + + from .models import SEToolsTableModel + +diff --git a/setoolsgui/details.py b/setoolsgui/details.py +index 8d4882cd6a1e..1cbf6c05590c 100644 +--- a/setoolsgui/details.py ++++ b/setoolsgui/details.py +@@ -5,8 +5,8 @@ + # + import logging + +-from PyQt5.QtGui import QFont, QTextCursor +-from PyQt5.QtWidgets import QDialog ++from PyQt6.QtGui import QFont, QTextCursor ++from PyQt6.QtWidgets import QDialog + + from .widget import SEToolsWidget + +diff --git a/setoolsgui/fsusemodel.py b/setoolsgui/fsusemodel.py +index bc100784c490..327a8653d1b2 100644 +--- a/setoolsgui/fsusemodel.py ++++ b/setoolsgui/fsusemodel.py +@@ -3,7 +3,7 @@ + # SPDX-License-Identifier: LGPL-2.1-only + # + # +-from PyQt5.QtCore import Qt ++from PyQt6.QtCore import Qt + + from .models import SEToolsTableModel + +diff --git a/setoolsgui/genfsconmodel.py b/setoolsgui/genfsconmodel.py +index 1e50d929446a..b3429c81d536 100644 +--- a/setoolsgui/genfsconmodel.py ++++ b/setoolsgui/genfsconmodel.py +@@ -5,7 +5,7 @@ + # + import stat + +-from PyQt5.QtCore import Qt ++from PyQt6.QtCore import Qt + + from .models import SEToolsTableModel + +diff --git a/setoolsgui/getdetailslist.py b/setoolsgui/getdetailslist.py +index df7149dda0f2..e4e39194456c 100644 +--- a/setoolsgui/getdetailslist.py ++++ b/setoolsgui/getdetailslist.py +@@ -3,8 +3,8 @@ + # SPDX-License-Identifier: LGPL-2.1-only + # + # +-from PyQt5.QtGui import QCursor +-from PyQt5.QtWidgets import QAction, QListView, QMenu ++from PyQt6.QtGui import QCursor, QAction ++from PyQt6.QtWidgets import QListView, QMenu + + + class GetDetailsListView(QListView): +diff --git a/setoolsgui/ibendportconmodel.py b/setoolsgui/ibendportconmodel.py +index 37b7a8d74948..49780736b90f 100644 +--- a/setoolsgui/ibendportconmodel.py ++++ b/setoolsgui/ibendportconmodel.py +@@ -3,7 +3,7 @@ + # SPDX-License-Identifier: LGPL-2.1-only + # + # +-from PyQt5.QtCore import Qt ++from PyQt6.QtCore import Qt + + from .models import SEToolsTableModel + +diff --git a/setoolsgui/ibpkeyconmodel.py b/setoolsgui/ibpkeyconmodel.py +index 160425504521..1a339b90110b 100644 +--- a/setoolsgui/ibpkeyconmodel.py ++++ b/setoolsgui/ibpkeyconmodel.py +@@ -3,7 +3,7 @@ + # SPDX-License-Identifier: LGPL-2.1-only + # + # +-from PyQt5.QtCore import Qt ++from PyQt6.QtCore import Qt + + from .models import SEToolsTableModel + +diff --git a/setoolsgui/initsidmodel.py b/setoolsgui/initsidmodel.py +index 9ffb408024fd..04e8a34f931e 100644 +--- a/setoolsgui/initsidmodel.py ++++ b/setoolsgui/initsidmodel.py +@@ -3,7 +3,7 @@ + # SPDX-License-Identifier: LGPL-2.1-only + # + # +-from PyQt5.QtCore import Qt ++from PyQt6.QtCore import Qt + + from .models import SEToolsTableModel + +diff --git a/setoolsgui/listview.py b/setoolsgui/listview.py +index e803975c52c6..ff42bf0f8c57 100644 +--- a/setoolsgui/listview.py ++++ b/setoolsgui/listview.py +@@ -6,9 +6,9 @@ + import logging + from collections import defaultdict + +-from PyQt5.QtCore import Qt, QItemSelectionModel +-from PyQt5.QtGui import QKeySequence +-from PyQt5.QtWidgets import QAbstractItemView, QListView ++from PyQt6.QtCore import Qt, QItemSelectionModel ++from PyQt6.QtGui import QKeySequence ++from PyQt6.QtWidgets import QAbstractItemView, QListView + + + class SEToolsListView(QListView): +diff --git a/setoolsgui/logtosignal.py b/setoolsgui/logtosignal.py +index 7678f0992ce6..5bfab937ecc6 100644 +--- a/setoolsgui/logtosignal.py ++++ b/setoolsgui/logtosignal.py +@@ -5,7 +5,7 @@ + # + + from logging import Formatter, Handler, INFO +-from PyQt5.QtCore import pyqtSignal, QObject ++from PyQt6.QtCore import pyqtSignal, QObject + + + class LogHandlerToSignal(Handler, QObject): +diff --git a/setoolsgui/mlsmodel.py b/setoolsgui/mlsmodel.py +index 147378ef585a..a0bfb3709d57 100644 +--- a/setoolsgui/mlsmodel.py ++++ b/setoolsgui/mlsmodel.py +@@ -3,8 +3,8 @@ + # SPDX-License-Identifier: LGPL-2.1-only + # + # +-from PyQt5.QtCore import Qt +-from PyQt5.QtGui import QPalette, QTextCursor ++from PyQt6.QtCore import Qt ++from PyQt6.QtGui import QPalette, QTextCursor + + from .details import DetailsPopup + from .models import SEToolsTableModel +diff --git a/setoolsgui/mlsrulemodel.py b/setoolsgui/mlsrulemodel.py +index 54ad4c216c72..349900ef36d2 100644 +--- a/setoolsgui/mlsrulemodel.py ++++ b/setoolsgui/mlsrulemodel.py +@@ -3,7 +3,7 @@ + # SPDX-License-Identifier: LGPL-2.1-only + # + # +-from PyQt5.QtCore import Qt ++from PyQt6.QtCore import Qt + + from .models import SEToolsTableModel + +diff --git a/setoolsgui/models.py b/setoolsgui/models.py +index dd864e932fbc..0a19c9b26f1e 100644 +--- a/setoolsgui/models.py ++++ b/setoolsgui/models.py +@@ -7,7 +7,7 @@ import logging + from contextlib import suppress + from typing import List + +-from PyQt5.QtCore import QAbstractListModel, QItemSelectionModel, QAbstractTableModel, \ ++from PyQt6.QtCore import QAbstractListModel, QItemSelectionModel, QAbstractTableModel, \ + QModelIndex, QStringListModel, Qt + from setools.exception import NoCommon + +diff --git a/setoolsgui/netifconmodel.py b/setoolsgui/netifconmodel.py +index 54659203e7e5..d9aa87bd0dea 100644 +--- a/setoolsgui/netifconmodel.py ++++ b/setoolsgui/netifconmodel.py +@@ -3,7 +3,7 @@ + # SPDX-License-Identifier: LGPL-2.1-only + # + # +-from PyQt5.QtCore import Qt ++from PyQt6.QtCore import Qt + + from .models import SEToolsTableModel + +diff --git a/setoolsgui/nodeconmodel.py b/setoolsgui/nodeconmodel.py +index f8055fca194d..9bbb426a71aa 100644 +--- a/setoolsgui/nodeconmodel.py ++++ b/setoolsgui/nodeconmodel.py +@@ -3,7 +3,7 @@ + # SPDX-License-Identifier: LGPL-2.1-only + # + # +-from PyQt5.QtCore import Qt ++from PyQt6.QtCore import Qt + + from .models import SEToolsTableModel + +diff --git a/setoolsgui/objclassmodel.py b/setoolsgui/objclassmodel.py +index ff1641f8cc3e..d67d45c12fd4 100644 +--- a/setoolsgui/objclassmodel.py ++++ b/setoolsgui/objclassmodel.py +@@ -5,8 +5,8 @@ + # + from itertools import chain + +-from PyQt5.QtCore import Qt +-from PyQt5.QtGui import QPalette, QTextCursor ++from PyQt6.QtCore import Qt ++from PyQt6.QtGui import QPalette, QTextCursor + + from setools.exception import NoCommon + +diff --git a/setoolsgui/portconmodel.py b/setoolsgui/portconmodel.py +index 1c3de4494af9..5eb3b9327d19 100644 +--- a/setoolsgui/portconmodel.py ++++ b/setoolsgui/portconmodel.py +@@ -3,7 +3,7 @@ + # SPDX-License-Identifier: LGPL-2.1-only + # + # +-from PyQt5.QtCore import Qt ++from PyQt6.QtCore import Qt + + from .models import SEToolsTableModel + +diff --git a/setoolsgui/rbacrulemodel.py b/setoolsgui/rbacrulemodel.py +index 84d2ff09e4fc..c97cf36b0a3a 100644 +--- a/setoolsgui/rbacrulemodel.py ++++ b/setoolsgui/rbacrulemodel.py +@@ -3,7 +3,7 @@ + # SPDX-License-Identifier: LGPL-2.1-only + # + # +-from PyQt5.QtCore import Qt ++from PyQt6.QtCore import Qt + from setools.exception import RuleUseError + + from .models import SEToolsTableModel +diff --git a/setoolsgui/rolemodel.py b/setoolsgui/rolemodel.py +index 2dd7fe64d37e..dc4852225bdb 100644 +--- a/setoolsgui/rolemodel.py ++++ b/setoolsgui/rolemodel.py +@@ -3,8 +3,8 @@ + # SPDX-License-Identifier: LGPL-2.1-only + # + # +-from PyQt5.QtCore import Qt +-from PyQt5.QtGui import QPalette, QTextCursor ++from PyQt6.QtCore import Qt ++from PyQt6.QtGui import QPalette, QTextCursor + + from setools.exception import MLSDisabled + +diff --git a/setoolsgui/tableview.py b/setoolsgui/tableview.py +index 9ba49aa50fa3..71174008f85d 100644 +--- a/setoolsgui/tableview.py ++++ b/setoolsgui/tableview.py +@@ -5,9 +5,9 @@ + # + import csv + +-from PyQt5.QtCore import Qt +-from PyQt5.QtGui import QKeySequence, QCursor +-from PyQt5.QtWidgets import QAction, QApplication, QFileDialog, QMenu, QTableView ++from PyQt6.QtCore import Qt ++from PyQt6.QtGui import QAction, QKeySequence, QCursor ++from PyQt6.QtWidgets import QApplication, QFileDialog, QMenu, QTableView + + + class SEToolsTableView(QTableView): +diff --git a/setoolsgui/terulemodel.py b/setoolsgui/terulemodel.py +index 53b61a06d152..ac1b32d76ec4 100644 +--- a/setoolsgui/terulemodel.py ++++ b/setoolsgui/terulemodel.py +@@ -3,7 +3,7 @@ + # SPDX-License-Identifier: LGPL-2.1-only + # + # +-from PyQt5.QtCore import Qt ++from PyQt6.QtCore import Qt + from setools.exception import RuleNotConditional, RuleUseError + + from .models import SEToolsTableModel +diff --git a/setoolsgui/treeview.py b/setoolsgui/treeview.py +index a8f6fb4caef5..bf6d63d2b92b 100644 +--- a/setoolsgui/treeview.py ++++ b/setoolsgui/treeview.py +@@ -3,9 +3,9 @@ + # SPDX-License-Identifier: LGPL-2.1-only + # + # +-from PyQt5.QtCore import Qt, QModelIndex +-from PyQt5.QtGui import QKeySequence, QCursor +-from PyQt5.QtWidgets import QAction, QApplication, QFileDialog, QMenu, QTreeWidget, \ ++from PyQt6.QtCore import Qt, QModelIndex ++from PyQt6.QtGui import QAction, QKeySequence, QCursor ++from PyQt6.QtWidgets import QApplication, QFileDialog, QMenu, QTreeWidget, \ + QTreeWidgetItemIterator + + +diff --git a/setoolsgui/typeattrmodel.py b/setoolsgui/typeattrmodel.py +index 0b7c7ffe65a5..ede73228e16a 100644 +--- a/setoolsgui/typeattrmodel.py ++++ b/setoolsgui/typeattrmodel.py +@@ -3,8 +3,8 @@ + # SPDX-License-Identifier: LGPL-2.1-only + # + # +-from PyQt5.QtCore import Qt +-from PyQt5.QtGui import QPalette, QTextCursor ++from PyQt6.QtCore import Qt ++from PyQt6.QtGui import QPalette, QTextCursor + + from setools.exception import MLSDisabled + +diff --git a/setoolsgui/typemodel.py b/setoolsgui/typemodel.py +index 037996b96a8c..f25737169762 100644 +--- a/setoolsgui/typemodel.py ++++ b/setoolsgui/typemodel.py +@@ -3,8 +3,8 @@ + # SPDX-License-Identifier: LGPL-2.1-only + # + # +-from PyQt5.QtCore import Qt +-from PyQt5.QtGui import QPalette, QTextCursor ++from PyQt6.QtCore import Qt ++from PyQt6.QtGui import QPalette, QTextCursor + + from setools.exception import MLSDisabled + +diff --git a/setoolsgui/usermodel.py b/setoolsgui/usermodel.py +index d5aca7bc11a0..4edb393a9d0e 100644 +--- a/setoolsgui/usermodel.py ++++ b/setoolsgui/usermodel.py +@@ -3,7 +3,7 @@ + # SPDX-License-Identifier: LGPL-2.1-only + # + # +-from PyQt5.QtCore import Qt, QModelIndex ++from PyQt6.QtCore import Qt, QModelIndex + from setools.exception import MLSDisabled + + from .details import DetailsPopup +diff --git a/setoolsgui/widget.py b/setoolsgui/widget.py +index e236623cef96..b2866139564c 100644 +--- a/setoolsgui/widget.py ++++ b/setoolsgui/widget.py +@@ -7,7 +7,7 @@ import sys + from errno import ENOENT + + import pkg_resources +-from PyQt5.uic import loadUi ++from PyQt6.uic import loadUi + + + # Stylesheet that adds a frame around QGroupBoxes +-- +2.41.0 + diff --git a/setools.spec b/setools.spec index 420188c..86a6ee5 100644 --- a/setools.spec +++ b/setools.spec @@ -3,7 +3,7 @@ Name: setools Version: 4.4.3 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Policy analysis tools for SELinux License: GPL-2.0-only and LGPL-2.1-only @@ -11,12 +11,13 @@ URL: https://github.com/SELinuxProject/setools/wiki Source0: https://github.com/SELinuxProject/setools/archive/%{version}.tar.gz Source1: setools.pam Source2: apol.desktop +Patch1: 0001-Use-the-The-New-Python-Enums.patch +Patch2: 0002-Use-PyQt6.patch Obsoletes: setools < 4.0.0, setools-devel < 4.0.0 BuildRequires: flex, bison BuildRequires: glibc-devel, gcc, git-core BuildRequires: libsepol-devel >= %{sepol_ver}, libsepol-static >= %{sepol_ver} -BuildRequires: qt5-qtbase-devel BuildRequires: swig BuildRequires: python3-Cython BuildRequires: python3-devel @@ -81,7 +82,7 @@ Python 3 modules designed to facilitate SELinux policy analysis. Summary: Policy analysis graphical tools for SELinux License: GPL-2.0-only Requires: python3-setools = %{version}-%{release} -Requires: python3-qt5 +Requires: python3-pyqt6 python3-pyqt6-sip Requires: python3-networkx %description gui @@ -144,6 +145,9 @@ Python modules designed to facilitate SELinux policy analysis. %{_mandir}/ru/man1/apol* %changelog +* Mon Aug 28 2023 Petr Lautrbach - 4.4.3-2 +- Use Qt 6 + * Wed Aug 9 2023 Petr Lautrbach - 4.4.3-1 - SETools 4.4.3 release