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";
}
}