Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ....
- QQmlContext * context = new QQmlContext(engine.rootContext());
- context->setContextProperty("data", &data);
- QQmlComponent component(&engine, QUrl(strQmlPath));
- ....
- Item {
- Connections {
- target: data
- onNewMessagePosted: window.visible = false
- }
- }
- class MessageBoard : public QObject
- {
- Q_OBJECT
- public: void callMe () {
- emit newMessagePosted ();
- } ;
- signals: void newMessagePosted ();
- };
- ...
- engine.rootContext()->setContextProperty("data", &data);
- ...
Add Comment
Please, Sign In to add comment