On Fri, 11 Nov 2022 at 14:10, Harald Vistnes <[email protected]>
wrote:
>
>
> 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?
>
>
There are many ways to do that not sure which one is best, but I will share
what I generally do:
1. When I want to integrate QML in a widget app, I generally use
QQuickWIdget.
2. For dialogs:
- either I use a QDialog and I integrate the QQuickWidget as any other
widget
- or I implement a QuickDialog which is a subclass of QQuickView with
some QDialog-like functions (exec(), accept(), etc.)
3. 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.
>From my experience this gives the best controls and ease of use, but of
course there are some exceptions.
Also, it is possible to replace QQuickWidget by a QQuickView combined with
QWidget::createWindowContainer().
I only use QQmlApplicationEngine and Window QML types when writing pure Qt
Quick applications.
Regards
Benjamin
_______________________________________________
Interest mailing list
[email protected]
https://lists.qt-project.org/listinfo/interest