Custom controls based on material are not loaded
Solved
QML and Qt Quick
-
Hello,
I'm trying to build my own custom controls toolkit for my applications, based on Material design, but I cannot seem to be able to load it.
I have tried even replicating the example from here: https://doc.qt.io/archives/qt-5.11/qtquickcontrols2-fileselectors.html
The application still loads :/CustomButton.qml and not :/+material/CustomButton.qml.
As a side test :/+unix/CustomButton.qml is loaded (as I am using Linux).
I am loading the Material style from main.cpp, but tried using qtquickcontrols2.conf without succes either:#include <QGuiApplication> #include <QQmlApplicationEngine> #include <QQuickStyle> int main(int argc, char *argv[]) { QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QQuickStyle::setStyle("Material"); QGuiApplication app(argc, argv); QQmlApplicationEngine engine; const QUrl url(QStringLiteral("qrc:/main.qml"));#include <QGuiApplication> #include <QQmlApplicationEngine> #include <QQuickStyle> QObject::connect(&engine, &QQmlApplicationEngine::objectCreated, &app, [url](QObject *obj, const QUrl &objUrl) { if (!obj && url == objUrl) QCoreApplication::exit(-1); }, Qt::QueuedConnection); engine.load(url); return app.exec(); }
Any ideeas what am I doing wrong?
System: KDE Neon, based on Ubuntu 18.04, x64.
Qt version: 5.12.5.