Add a Qt Designer plugin for Krita
Open, WishlistPublic

Description

Krita has quite a few .ui files with custom widgets. Since Qt Designer has no knowledge of these custom widgets they will look like their base class. Typically a blank QWidget.

It would be nice if those custom widgets could be exposed properly in Qt Designer, as that would allow tweaking and previewing of the .ui file without compiling and running Krita.

victorw created this task.Apr 8 2018, 10:24 AM
victorw triaged this task as Wishlist priority.
Restricted Application added a subscriber: woltherav. · View Herald TranscriptApr 8 2018, 10:24 AM

I wrote an initial implementation for two widgets as a test.

Without the plugin:

With the plugin:

The implementation doesn't install the resulting library, so you need to manually copy it somewhere and tell Qt Creator to look for it there on launch. For example:

mkdir -p ~/qt_plugins/designer
cp build/plugins/qt/designer/kritadesignerplugin.so ~/qt_plugins/designer/
QT_PLUGIN_PATH=~/qt_plugins qtcreator
woltherav moved this task from Backlog to Zeyelth on the Krita board.May 18 2018, 9:06 AM

I've added the necessary build scripts for building a designer plugin collection, including plugins for KisColorSpaceSelector and KisGradientSlider. You can toggle building of the plugin collection with

-DBUILD_KRITA_QT_DESIGNER_PLUGINS=ON

Expanding this to include more widgets is for the most part just a matter of copying and tweaking some boiler plate code (see e.g. KisColorSpaceSelectorPlugin.h/KisColorSpaceSelectorPlugin.cpp).

One problem that has to be solved before all widgets are given plugins is dependencies; building and using a plugin requires the widget to be functional, and if the widget itself pulls in lots of dependencies outside of Qt, this can be extremely bloated.