[Interest] I can't find QQuickStyle class

J-P Nurmi jpnurmi at qt.io
Tue Oct 4 08:15:25 CEST 2016


Hi Freddy,

Add "QT += quickcontrols2" to your application's .pro file.

http://doc.qt.io/qt-5/qtquickcontrols2-index.html

--
J-P Nurmi

On 4 Oct 2016, at 06:59, Freddy Martinez Garcia <freddy311082 at gmail.com<mailto:freddy311082 at gmail.com>> wrote:


Hi guys... as the doc say (http://doc.qt.io/qt-5/qtquickcontrols2-styles.html), I can do something like this:


#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QQuickStyle>

int main(int argc, char *argv[])
{
    QGuiApplication<http://doc.qt.io/qt-5/qguiapplication.html>::setAttribute(Qt<http://doc.qt.io/qt-5/qt.html>::AA_EnableHighDpiScaling);
    QGuiApplication<http://doc.qt.io/qt-5/qguiapplication.html> app(argc, argv);

    QQuickStyle<http://doc.qt.io/qt-5/qquickstyle.html>::setStyle("Material");

    QQmlApplicationEngine<http://doc.qt.io/qt-5/qqmlapplicationengine.html> engine;
    engine.load(QUrl<http://doc.qt.io/qt-5/qurl.html>("qrc:/main.qml"));

    return app.exec();
}

The problem for me is that the include for QQuickStyle faile... file not found... so I think that I'm missing something... What do I have to add to be available to run this example?

Regards

Freddy


_______________________________________________
Interest mailing list
Interest at qt-project.org<mailto:Interest at qt-project.org>
http://lists.qt-project.org/mailman/listinfo/interest
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20161004/a1c8b2e4/attachment.html>


More information about the Interest mailing list