Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo 2 Support (Qt 5) › Felgo Splash Screen Pops Up Twice

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #10990

    Cal

    I have a simple v-play app running with the following code under Debian 8/64 Felgo 2.61. The app works but i see the splash screen popping up twice. running the same code built with a qtquick does not show this. can someone show me what is wrong

    V-play cpp

    int main(int argc, char *argv[])
    {
        QApplication app(argc, argv);
        VPApplication vplay;
    
        // Use platform-specific fonts instead of Felgo's default font
        vplay.setPreservePlatformFonts(true);
    
        // QQmlApplicationEngine is the preferred way to start qml projects since Qt 5.2
        // if you have older projects using Qt App wizards from previous QtCreator versions than 3.1, please change them to QQmlApplicationEngine
        QQmlApplicationEngine engine;
        vplay.initialize(&engine);
    
        // use this during development
        // for PUBLISHING, use the entry point below
        vplay.setMainQmlFileName(QStringLiteral("qml/Main.qml"));
    
        // use this instead of the above call to avoid deployment of the qml files and compile them into the binary with qt's resource system qrc
        // this is the preferred deployment option for publishing games to the app stores, because then your qml files and js files are protected
        // to avoid deployment of your qml files and images, also comment the DEPLOYMENTFOLDERS command in the .pro file
        // also see the .pro file for more details
        //play.setMainQmlFileName(QStringLiteral("qrc:/qml/Main.qml"));
        // main.cpp
    
        engine.load(QUrl(vplay.mainQmlFileName()));
    
        QQmlComponent component(&engine, "qml/Main.qml");
        QObject *object = component.create();
        QVariant returnedValue;
        QVariant msg = "Hello from C++";
        QMetaObject::invokeMethod(object, "myQmlFunction",
                Q_RETURN_ARG(QVariant, returnedValue),
                Q_ARG(QVariant, msg));
    
        qDebug() << "QML function returned:" << returnedValue.toString();
        delete object;
    
        return app.exec();
    }
    
    vplay qml main.qml
    
    import Felgo 3.0
    import QtQuick 2.5
    
    App     {
        width: 640
        height: 480
    
        function myQmlFunction(msg) {
            console.log("Got message:", msg);
            return "some return value fromm qml";
        }
    }

     

     

     

    #11241

    Günther
    Felgo Team

    Hi Cal!

    I tried the code you provided and didn’t run into your problem. (at least on MacOS – I have yet to test it on Linux)
    Does the SplashScreen problem also occur when you try the Empty Felgo Apps Project from the Project Wizard – or does it only happen with your code?

    Best,
    Günther

    #11245

    Cal

    I tried your suggestion and i did not see a second splash screen.

    i just can’t see why a see 2 here. would you like the complete src???

    #11246

    Günther
    Felgo Team
    #13947

    Sarevok

    Hi,
    I have the same problem but no solution so far:

        ...
    
        engine.load(QUrl(vplay.mainQmlFileName()));
    
        QQmlComponent component(&engine, "qml/StackTheBoxMain.qml");
        QObject *object = component.create();
        //do something with object
        delete object;
    
        return app.exec();
    }

    This is from the main.cpp of the ‘StackTheBox’ example. A second screen appears if I add the 3 lines in the middle of the code.

    #14067

    Günther
    Felgo Team

    Hi Sarevok!

    The StackTheboxMain.qml item is a GameWindow, which is derived from the QML ApplicationWindow type.
    Creating a new instance then means creating a new window. You would see the same behavior with a standard Qt Quick Application when creating a new window instance of the qml window in the main.cpp.

    Best,
    Günther

     

Viewing 6 posts - 1 through 6 (of 6 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded