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?