[Interest] QtQuick Controls 2 and Designer: Should I use Styles or Customize?

Thomas Hartmann Thomas.Hartmann at qt.io
Fri Mar 16 15:02:04 CET 2018


I would suggest solution number 1 (Creating a Custom Style).

To get the designer to show your custom style you have to configure it in qtquickcontrols2.conf.

You can do this in the editable combo box in the form editor if qtquickcontrols2.conf does exist.

You can refer to the Qt  Quick Controls 2 Flat Style example (https://doc.qt.io/qt-5.10/qtquickcontrols2-flatstyle-example.html).

You can use QT_QUICK_CONTROLS_STYLE_PATH to specify additional paths that are used to lookup Qt Quick Controls 2 styles.

You can also write your own QML plugin (2. Customizing a Control), but you have to create a QML file for every control

and you have to implement a full plugin/import. For these customized controls to show up in the item library you have to provide a .metainfo file. You can look at the origin Qt Quick Controls 2 implementation for reference.

I hope this solves your issue.

Kind Regards,

Thomas Hartmann

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20180316/926f2621/attachment.html>

More information about the Interest mailing list