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

Quick Controls 2 do not work well with QtGraphicalEffects

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 5.12.3
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      Windows and Linux, Qt 5.12
    • Platform/s:
      Linux/X11, Windows

      Description

      When using a graphical effects component (DropShadow for instance) on an Item that contains a Quick Controls 2 element (Button for instance) the control's background stop being displayed correctly. Here is a small repro:

      import QtQuick 2.12
      import QtQuick.Controls 2.12
      import QtGraphicalEffects 1.12
      
      Pane {
          id: root
          width: 300
          height: 150
          Pane {
              id: content
              visible: false
              width: 200
              height: 50
      
              Button {
                  anchors.centerIn: parent
                  text: "Where's my BG ?"
              }
          }
      
          DropShadow {
              anchors.fill: content
              source: content
              radius: 10
              samples: 21
          }
      
          Button {
              anchors.top: content.bottom
              anchors.topMargin: 10
              text: "This is how I should look"
          }
      }
      

      If you save this to `test.qml` and run it through `qmlscene`, you'll get this:

      It seems to work, but: if you click  the second button, there's an animation on the background, whereas if you click the first one, nothing happens.

      Now if you run the same test using Material style (e.g. run `qmlscene --style Material test.qml`) then you get this:

      Now the background of the first button is not even visible.

      I've tested this on Windows and Linux, on Qt 5.12.

      Edit: It's not only visual, the controls just do not catch inputs (for instance if you use a SpinBox instead of the Button in the example, you can't use it at all.

        Attachments

        1. bug_material.png
          bug_material.png
          17 kB
        2. universal.png
          universal.png
          18 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            qt.team.quick.subscriptions Qt Quick and Widgets Team
            Reporter:
            citron Damien Courtois
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes