<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 11 Nov 2022 at 14:10, Harald Vistnes <<a href="mailto:harald.vistnes@gmail.com">harald.vistnes@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br><div><br></div><div>So the question is, what is the best way for migrating a QWidgets based dialog to a Qt Quick Controls based dialog? Should I not use QQuickWidget for standalone dialogs, but instead trigger the QML in another way? Or embed the QQuickWidget inside a QDialog? Or use QQmlApplicationEngine directly?</div><div><br></div></div></blockquote><div><br>There are many ways to do that not sure which one is best, but I will share what I generally do:<br><br><ol><li>When I want to integrate QML in a widget app, I generally use QQuickWIdget.<br></li><li>For dialogs:<br></li><ul><li>either I use a QDialog and I integrate the QQuickWidget as any other widget<br></li><li>or I implement a QuickDialog which is a subclass of QQuickView with some QDialog-like functions (exec(), accept(), etc.)<br></li></ul><li>I never use Window or ApplicationWindow QML types, because, as you have experienced, you get 2 windows: one from the QQuickView and a second one from the Window QML type.<br></li></ol><div>From my experience this gives the best controls and ease of use, but of course there are some exceptions.<br>Also, it is possible to replace QQuickWidget by a QQuickView combined with QWidget::createWindowContainer().<br><br>I only use QQmlApplicationEngine and Window QML types when writing pure Qt Quick applications.<br><br>Regards<br><br>Benjamin</div></div></div></div>