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

Menu actions are triggered despite a modal dialog being open

    XMLWordPrintable

Details

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

    Description

      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"
      		}
      	}
      }
      

      Attachments

        1. main.cpp
          0.2 kB
        2. mainwindow.cpp
          0.3 kB
        3. mainwindow.h
          0.4 kB
        4. mainwindow.ui
          2 kB
        5. qmlItem.qml
          0.5 kB
        6. qrc.qrc
          0.1 kB
        7. TestShortcutLeaks.pro
          1 kB

        Issue Links

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

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes