Search code examples
qtqmlqtquick2qtquickcontrols2qtdeclarative

Qt/QML - How to customize Popup dimming effect?


Hi is there a way to customize the dimming effect of the Popup when modal === true? I want the surrounding area of the Popup to be dimmed more.


Solution

  • You can customize the dimming effect by overriding the Overlay.modal attached property. See the docs here

    Popup {
        id: popup
        width: 400
        height: 400
        modal: true
        visible: true
    
        Overlay.modal: Rectangle {
            color: "#aacfdbe7"  // Use whatever color/opacity you like
        }
    }