[SailfishDevel] Why this error now?

Chris Walker cdw_nokiaqt at the-walker-household.co.uk
Tue Jul 8 12:13:01 UTC 2014


I'm trying to deploy my app to my phone and on the emulator it works -
in debug mode. But as soon as I switch to release mode, it keels over.

Here's the cpp code where it fails :-

#ifdef QT_QML_DEBUG
#include <QtQuick>
#endif

#include <QGuiApplication>
#include <QQuickView>

#include <sailfishapp.h>
#include "DatabaseManager.h"

Q_DECL_EXPORT int main(int argc, char *argv[])
{
    QScopedPointer<QGuiApplication> app(SailfishApp::application(argc,
argv)); QScopedPointer<QQuickView> view(SailfishApp::createView());

    DatabaseManager* db = new DatabaseManager();
    db->open();

    view->rootContext()->setContextProperty("db", db);

    view->setSource(SailfishApp::pathTo("qml/beertent.qml"));

    view->show();

    return app->exec();
}

The error is invalid use of incomplete type 'struct QQmlContext'

I can easily fix it by adding #include <QQmlContext> and it all then
works as expected but my query is this. Why does it work in debug mode
with no errors but fails in release mode?


More information about the Devel mailing list