qquickview

QQuickView (QML) transparent for mouse events

↘锁芯ラ 提交于 2021-01-29 03:29:26
问题 I have a big rectangle with a button centered. I would like that my rectangle is transparent to mouse events except for the button, which must be clickable. I mean, I would like to be able to select code under my rectangle with the mouse, exactly as if no Rectangle was displayed. I have added a MouseArea for all the big Rect, trying to ignore mouse events, but it does not work. I read that 'Qt::WA_TransparentForMouseEvents' is used for that purpose, but in Qt windows as fasr as I know, not

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:

Multiple windows in a single project

杀马特。学长 韩版系。学妹 提交于 2019-12-04 22:45:57
问题 I have a requirement for my project to display two QML Window s each on one of the screen (one sender, one receiver). Both of the .qml requires me to include some Cpp models inside hence, I'm using QQmlApplicationEngine to register the Cpp models. I found out that using QWidget::createWindowContainer() I'm able to display multiple Window s for a single project. This works perfectly fine for the first QML file. The code snippets looks like this: QQmlApplicationEngine* engine = new

Memory management issue with deleting QQuickView in Qt5.3(mingw32)

╄→гoц情女王★ 提交于 2019-11-30 09:56:42
问题 We are developing an application with Qt/Qml (Qml is embedded in the QWidget). When deleting a QWidget that contains a QQuickView (embedded), the allocated memory won't be freed entirely. By adding a QWidget to application, about 30MB of memory will be allocated but when the widget deletes, only about 20MB of memory will be freed. In the destructor of QWidget, I have deleted the QQuickView instance and there are no other big objects. Also, I am pretty sure that the QQuickView doesn't release

Memory management issue with deleting QQuickView in Qt5.3(mingw32)

倾然丶 夕夏残阳落幕 提交于 2019-11-29 17:42:34
We are developing an application with Qt/Qml (Qml is embedded in the QWidget). When deleting a QWidget that contains a QQuickView (embedded), the allocated memory won't be freed entirely. By adding a QWidget to application, about 30MB of memory will be allocated but when the widget deletes, only about 20MB of memory will be freed. In the destructor of QWidget, I have deleted the QQuickView instance and there are no other big objects. Also, I am pretty sure that the QQuickView doesn't release memory properly. How can I free entire memory allocated by QQuickView? NOTE: The code is really big