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

Combobox indicator in a pop-up is lost if pop-up closed and re-opened

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.8.0
    • Tried it on windows, also will try it on ubuntu

    Description

      Hi,

      I have a popup control which has combobox in its contentItem.

      And In this combobox I have a indicator:Canvas.

      When popup seen on the screen , I click outside the popup and it is closed.After that when I try to open the combobox again, I dont see indicator on combobox and getting following warning in console:

      file:///C:/Users/cjs330/Documents/QT/Raspberry/RaspiComponents/RaspiMainMenuComboBox.qml:36: TypeError: Cannot call method 'reset' of null

      Here is minimal QML code that can reproduce the issue without Qt Quick Controls 2:

      main.qml
      import QtQuick 2.0
      import QtQuick.Window 2.0
      
      Window {
          id: window
          width: 400
          height: 400
          visible: true
          title: "QTBUG-61334"
      
          Canvas {
              id: canvas
              width: 12
              height: 8
              contextType: "2d"
              onAvailableChanged: print("available", available)
              onContextChanged: print("context", context)
      
              Timer {
                  running: true
                  interval: 1000
                  repeat: true
                  onTriggered: {
                      canvas.parent = canvas.parent ? null : window.contentItem
                  }
              }
      
              onPaint: {
                  context.reset();
                  context.moveTo(0, 0);
                  context.lineTo(width, 0);
                  context.lineTo(width / 2, height);
                  context.closePath();
                  context.fillStyle = "#21be2b";
                  context.fill();
              }
          }
      }
      

      See qtbug61334.zip for a project containing the original QML.

      Regards

      Attachments

        1. example.qml
          3 kB
        2. files.zip
          3 kB
        3. qtbug61334.zip
          3 kB

        Issue Links

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

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              ekrems Ekrem Şahin
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes