Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved source item to be glowing on popup modal set

    QML and Qt Quick
    1
    1
    71
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      dsba last edited by

      Hi All,
      I was working on pop-ups, on set of modal to true, whole window goes dim, whereas I wanted the pressed button/source item to be glowing. Below is the sample code.
      I am trying set property z of testButton so that it appears on modal dim effect. Kindly help me out to understand what I have missed.

      Thanks in advance,

      import QtQuick 2.12
      import QtQuick.Window 2.12
      import QtQuick.Controls 2.12
      import QtGraphicalEffects 1.0

      Window {
      id: root
      visible: true
      width: 640
      height: 480
      title: qsTr("Hello World")
      color: "pink"

      Button {
          id: testButton
          x: root.width/2 - testButton.width/2
          width: 70
          height: 116
          z: 0
          background: Rectangle {
              color: "white"
          }
          text: "B1"
      }
      MouseArea {
          id: testButtonMouseArea
          anchors.fill: testButton
          onClicked: {
              testButtonPopUp.open()
          }
      }
      
      
      Popup {
          id: testButtonPopUp
          width: 200
          height: 300
          modal: true
          onOpened: popUpBackRect.state = "on"
          onClosed: popUpBackRect.state = "off"
      
          background: Rectangle {
              id: popUpBackRect
              color: "white"
              states: [
                  State {
                      name: "on"
                      PropertyChanges { target: testButtonPopUp; dim: true; }
      

      // PropertyChanges { target: testButton; z: 2 }
      },
      State {
      name: "off"
      PropertyChanges { target: testButtonPopUp; dim: false; }
      // PropertyChanges { target: testButton; z: 1 }
      }
      ]
      }
      }
      }

      1 Reply Last reply Reply Quote 0
      • First post
        Last post