QtQuick Controls: Material Style not found?
-
wrote on 4 Jul 2020, 12:41 last edited by
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.htmlAnd previous versions of my application running on my desktop :
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:
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? -
wrote on 20 Jan 2022, 09:11 last edited by
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? -
wrote on 25 Jan 2022, 13:40 last edited by
Solved it by adding the line
qputenv("QT_STYLE_OVERRIDE","Material");
in
main.cpp