Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-44996

new ctor for QDialog which accepts QWindow as parent

XMLWordPrintable

      I think it would be really helpful if QDialog has a ctor which accepts a QWindow instance as parent.

      Qt 5 provide new way to build GUI application: QML and QtQuick.
      When selecting QML as a main language for interface, the main window is usually an instance of QQuickView(or QQuickWindow) which is a subclass of QWindow.

      Those application may still need to utilize QDialog which is a subclass of QWidget for some kind of advanced tools or preferences dialogs.

      However, because QDialog only accepts QWidget as a parent, the apps which utilize QQuickView as main window cannot use QDialog without duplicated taskbar title item.

      Maybe simple dialog can be implemeted by using Dialog element in QML but, dialogs such as preferences dialog requires lots of controls and they may contain also lots of customization.
      To implement all these things in QML side is really painful job but in C++, this can be easily through Qt designer(Qt Creator supports similar functionality for QML but it's really easily broken once custom module introduced). For custom types, all I have to is just to promote widgets.

      There are QQuickWidget/QWidget::createContainer but as the document says, they're not all goody things.

      Unlike other widgets, QDialog is alway top-level widget, so there's no issue about stacking/painting/positioing problem when QDialog takes QWindow as a parent.
      Therefore, I suggest to add a new constructor for QDialog which can accept QWindow as a parent.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            xylosper Byoung-young Lee
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes