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

Customized Qt.labs ComboBox won't display in an asynchronous Loader

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Duplicate
    • Affects Version/s: 5.6
    • Fix Version/s: None
    • Component/s: Quick: Controls 2
    • Labels:
      None
    • Environment:
      Windows 7
      QtCreaor 3.6.1
      Qt 5.6.0
      But doesn't seem to be environment related

      Description

      I'm trying out the Technical Preview of the QtQuick.Controls 2.0 known at the moment as Qt.labs.controls 1.0.

      As you can easily customize those new controls, putting a customized ComboBox in an asynchronous Loader makes it to not appear at all, printing this message in the console :

      qrc:/main.qml: Object destroyed during incubation
      

      This is quite inconvenient as a similar bug existed in Qt 5.5.0.
      This might be related to this unresolved bug (Controls 1.0)

      I found out that customizing any of the available properties (even separately) triggers the bug, exception for delegate.

      Here's minimal code to reproduce the bug :

      import QtQuick 2.6
      import Qt.labs.controls 1.0
      
      ApplicationWindow {
          id: root
          visible : true
          width   : 640
          height  : 480
      
          property bool  triggerTheBug: true // Swap this to see a normal display of the ComboBox
      
          StackView {
              id: myStackView
              anchors.fill: parent
              initialItem: Loader {
                  anchors.fill: parent
                  asynchronous    : triggerTheBug
                  sourceComponent :
                      ComboBox { popup      : Popup{} }         // BUG
                  //ComboBox { background : Rectangle{} }     // BUG
                  //ComboBox { contentItem: Rectangle{} }     // BUG
                  //ComboBox { delegate   : ItemDelegate{} }  // NO BUG
              }
          }
      }
      

      I attached a .zip file with extended code proving that my customizations works well when using a standard Loader.

      If you try out the attached example, you'll also notice that for a standard ComboBox in an asynchronous Loader, the first element of the model won't show upon completion of the component, you need to select it yourself.

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              qt.team.quick.subscriptions Qt Quick and Widgets Team
              Reporter:
              Coding_Eric Eric Barral
              Votes:
              5 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes