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

Menu actions are triggered despite a modal dialog being open

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • 5.9.1
    • 5.9.0 Beta 4
    • Quick: Controls 2
    • None
    • Windows 10, Mac OSX 10.12.4
    • 44a5b008f7a6dce065f5997503e403609ee62859

      This code is run in a QQucikVidget placed inside a dock widget. And the shortcuts are actions set up as c++ (.ui) menu actions. One weird part is that it does accept the characters that are NOT shortcuts, only the shortcuts are fully intercepted before reaching the focused item. So perhaps the bug is there and not with the focus of the text fields? (Note that this behavior does NOT exist for c++ modal dialogs with a widget textEdit in them, nor does it happen with Qt 5.8.

      The shortcuts I have been testing with are: a and Space.

      Thanks beforehand!

       

      Item {
      	focus: true
      	width: 500
      	height: 500
      	Keys.onPressed: console.log("pressed", event.key)
      	Keys.onReleased: console.log("released", event.key)
      
      
      	MouseArea {
      		anchors.fill: parent
      		onClicked: {
      			dialog.open();
      			print("Clicked on mouse area!");
      		}
      	}
      	
      	Dialog {
      		id: dialog
      		modal: true
      		focus: true
      		width: 200
      		height: 200
      
      
      		TextField {
      			anchors.fill: parent
      			focus: true
      			text: "TextField"
      		}
      	}
      }
      

        1. TestShortcutLeaks.pro
          1 kB
          Björn Trollmo Rogetzky
        2. main.cpp
          0.2 kB
          Björn Trollmo Rogetzky
        3. mainwindow.cpp
          0.3 kB
          Björn Trollmo Rogetzky
        4. mainwindow.h
          0.4 kB
          Björn Trollmo Rogetzky
        5. mainwindow.ui
          2 kB
          Björn Trollmo Rogetzky
        6. qmlItem.qml
          0.5 kB
          Björn Trollmo Rogetzky
        7. qrc.qrc
          0.1 kB
          Björn Trollmo Rogetzky
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Unassigned Unassigned
            zicandar Björn Trollmo Rogetzky
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes