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

Overlay's opacity is ignored

    XMLWordPrintable

Details

    • ef8bde838 (dev), c8ce47f8d (6.6)

    Description

      Code

      import QtQuick 2.15
      import QtQuick.Window 2.15
      import QtQuick.Controls 2.15
      
      Window {
          id: window
          width: 640
          height: 480
          visible: true
      
          Text {text: "Hello"}
      
          Popup {
              id: popup
              anchors.centerIn: parent
              width: 320
              height: 240
              modal: false
              dim: true
              closePolicy: Popup.NoAutoClose
      
              Text {
                  anchors.centerIn: parent
                  text: "World"
              }
      
              Overlay.modeless: Rectangle {
                  color: "blue"
                  opacity: 0.5
                  
                  // color: "#770000ff" // WORKAROUND
              }
          }
          Component.onCompleted: popup.open()
      }
      

       

      Expected Outcome
      The dimming overlay is translucent, so we can see the text "Hello"

       

      Actual Outcome
      The dimming overlay is opaque, so we cannot see the text "Hello"

       

      Workaround
      Instead of setting opacity, give the color an alpha channel

      Attachments

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

        Activity

          People

            vhilshei Volker Hilsheimer
            skoh-qt Sze Howe Koh
            Votes:
            1 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes