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

Buttons remain some color of pressed-state

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.9.0 Alpha
    • 5.8.0
    • Quick: Controls 2
    • None
    • Qt 5.8, QtCreator 4.2.1
      macOS 10.11.6
      Android 6, iOS 10.2.1

    Description

      as already discussed with J-P there are some situations where some pressed-state-color remains. Have noticed this with ToolButton and ItemDelegate.
      Never happened in apps like Gallery App, but always in my complex Apps.
      Finally was able to provide a small example. Seems the Loader is the difference - if using ItemDelegates directly all works well, using a Loader it happens. See some attached screenshots.
      Here's the demo code

      import QtQuick 2.7
      import QtQuick.Controls 2.1
      import QtQuick.Layouts 1.3
      import QtQuick.Controls.Material 2.1
      
      ApplicationWindow {
          id: window
          width: 640
          height: 480
          visible: true
      
          Page {
              anchors.fill: parent
      
              Label {
                  text: "Drawer test"
              }
              Drawer {
                  id: drawer
                  z: 1
                  leftPadding: 0
                  width: parent.width / 3
                  height: parent.height
                  Flickable {
                      contentHeight: myButtons.height
                      anchors.fill: parent
                      clip: true
                      ColumnLayout {
                          id: myButtons
                          focus: false
                          anchors.left: parent.left
                          anchors.right: parent.right
                          spacing: 0
                          Repeater {
                              id: myRepeater
                              model: 16
                              // using the ItemDelegate without a Loader all works well
                              Loader {
                                  Layout.fillWidth: true
                                  sourceComponent: myComponent
                                  active: true
                              }
                          } // repeater
                      } // col lay
      
                  } // flick
      
                  Component {
                      id: myComponent
                      // you can also use ToolButton to get a round area remaining pressed-state
                      ItemDelegate {
                          Layout.fillWidth: true
                          Layout.alignment: Qt.AlignHCenter
                          focusPolicy: Qt.NoFocus
                          height: 48
                          width: drawer.width
                          leftPadding: 16
                          Row {
                              Item {
                                  height: 24
                                  width: 24
                                  Label {
                                      height: 24
                                      width: 24
                                      verticalAlignment: Image.AlignTop
                                      anchors.horizontalCenter: parent.horizontalCenter
                                      text: "my Item"
                                      font.pixelSize: 24
                                  }
                              }
                          }
                          onClicked: drawer.close()
                      } // toolbutton
                  } // myComponent
      
              } // drawer
      
          } // page
      }
      

      For some of my apps this is a show-stopper

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            ekkescorner Ekkehard
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes