unsupported Qt Quick version - main.qml not found


  • Qt Champions 2016

    just started to evaluate Qt 5.6 Beta
    created a new project
    then to test Qt.labs.controls copied from https://doc-snapshots.qt.io/qt5-5.6/qtlabscontrols-gettingstarted.html
    main.cpp:

    #include <QGuiApplication>
    #include <QQmlApplicationEngine>
    
    int main(int argc, char *argv[])
    {
        QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
        QGuiApplication app(argc, argv);
        QQmlApplicationEngine engine("main.qml");
        return app.exec();
    }
    

    main.qml:

    
    
    import QtQuick 2.6
    import Qt.labs.controls 1.0
    
    ApplicationWindow {
        title: "My Application"
        width: 640
        height: 480
        visible: true
    
        Button {
            text: "Push Me"
            anchors.centerIn: parent
        }
    }
    

    tried to open in Designer got 'unsupported Qt Quick version'

    tried to run on Android device:
    getting only a black screen and errors:

    W/libtest_q2_controls.so(15994): (null):0 ((null)): QQmlApplicationEngine failed to load component
    W/libtest_q2_controls.so(15994): (null):0 ((null)): file:///data/data/org.qtproject.example.test_q2_controls/files/main.qml:-1 File not found
    

    Am I missing anything ?
    Or are there any examples / wizards for Qt 5.6 samples using qt.labs.controls and High DPI for android ?

    thx for helping

    ekke
    ...new at Qt 5.6
    ...experienced at BlackBerry Cascades - now trying to find a way to support x-platform w Qt 5.6+


  • administrators

    Hmm,

    This might be a question for the Interest mailing list
    http://lists.qt-project.org/mailman/listinfo/interest
    Or even development http://lists.qt-project.org/mailman/listinfo/development
    as the labs controls are just coming in 5.6.
    The developers are more likely to see the question there. (assuming you need the actual developer)



  • Hi, where is the main.qml file located? The minimal example snippet loads it from the file system, but if main.qml is in the resources, you would do something like:

    QQmlApplicationEngine engine;
    engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
    

    Thanks for bringing this up. I'll update the example snippet in the documentation to match the default Qt Quick application template in Qt Creator.


  • Qt Champions 2016

    great !
    now it works and I can go on with evaluating.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.