0

I am currently trying to load a stylesheet for a simple Qt5 application. Therefore I use the following code:

QApplication app(argc, argv);

QFile styleFile("./css/style.qss");
styleFile.open(QFile::ReadOnly);
QString stylesheet = QLatin1String(styleFile.readAll());
app.setStyleSheet(stylesheet);

QQmlApplicationEngine engine;
engine.load("./qml/main.qml");

app.exec();

However, the stylesheet is loaded correctly, but not applied. How do I have to change the above code, to get it working?

BaCaRoZzo
  • 7,502
  • 6
  • 51
  • 82
Phidelux
  • 2,043
  • 1
  • 32
  • 50

1 Answers1

1

QML itself doesn't support stylesheets as QWidget does. But you still can customize your app in several ways. See here for more details.

As a workaround you can use some Third-party plugins, for example Ableton.stylesheets

folibis
  • 12,048
  • 6
  • 54
  • 97