Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <QtGui/QGuiApplication>
- #include "qtquick2applicationviewer.h"
- #include <QQmlProperty>
- #include <QQuickView>
- #include <QObject>
- #include <QtQuick>
- int main(int argc, char *argv[])
- {
- QGuiApplication app(argc, argv);
- QQuickView view;
- view.setSource(QUrl::fromLocalFile("qml/interacting/main.qml"));
- view.show();
- QObject *object = view.rootObject();
- QQmlProperty(object, "width").write(500);
- QObject *rect = object->findChild<QObject*>("rect");
- if (rect)
- rect->setProperty("color", "red");
- return app.exec();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement