Example #1
0
File: main.cpp Project: khris/qv
int main(int argc, char *argv[])
{
    QApplication app(argc, argv);

    QmlApplicationViewer viewer;
    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);

#ifdef Q_OS_SYMBIAN
    viewer.setMainQmlFile(QLatin1String("qrc:/qml/qvapp/qv.qml"));
    viewer.setSource(QUrl(QLatin1String("qrc:/qml/qvapp/qv.qml")));
#else
    viewer.setMainQmlFile(QLatin1String("qml/qvapp/qv.qml"));
#endif

#ifdef Q_OS_SYMBIAN
    viewer.setResizeMode(QDeclarativeView::SizeRootObjectToView);
    viewer.showFullScreen();
#elif defined(Q_WS_MAEMO_5)
    viewer.setResizeMode(QDeclarativeView::SizeRootObjectToView);
    viewer.showMaximized();
#elif defined(Q_OS_ANDROID)
    viewer.setResizeMode(QDeclarativeView::SizeRootObjectToView);
    viewer.showFullScreen();
#else
    Qt::WindowFlags flags = Qt::MSWindowsFixedSizeDialogHint
            | Qt::CustomizeWindowHint
            | Qt::WindowCloseButtonHint
            | Qt::WindowMinimizeButtonHint;
    viewer.setWindowFlags(flags);
    viewer.setResizeMode(QDeclarativeView::SizeViewToRootObject);
    viewer.show();
#endif

    return app.exec();
}
Example #2
0
MuseBox::MuseBox(QWidget *parent) :
    QMainWindow(parent)
{
    //TODO add a splash screen here? would be totally fun!
    qmlRegisterType<TrackArrangementBackground>("TrackArrangement",1,0,"TrackArrangementBackground");
    qmlRegisterType<CursorRuler>("TrackArrangement",1,0,"CursorRuler");
    qmlRegisterType<PatternModel>("DataModel",1,0,"PatternModel");
    qmlRegisterType<NoteModel>("DataModel",1,0,"NoteModel");
    qmlRegisterType<PatternDisplay>("TrackArrangement",1,0,"PatternDisplay");
    qmlRegisterType<PatternNoteDisplay>("TrackArrangement",1,0,"PatternNoteDisplay");
    QmlApplicationViewer *view = new QmlApplicationViewer();
    view->rootContext()->setContextProperty("musebox", this);
    view->rootContext()->setContextProperty("trackModel", &this->trackModel);
    view->setSource(QUrl::fromLocalFile("qml/MuseBox/main.qml"));
    view->setResizeMode(QDeclarativeView::SizeRootObjectToView);


    QGLFormat format = QGLFormat::defaultFormat();
    format.setSampleBuffers(false);
    QGLWidget *glWidget = new QGLWidget(format);
    glWidget->setAutoFillBackground(false);
    view->setViewport(glWidget);

    setCentralWidget(view);
    Hardware::Init();
    view->rootContext()->setContextProperty("transposeMachine", Hardware::TransposeMachine);
    Hardware::StartAudio();
}
Example #3
0
int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    qmlRegisterType<ShipRotation>("SpaceDebris", 1, 0, "ShipRotation");
    qmlRegisterType<SpaceAudio>("SpaceDebris", 1, 0, "SpaceAudio");

    QmlApplicationViewer viewer;
    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
    viewer.setResizeMode(QmlApplicationViewer::SizeRootObjectToView);
    viewer.setMainQmlFile(QLatin1String("qml/spacerace/main.qml"));
    viewer.showFullScreen();

    return app.exec();
}
Example #4
0
int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    app.setApplicationName("BBSimpleCalc ");
       app.setApplicationVersion("1.0rc LGPL 3.0 lic.");
       app.setOrganizationName("Silesian University of Technology Students");
    QmlApplicationViewer viewer;
    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
    viewer.setResizeMode(QmlApplicationViewer::SizeRootObjectToView);
    viewer.setSource(QUrl("qrc:/qml/main.qml"));
    viewer.setWindowState(Qt::WindowFullScreen);
    viewer.showExpanded();

    return app.exec();
}
Example #5
0
int main(int argc, char *argv[])
{
    QScopedPointer<QApplication> app(createApplication(argc, argv));
    QCoreApplication::setApplicationName("Test QML");

    qmlRegisterType<VlcQMLVideoPlayer>("VLCQt", 0, 6, "VlcVideoPlayer");

    QmlApplicationViewer viewer;
    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
    viewer.setMainQmlFile("qml/video.qml");
    viewer.setResizeMode(QDeclarativeView::SizeViewToRootObject);
    viewer.showExpanded();

    return app->exec();
}
Example #6
0
Q_DECL_EXPORT int main(int argc, char *argv[])
{
    QScopedPointer<QApplication> app(createApplication(argc, argv));

    QmlApplicationViewer viewer;
        viewer.setAttribute(Qt::WA_LockPortraitOrientation);
        Helper helper;
        viewer.setResizeMode(QDeclarativeView::SizeRootObjectToView);
        viewer.rootContext()->setContextProperty("Helper", &helper);
        viewer.setAttribute(Qt::WA_OpaquePaintEvent);
        viewer.setAttribute(Qt::WA_NoSystemBackground);
        viewer.viewport()->setAttribute(Qt::WA_OpaquePaintEvent);
        viewer.viewport()->setAttribute(Qt::WA_NoSystemBackground);
        viewer.setSource(QUrl("qrc:/qml/main.qml"));
    viewer.showFullScreen();

    return app->exec();
}
Example #7
0
Q_DECL_EXPORT int main(int argc, char *argv[])
{
    QScopedPointer<QApplication> app(createApplication(argc, argv));

    QmlApplicationViewer viewer;
    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
    QDir dir = QDir(QDir::home());
    dir.cd("Videos");
    dir.setFilter(QDir::Files);
    QStringList entries = dir.entryList();
    QDeclarativeContext *ctxt = viewer.rootContext();
    ctxt->setContextProperty("filesModel", QVariant::fromValue(entries));
    ctxt->setContextProperty("filesRoot", QVariant::fromValue(dir.absolutePath()));

    QPixmap nullCursor(16, 16);
    nullCursor.fill(Qt::transparent);
//    QApplication::setOverrideCursor(QCursor(nullCursor));
    viewer.setMainQmlFile(QLatin1String("qml/nakkikioski/main.qml"));
    viewer.setResizeMode(QDeclarativeView::SizeRootObjectToView);
    viewer.showExpanded();
    viewer.showFullScreen();

    return app->exec();
}