Advertisement
Kamalpreet

Untitled

Jun 29th, 2014
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. #include <QtGui/QGuiApplication>
  2. #include "qtquick2applicationviewer.h"
  3. #include <QQmlProperty>
  4. #include <QQuickView>
  5. #include <QObject>
  6. #include <QtQuick>
  7.  
  8. int main(int argc, char *argv[])
  9. {
  10. QGuiApplication app(argc, argv);
  11.  
  12. QQuickView view;
  13. view.setSource(QUrl::fromLocalFile("qml/interacting/main.qml"));
  14. view.show();
  15. QObject *object = view.rootObject();
  16. QQmlProperty(object, "width").write(500);
  17. QObject *rect = object->findChild<QObject*>("rect");
  18. if (rect)
  19. rect->setProperty("color", "red");
  20. return app.exec();
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement