Hi,
the messages are available with the msg property of the function. Please also make sure to set the custom handler after Felgo is initialized. Otherwise it is overwritten again:
#include <QApplication>
#include <VPApplication>
#include <QQmlApplicationEngine>
#include <QDebug>
void myMessageHandler(QtMsgType type, const QMessageLogContext &, const QString & msg)
{
qDebug() << "MY MESSAGE HANDLER: " << msg;
}
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
// vplay.setMainQmlFileName(QStringLiteral("qrc:/qml/Main.qml"));
engine.load(QUrl(vplay.mainQmlFileName()));
// set custom message handler
// note: requires to be called after vplay.initialize(&engine)
// the Felgo initialization overwrites the handler otherwise
qInstallMessageHandler(myMessageHandler);
return app.exec();
}
Best,
Günther