3from .
import filtermanagerdialog
4from .components
import (filtercombobox, filtermanagertreemodel)
7 from PyQt6.QtWidgets import (QFormLayout, QAbstractItemView, QDialogButtonBox,
8 QVBoxLayout, QFrame, QTreeView)
11 from PyQt5.QtWidgets import (QFormLayout, QAbstractItemView, QDialogButtonBox,
12 QVBoxLayout, QFrame, QTreeView)
13from krita
import Krita
14from builtins
import i18n, i18nc
24 QDialogButtonBox.StandardButton.Ok | QDialogButtonBox.StandardButton.Cancel)
29 self.
treeModel = filtermanagertreemodel.FilterManagerTreeModel(self)
38 QAbstractItemView.SelectionMode.SingleSelection)
39 self.
mainDialog.setWindowModality(Qt.WindowModality.NonModal)
51 self.
line.setFrameShape(QFrame.Shape.HLine)
52 self.
line.setFrameShadow(QFrame.Shadow.Sunken)
60 self.
mainDialog.setWindowTitle(i18n(
"Filter Manager"))
69 for index
in selectionModel.selectedRows():
70 node = self.
treeModel.data(index, Qt.ItemDataRole.UserRole + 1)
71 documentIndex = self.
treeModel.data(index, Qt.ItemDataRole.UserRole + 2)
72 _type = self.
treeModel.data(index, Qt.ItemDataRole.UserRole + 3)
74 if _type ==
'Document':
79 documentsIndexes.append(documentIndex)
86 document.refreshProjection()
90 _filter.apply(node, 0, 0, document.width(), document.height())
93 """This method applies the selected filter just to topLevelNodes,
94 then if topLevelNodes are GroupLayers, that filter will not be
97 for node
in document.topLevelNodes():
static Krita * instance()
instance retrieve the singleton instance of the Application object.
applyFilterOverNode(self, node, document)
refreshDocumentsProjections(self, indexes)
applyFilterOverDocument(self, document)