qqmlapplicationengine

QtQml installation in Raspberry pi

瘦欲@ 提交于 2020-01-15 10:13:11
问题 I am stuck with one error while building PyQt5 for rasberry pi. I was successfully able to run the application which uses QQmlApplicationEngine on Windows Desktop. Now I wanted to run the same application in Raspberry pi 3. I build the PyQt5 (5.4.1v) from the source and tried running the application but I get error: ImportError: No Module Found "PyQt5.QtQml". I realized that, when I build the PyQt5 from the source, I get: Project Error: Unknown module(s) in QT: qml and shows me a list of

How can I get access to object of `QQmlApplicationEngine` inside a `QQuickItem` derived class?

妖精的绣舞 提交于 2019-12-24 19:19:30
问题 The variable engine in the following typical main function of a QtApp is a valid instance of QQmlApplicationEngine . int main(int argc, char *argv[]) { QGuiApplication app(argc, argv); QQmlApplicationEngine engine; engine.load(QUrl(QStringLiteral("qrc:/qml/main.qml"))); return app.exec(); } Is it possible to get access to object of QQmlApplicationEngine inside a function of a QQuickItem derived class? If yes, how? class TestItem : public QQuickItem { public: TestItem(); SomeMethod() { // Is

How to create a new QQuickItem copy from scratch on C++ side with the same properties as an existing one

跟風遠走 提交于 2019-12-24 18:29:17
问题 I have a QQuickItem fetched from C++ side like this. QQuickItem * my_item = qmlEngine->rootObjects()[0]->findChild<QQuickItem*>("ItemObjectName"); my_item is valid & has all the properties set on to it. Scenario I have 2 windows which need this QQuickItem to be drawn on alterantively. I want to render this my_item to a different window. This works perfectly fine as long as I set the Parent of the my_item to the other window // the_other_window is a QQuickWindow QQuickWindow * the_other_window

Use QQuickView or QQmlApplicationEngine to switch between pages from ApplicationWindow

 ̄綄美尐妖づ 提交于 2019-12-24 01:19:16
问题 I'd like to use an ApplicationWindow as a main file and be able to switch to other QML files from C++ with QQuickView::setSource(const QUrl & url) . Basically it would do this: start-up => loads main.qml ( ApplicationWindow ) => click on help button => C++ loads help.qml file => etc. int main(int argc, char *argv[]) { QApplication app{argc, argv}; CustomQQuickView view; view.setSource(QUrl{"qrc:/main.qml"}); view->show(); return app.exec(); } main.qml ApplicationWindow { visible: true width:

Properly reloading a QQmlApplicationEngine

☆樱花仙子☆ 提交于 2019-12-22 08:08:39
问题 I have a QML-based app that loads a main.qml file from the file system like this: myEngine->load("main.qml"); This works fine, but I'd like to "reload" the engine in case the main.qml was replaced with a newer version. What I tried so far was calling load() again, assuming that the engine will automatically reset itself like in other Qt classes. Unfortunately this is not the case. If I call the method again, another window will appear with the contents of the updated qml file, while the

Update ImageView in QML

大兔子大兔子 提交于 2019-12-13 09:55:20
问题 I am processing an image using opencv during runtime and want to display the updated version of this image in QML using imageView, i currently am creating a new image file at runtime and reassigning its path to the imageView in QML, is there any better method for this? 回答1: If I understand the question correctly, I do this by connecting a changed signal emitted from the c++ code and connect it to a receiver that forces a reload on the qml side : // MyImage.qml Image { cache: false function

How create a separate copy of a QQuickItem & render it on a different window

你离开我真会死。 提交于 2019-12-12 04:48:11
问题 I have a QQuickItem fetched from C++ side like this. QQuickItem * my_item = qmlEngine->rootObjects()[0]->findChild<QQuickItem*>("ItemObjectName"); my_item is valid & has all the properties set on to it. Scenario I have 2 windows which need this QQuickItem to be drawn on alterantively. I want to render this my_item to a different window. This works perfectly fine as long as I set the Parent of the my_item to the other window // the_other_window is a QQuickWindow QQuickWindow * the_other_window