Qt
  1. Qt
  2. QTBUG-59293

Buttons remain some color of pressed-state

    Details

    • Type: Bug Bug
    • Status: In Progress
    • Priority: P1: Critical P1: Critical
    • Resolution: Unresolved
    • Affects Version/s: 5.8.0
    • Fix Version/s: None
    • Component/s: QtQuick: Controls 2
    • Labels:
      None
    • Environment:

      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

      1. drawer_itemdelegate.png
        107 kB
      2. Drawer_presses.png
        311 kB
      For Gerrit Dashboard: QTBUG-59293
      # Subject Project Status CR V

        Activity

        Hide
        Ekkehard added a comment -

        it works for the problems in Drawer
        The other use-case in Bottom Navigation it doesn't work. But I didn't found a way to make this reproducable yet. As you know I'm having a workaround there (swapping between 2 Loaders)
        Will try to make it reproducable later

        Show
        Ekkehard added a comment - it works for the problems in Drawer The other use-case in Bottom Navigation it doesn't work. But I didn't found a way to make this reproducable yet. As you know I'm having a workaround there (swapping between 2 Loaders) Will try to make it reproducable later
        Hide
        Ekkehard added a comment - - edited

        will have to do the patch for iOS, too

        hope this will be the right way to patch ?

        cd /your-path-to-store-cloned-repo_ios
        git clone --branch 5.8 git://code.qt.io/qt/qtquickcontrols2.git
        cd qtquickcontrols2
        git fetch https://codereview.qt-project.org/qt/qtquickcontrols2 refs/changes/64/187564/1 && git cherry-pick FETCH_HEAD
        /your-path-where-qt-is-installed/5.8/ios/bin/qmake
        make
        make install
        

        or can I use the same repo and only do

        cd /your-path-to-store-cloned-repo
        cd qtquickcontrols2
        /your-path-where-qt-is-installed/5.8/ios/bin/qmake
        make
        make install
        
        Show
        Ekkehard added a comment - - edited will have to do the patch for iOS, too hope this will be the right way to patch ? cd /your-path-to-store-cloned-repo_ios git clone --branch 5.8 git: //code.qt.io/qt/qtquickcontrols2.git cd qtquickcontrols2 git fetch https: //codereview.qt-project.org/qt/qtquickcontrols2 refs/changes/64/187564/1 && git cherry-pick FETCH_HEAD /your-path-where-qt-is-installed/5.8/ios/bin/qmake make make install or can I use the same repo and only do cd /your-path-to-store-cloned-repo cd qtquickcontrols2 /your-path-where-qt-is-installed/5.8/ios/bin/qmake make make install
        Hide
        J-P Nurmi added a comment -

        You can clone a new one, or reuse the existing one. If you reuse the existing one, make sure to cleanup the old Android build by running git clean -xdf in the repo. If you don't care about the old Android build, you can just build for iOS the same way you did for Android. Alternatively, if you want to have both Android and iOS builds around, you can still share a single repo by doing both builds outside the repo as shadow/out-of-source-tree builds. Just make sure to run git clean -xdf in the existing repo where you already did a build for Android to cleanup all the intermediate build files that would conflict with an iOS build.

        Prepare by cleaning up the previous build:

        cd /path/to/qtquickcontrols2
        git clean -xdf
        

        Build for iOS:

        cd ..
        mkdir build-qtquickcontrols2-ios # on the same level next to the qtquickcontrols2 repo
        cd build-qtquickcontrols2-ios
        /path/to/ios/qmake ../qtquickcontrols2
        make
        make install
        

        The Android steps would be the same, but just name the dir something different and use qmake from a Qt for Android installation.

        Show
        J-P Nurmi added a comment - You can clone a new one, or reuse the existing one. If you reuse the existing one, make sure to cleanup the old Android build by running git clean -xdf in the repo. If you don't care about the old Android build, you can just build for iOS the same way you did for Android. Alternatively, if you want to have both Android and iOS builds around, you can still share a single repo by doing both builds outside the repo as shadow/out-of-source-tree builds. Just make sure to run git clean -xdf in the existing repo where you already did a build for Android to cleanup all the intermediate build files that would conflict with an iOS build. Prepare by cleaning up the previous build: cd /path/to/qtquickcontrols2 git clean -xdf Build for iOS: cd .. mkdir build-qtquickcontrols2-ios # on the same level next to the qtquickcontrols2 repo cd build-qtquickcontrols2-ios /path/to/ios/qmake ../qtquickcontrols2 make make install The Android steps would be the same, but just name the dir something different and use qmake from a Qt for Android installation.
        Hide
        Ekkehard added a comment -

        thx. step-by-step collecting more recipes

        BTW: https://codereview.qt-project.org/#/c/187564/ is about force reset ripple background when hidden

        problem with my other (not-so-easy-to-reproduce-use-case) is where the ToolButton in BottomNavigationBar was not hidden but overlapped by the Drawer

        Show
        Ekkehard added a comment - thx. step-by-step collecting more recipes BTW: https://codereview.qt-project.org/#/c/187564/ is about force reset ripple background when hidden problem with my other (not-so-easy-to-reproduce-use-case) is where the ToolButton in BottomNavigationBar was not hidden but overlapped by the Drawer
        Hide
        Ekkehard added a comment -

        now done the patch for iOS.
        Also working well in Drawer

        THX - now I can go on moving projects from 5.7 to 5.8

        Show
        Ekkehard added a comment - now done the patch for iOS. Also working well in Drawer THX - now I can go on moving projects from 5.7 to 5.8

          People

          • Assignee:
            J-P Nurmi
            Reporter:
            Ekkehard
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:

              Gerrit Reviews

              There is 1 open Gerrit change