Reload QQuickView into the same window container
Rem-Kolomna last edited by Rem-Kolomna
I want to write plugins to my program as qml displaying inside dock widget
I load plugin this way:
if (!qview) qview = new QQuickView(); qview->engine()->clearComponentCache(); qview->setSource(QUrl(path)); QQuickItem *item_main = qview->rootObject(); QWindow* main_page = item_main->window(); auto container = QWidget::createWindowContainer( main_page, ui->dockWidgetContents ); container->show();
It works ok, but reloading plugin is quite slow. I think it is because createWindowContainer creates native window each time.
Can I speed up loading by forcing QQuickView use the same window container after reload?
p3c0 Moderators last edited by
@Rem-Kolomna I'm not sure about what is the problem exactly. But did you try QQuickWidget instead ? It is a new class added since
Qt 5.3and it loads QML too.
Rem-Kolomna last edited by
Thank you, QQuickWidget is a solution for my problem