Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-121796 Widgets and Quick hybrid UI development
  3. QTBUG-121798

Make it possible to embed a Qt Quick View inside a QLayout

    XMLWordPrintable

Details

    • Technical task
    • Resolution: Unresolved
    • P2: Important
    • None
    • None
    • None
    • ddc80cc63 (dev)

    Description

      Suppose we have the following UI hierarchy:

       

      QWidget ['widget']  (has a QHBoxLayout)
        QWidget ['windowContainer']. (Added to the QHBoxLayout)
          QQuickWindow
            QQuickItem ['rootItem']

       

      If a developer is embedding a QQuickWindow inside a QLayout there are some expectations that we should try to meet:

      1. Sensible size hints and size policies are propagated from the QQuickWindow up to the QLayout (actually it should be enough to propagate it up to the "windowContainer" widget.
        • If this works, the initial size of the 'widget' QWidget should be derived from the size of the 'rootItem'
        • Remember that size hints includes both min,preferred and max size.
        • Resizing the 'widget' might cause the QQuickWindow to be resized.
        • How can size policies be communicated up from the 'rootItem' and to the 'windowContainer' while going via the QQuickWindow (that doesn't know much about size policies). Maybe createWindowContainer() can be a bit smarter in how 'upwards' size hint and size policy propagation is done? (e.g. if the QQuickWindow does not have an API to specify size policy - can it can plumb together size policy of the contentItem and the returned QWidget ?)

      Note that the QQuickWindow can be embedded into a layout by first wrapping the QQuickWindow with:

       

      QWidget *hostedQuickWindow = QWidget::createWindowContainer(quickWindow);

       

       

      Attachments

        For Gerrit Dashboard: QTBUG-121798
        # Subject Branch Project Status CR V

        Activity

          People

            smd Jan Arve
            smd Jan Arve
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes