Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <QtCore/QObject>
- #include <QtGui/QApplication>
- #include <QtGui/QFileDialog>
- #include <QtDeclarative/QDeclarativeView>
- int main(int argc, char *argv[])
- {
- QApplication a(argc, argv);
- QFont appFont("Bitstream Vera Serif");
- a.setFont(appFont);
- QString qmlFile;
- if(argc < 2) {
- qmlFile = QFileDialog::getOpenFileName(0,"Select QML-File","/home","QML Files (*.qml)");
- if(qmlFile.isNull()) {
- return 1;
- }
- }
- else {
- qmlFile = argv[1];
- }
- QDeclarativeView *view = new QDeclarativeView();
- view->resize(480,272);
- qDebug("Loading file %s",qPrintable(qmlFile));
- view->setSource(QUrl::fromLocalFile(qmlFile));
- #ifdef Q_WS_QWS
- view->showFullScreen();
- a.setOverrideCursor(Qt::BlankCursor);
- #else
- view->show();
- #endif
- return a.exec();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement