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. QML different style using QGuiApplication and QCoreApplication

QML different style using QGuiApplication and QCoreApplication

Scheduled Pinned Locked Moved Solved QML and Qt Quick
2 Posts 2 Posters 622 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.
  • B Offline
    B Offline
    bronstein87
    wrote on last edited by
    #1

    When i using QML in QCoreApplication all widgets have poor style:
    Slider in QGuiApplication:
    alt text

    In QCoreApplication:
    alt text

    Button in QGuiApp:

    alt text

    Button in QCoreApp:

    alt text

    Is there a way to resolve this problem?

    1 Reply Last reply
    0
    • jpnurmiJ Offline
      jpnurmiJ Offline
      jpnurmi
      wrote on last edited by jpnurmi
      #2

      With QApplication from QtWidgets you get a QStyle-based "Desktop" style. With QGuiApplication from QtGui, it is not possible to use QtWidgets so you get a QML-based "Base" style instead. You can specify QT_QUICK_CONTROLS_STYLE environment variable if you want to choose a specific style. Make sure to do it before loading any QML.

      QT_QUICK_CONTROLS_STYLE=Base ./app
      

      or in code:

      int main(...)
      {
          qputenv("QT_QUICK_CONTROLS_STYLE", "Base");
          ...
      }
      
      1 Reply Last reply
      3

      • Login

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