Created
July 5, 2011 00:33
-
-
Save dio/1064106 to your computer and use it in GitHub Desktop.
qmlviews: 1 vs. 2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // engine | |
| QDeclarativeEngine engine; | |
| QDeclarativeComponent component(&engine, QUrl::fromLocalFile("main.qml")); | |
| QDeclarativeItem * item = qobject_cast<QDeclarativeItem * >(component.create()); | |
| // scene | |
| QGraphicsScene scene; | |
| scene.addItem(item); | |
| // view | |
| QGraphicsView view(&scene); | |
| view.show(); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| QDeclarativeView view; | |
| view.setSource(QUrl::fromLocalFile("main.qml")); | |
| view.show(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment