Implement Filter Applier plugin
ClosedPublic

Authored by eliakinalmeida on Jun 25 2017, 6:59 AM.

Details

Summary

Implement FilterComboBox

  • Added a new QComboBox subclass that represents the FilterComboBox
  • Property 'filters' was created in UIFilterManager
  • Filters loaded just one time
  • FilterComboBox loads items through the filters property

Implement Documents Tree Widget to FilterManager

  • QTreeWidget subclass 'DocumentTreeWidget' created
  • It was added a new 'documents' property to UIFilterManager
  • DocumentTreeWidget shows all documents(just first level for now)
  • DocumentTreeWidget shows FilePath, Type(Document) and thumbnail(30x30)

Added new QTreeWidgetItem subclass to components directory

Support to Python/SIP objects into QTreeWidgetItem data

Implement Model-View pattern to build tree structure and show documents data

  • I implemented a TreeItem class that represents each row in the tree
  • Read-only QAbstractItemModel subclass implemented
  • Adjusts in UIFilterManager

Implement First Level of the TreeModel

  • QTreeView shows fileName (Documents), type and thumbnail.
  • TreeItem stores the rootNode of each document.
  • We can access Row data(Node) through Qt.UserRole + 1 (I will implement enums yet).
  • MultiSelectionMode to QTreeView.
  • I renamed some object variables to don't conflict with properties of the Model-View implementation.

Implement recursive loading of the Documents Tree View

  • Invalid components removed (Items based)
  • Method to load the first level of the tree was implemented
  • Recursive method that loads all sub-level nodes from a root node was implemented
  • UIFilterManager's layout updated to adjust contents to QDialog size
  • Filter needs the document width and height to be applied
  • It needs refactoring!!

Improve performance of the filter applier, saving document index in each node

  • Using enumerate while iterating over document's list, I saved the document index, then it's propagated throughout tree(document's children)
  • Confirm button implementation with apply method
  • I need to fix a bug in the apply method from Filter class (libkis), for some reason, it's not updating the image in the canvas.

Fixes T5885

Ref T1625

Test Plan

I didn't implement a refresh button, so you need to open document(s) before the Filter Manager plugin. You can select any filter from the list and a set of nodes from any
document and apply it. I need to fix a bug in the apply method from libkis that is not updating canvas image.

Diff Detail

Repository
R37 Krita
Branch
eliakincosta/T5885-kritas-scripting-showcase
Lint
No Linters Available
Unit
No Unit Test Coverage
eliakinalmeida created this revision.Jun 25 2017, 6:59 AM
woltherav accepted this revision.Dec 7 2017, 3:19 PM
This revision is now accepted and ready to land.Dec 7 2017, 3:19 PM
woltherav closed this revision.Dec 7 2017, 3:19 PM

This was pushed :)