Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Designer with Quick Controls 2 Style
Forum Updated to NodeBB v4.3 + New Features

Designer with Quick Controls 2 Style

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 317 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    gpunkt
    wrote on last edited by gpunkt
    #1

    Hello,

    I have a custom Qt Quick Controls 2 style, where I have placed the style in a source folder such as "qml/MyStyle". When running the app, I am able to use this style with qtquickcontrols2.conf by adding the style path shown below and adding the style to my resources:

    QQuickStyle::addStylePath("qrc:/qml");
    

    However, when I open a UI file in the designer, it does not pick up the style. Does anyone know how to make the designer recognise the custom style?

    (It works fine when the style is placed in the root directory of the project, but not when put in a subdirectory.)

    Thanks.

    1 Reply Last reply
    0
    • T Offline
      T Offline
      Thomas Hartmann
      wrote on last edited by
      #2

      Defining QT_QUICK_CONTROLS_STYLE_PATH to the location where your style is found should do the trick.
      See: https://doc.qt.io/qt-5.11/qtquickcontrols2-environment.html

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved