View Single Post
flotron's Avatar
Posts: 418 | Thanked: 506 times | Joined on Jan 2012 @ Argentina
#5
i'm stuck with this errors:

main.cpp: In function 'int main(int, char**)':
main.cpp:16: error: 'view' was not declared in this scope


This is my main.cpp

Code:
#include <QtGui/QApplication>
#include "qmlapplicationviewer.h"
#include "scriptlauncher.h"
#include "qdeclarativecontext.h"

Q_DECL_EXPORT int main(int argc, char *argv[])
{
    QScopedPointer<QApplication> app(createApplication(argc, argv));

    QmlApplicationViewer viewer;
    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
    viewer.setMainQmlFile(QLatin1String("qml/untitled/main.qml"));
    viewer.showExpanded();

    ScriptLauncher launcher;
    QDeclarativeContext *context = view->rootContext();
    context->setContextProperty("scriptLauncher", &launcher);

    return app->exec();
}

Last edited by flotron; 2012-10-26 at 00:25.