Skip to content

Commit

Permalink
plugins: owl_importer: use scoped access to QtCore.Qt module
Browse files Browse the repository at this point in the history
  • Loading branch information
mnamici committed Jul 20, 2022
1 parent 15b7af0 commit 18a1754
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions eddy/plugins/ontology-importer/ontology_importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
QtGui,
QtWidgets
)
from PyQt5.QtCore import Qt

from core.functions.fsystem import fremove
from eddy.core.commands.common import CommandItemsRemove
Expand Down Expand Up @@ -1567,8 +1566,8 @@ def __init__(self, not_drawn, project):
check = QtWidgets.QTreeWidgetItem(classLabel, [str(ax)])
basefont = check.font(0).family()
check.setFont(0, QtGui.QFont(basefont, 8.7, QtGui.QFont.Normal))
check.setFlags(Qt.ItemFlag.ItemIsUserCheckable | Qt.ItemFlag.ItemIsEnabled)
check.setCheckState(0, Qt.CheckState.Unchecked)
check.setFlags(QtCore.Qt.ItemFlag.ItemIsUserCheckable | QtCore.Qt.ItemFlag.ItemIsEnabled)
check.setCheckState(0, QtCore.Qt.CheckState.Unchecked)

self.checkBoxes.append(check)

Expand All @@ -1580,8 +1579,8 @@ def __init__(self, not_drawn, project):
check = QtWidgets.QTreeWidgetItem(objPropLabel, [str(ax)])
basefont = check.font(0).family()
check.setFont(0, QtGui.QFont(basefont, 8.7, QtGui.QFont.Normal))
check.setFlags(Qt.ItemFlag.ItemIsUserCheckable | Qt.ItemFlag.ItemIsEnabled)
check.setCheckState(0, Qt.CheckState.Unchecked)
check.setFlags(QtCore.Qt.ItemFlag.ItemIsUserCheckable | QtCore.Qt.ItemFlag.ItemIsEnabled)
check.setCheckState(0, QtCore.Qt.CheckState.Unchecked)

self.checkBoxes.append(check)

Expand All @@ -1593,8 +1592,8 @@ def __init__(self, not_drawn, project):
check = QtWidgets.QTreeWidgetItem(dataPropLabel, [str(ax)])
basefont = check.font(0).family()
check.setFont(0, QtGui.QFont(basefont, 8.7, QtGui.QFont.Normal))
check.setFlags(Qt.ItemFlag.ItemIsUserCheckable | Qt.ItemFlag.ItemIsEnabled)
check.setCheckState(0, Qt.CheckState.Unchecked)
check.setFlags(QtCore.Qt.ItemFlag.ItemIsUserCheckable | QtCore.Qt.ItemFlag.ItemIsEnabled)
check.setCheckState(0, QtCore.Qt.CheckState.Unchecked)

self.checkBoxes.append(check)

Expand All @@ -1606,8 +1605,8 @@ def __init__(self, not_drawn, project):
check = QtWidgets.QTreeWidgetItem(indivLabel, [str(ax)])
basefont = check.font(0).family()
check.setFont(0, QtGui.QFont(basefont, 8.7, QtGui.QFont.Normal))
check.setFlags(Qt.ItemFlag.ItemIsUserCheckable | Qt.ItemFlag.ItemIsEnabled)
check.setCheckState(0, Qt.CheckState.Unchecked)
check.setFlags(QtCore.Qt.ItemFlag.ItemIsUserCheckable | QtCore.Qt.ItemFlag.ItemIsEnabled)
check.setCheckState(0, QtCore.Qt.CheckState.Unchecked)

self.checkBoxes.append(check)

Expand All @@ -1620,12 +1619,12 @@ def __init__(self, not_drawn, project):
check = QtWidgets.QTreeWidgetItem(othersLabel, [str(ax)])
basefont = check.font(0).family()
check.setFont(0, QtGui.QFont(basefont, 8.7, QtGui.QFont.Normal))
check.setFlags(Qt.ItemFlag.ItemIsUserCheckable | Qt.ItemFlag.ItemIsEnabled)
check.setCheckState(0, Qt.CheckState.Unchecked)
check.setFlags(QtCore.Qt.ItemFlag.ItemIsUserCheckable | QtCore.Qt.ItemFlag.ItemIsEnabled)
check.setCheckState(0, QtCore.Qt.CheckState.Unchecked)

self.checkBoxes.append(check)

self.table.sortItems(0, Qt.AscendingOrder)
self.table.sortItems(0, QtCore.Qt.AscendingOrder)

self.table.setHeaderHidden(True)
self.table.header().setStretchLastSection(False)
Expand Down Expand Up @@ -1711,9 +1710,9 @@ def checkOnClick(self, index):

if axiom not in self.labels:
if state == QtCore.Qt.Checked:
item.setCheckState(0, Qt.CheckState.Unchecked)
item.setCheckState(0, QtCore.Qt.CheckState.Unchecked)
else:
item.setCheckState(0, Qt.CheckState.Checked)
item.setCheckState(0, QtCore.Qt.CheckState.Checked)

def checkAxiom(self, item, column):

Expand Down

0 comments on commit 18a1754

Please sign in to comment.