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. QtQuick Controls: Material Style not found?
QtWS25 Last Chance

QtQuick Controls: Material Style not found?

Scheduled Pinned Locked Moved Solved QML and Qt Quick
materialqmlstyleqtquick control
3 Posts 2 Posters 2.1k Views
  • 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.
  • L Offline
    L Offline
    lopeztel
    wrote on 4 Jul 2020, 12:41 last edited by
    #1

    A while back I had a running installation of Qt 5.12.4 on Ubuntu 19.04. Had some problems and had to reinstall everything on Manjaro 20.0.3 except this time I upgraded to Qt 5.12.8 and Qt Creator 4.12.3

    According to what I've read:
    https://doc.qt.io/qt-5/qtquickcontrols-index.html
    https://doc.qt.io/qt-5/qtquickcontrols2-styles.html

    And previous versions of my application running on my desktop :

    MQTT_Dashboard

    Material style should be working, I haven't modified the code, here is a snippet of my main.qml:

    import QtQuick 2.12
    import QtQuick.Controls 2.12
    import QtQuick.VirtualKeyboard 2.4
    import MqttClient 1.0
    import QtQuick.Window 2.12
    import QtQuick.Layouts 1.12
    import QtCharts 2.3
    import QtQuick.Controls.Material 2.12
    

    Also here is my qtquickcontrols2.conf:

    [Controls]
    Style=Material
    
    [Material]
    Theme=Light
    Accent=Teal
    

    When I run the application on my desktop it looks like this now:

    Screenshot from 2020-07-04 14-37-12.png

    With the following on Application Output console :

    QApplication: invalid style override passed, ignoring it.
        Available styles: Windows, Fusion
    

    Funnily enough the theme is correct on Android but the screen is not scaled properly now (but that is another issue)
    Any ideas on where to look or what could've changed?

    1 Reply Last reply
    0
    • U Offline
      U Offline
      user0204
      wrote on 20 Jan 2022, 09:11 last edited by
      #2

      Any luck with this? I see that in QT /qml/QtQuick/Controls/Styles/ does not have Material. I custom compile QT, what am I missing?

      1 Reply Last reply
      0
      • L Offline
        L Offline
        lopeztel
        wrote on 25 Jan 2022, 13:40 last edited by
        #3

        Solved it by adding the line

        qputenv("QT_STYLE_OVERRIDE","Material");
        

        in main.cpp

        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