Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Modal dialog with Material Style bug with Qt5.15.0
Forum Update on Monday, May 27th 2025

Modal dialog with Material Style bug with Qt5.15.0

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 388 Views
  • 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.
  • K Offline
    K Offline
    Kobey
    wrote on last edited by
    #1

    When opening a dialog within a dialog and setting the second dialog as modal, and focusing any controller with a ToolTip it is possible to click controllers behind the modal overlay but only in the first dialog.

    From what I've tested it is only an issue when using Material style.

    Untitled.png

    import QtQuick 2.15
    import QtQuick.Controls 2.15
    import QtQuick.Layouts 1.15
    
    ApplicationWindow {
        id: window
        visible: true
        width: 640
        height: 480
        title: "Modal Error"
    
        RowLayout {
            Button {
                text: "Open dialog"
                onClicked: mainDialog.open()
            }
            CheckBox {
                text: "Click me 1"
            }
        }
    
        Dialog {
            id: mainDialog
            x: 50
            y: 50
            height: parent.height - 100
            width: parent.width - 100
            closePolicy: Popup.NoAutoClose
            standardButtons: Dialog.Close
    
            RowLayout {
                anchors.fill: parent
    
                Button {
                    text: "Open Dialog"
                    onClicked: dialog.open()
                }
                Item {
                    Layout.fillWidth: true
                }
                CheckBox {
                    text: "Click me 2"
                }
            }
    
            Dialog {
                id: dialog
                title: "Dialog"
                modal: true
                closePolicy: Popup.CloseOnEscape
                height: parent.height - 100
                width: ( parent.width / 2 ) - 100
                x: 50
                y: 50
    
                TextField {
                    id: textField
                    placeholderText: "Focus me"
                    anchors.centerIn: parent
                    ToolTip.text: "ToolTip"
                    ToolTip.visible: textField.activeFocus
                }
            }
        }
    }
    

    One workaround could be to set overlay to a pane to handle the mouse-click event. But I'm interested to find the root cause.

    Dialog {
        id: dialog
        Overlay.modal: Pane { background: Item {} }
    }
    
    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved