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

    • Type: Bug
    • Status: Open
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.8.0
    • Fix Version/s: None
    • Labels:
    • Environment:
      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

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

            Activity

              People

              Assignee:
              qt.team.quick.subscriptions Qt Quick and Widgets Team
              Reporter:
              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