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

ShortcutOverride triggered three times even though the event is accepted (and filtered)

    XMLWordPrintable

Details

    • d7ca800a87a2291c94c6580f0cfe068bb2280caf

    Description

      Qt5/Mac delivers ShortcutOverride events twice three times. See the small attached example, which just adds a QShortcut, and installs an event filter on ShortcutOverrides. Run and press <escape>!

      As a side note, this looks like a reappearing QTCREATORBUG-698

      Backtraces of first and second time entering the event filter:

      1)

      0	Widget::eventFilter	widget.cpp	26	0x1000031ec	
      1	QCoreApplicationPrivate::sendThroughObjectEventFilters	qcoreapplication.cpp	863	0x1018d5d3c	
      2	QApplicationPrivate::notify_helper	qapplication.cpp	3394	0x10005861b	
      3	QApplication::notify	qapplication.cpp	2866	0x10005a543	
      4	QCoreApplication::notifyInternal	qcoreapplication.cpp	767	0x1018d589f	
      5	QCoreApplication::sendSpontaneousEvent	qcoreapplication.h	206	0x10006098f	
      6	QWidgetWindow::handleKeyEvent	qwidgetwindow.cpp	436	0x1000de156	
      7	QWidgetWindow::event	qwidgetwindow.cpp	147	0x1000ddabb	
      8	QApplicationPrivate::notify_helper	qapplication.cpp	3398	0x100058645	
      9	QApplication::notify	qapplication.cpp	2829	0x10005a15f	
      10	QCoreApplication::notifyInternal	qcoreapplication.cpp	767	0x1018d589f	
      11	QCoreApplication::sendEvent	qcoreapplication.h	203	0x100d0415a	
      12	QShortcutMap::tryShortcutEvent	qshortcutmap.cpp	333	0x100d435c4	
      13	QWindowSystemInterface::tryHandleShortcutEvent	qwindowsysteminterface.cpp	188	0x100ce7470	
      14	-[QNSView handleKeyEvent:eventType:]	qnsview.mm	785	0x103e1b9d7	
      15	-[QNSView keyDown:]	qnsview.mm	810	0x103e1be93	
      16	-[NSWindow sendEvent:]			0x7fff9380f120	
      17	-[QNSWindow sendEvent:]	qcocoawindow.mm	129	0x103e12832	
      18	-[NSApplication sendEvent:]			0x7fff9380a744	
      19	-[QNSApplication sendEvent:]	qcocoaapplication.mm	183	0x103e2ab2d	
      20	-[NSApplication run]			0x7fff937202fa	
      21	QCocoaEventDispatcher::processEvents	qcocoaeventdispatcher.mm	588	0x103e23b48	
      22	QEventLoop::processEvents	qeventloop.cpp	136	0x1018d104c	
      23	QEventLoop::exec	qeventloop.cpp	212	0x1018d1265	
      24	QCoreApplication::exec	qcoreapplication.cpp	1020	0x1018d6042	
      25	QGuiApplication::exec	qguiapplication.cpp	1183	0x100cfcc16	
      26	QApplication::exec	qapplication.cpp	2673	0x100059ba9	
      27	main	main.cpp	10	0x100002d99	
      

      2)

      0	Widget::eventFilter	widget.cpp	26	0x1000031ec	
      1	QCoreApplicationPrivate::sendThroughObjectEventFilters	qcoreapplication.cpp	863	0x1018d5d3c	
      2	QApplicationPrivate::notify_helper	qapplication.cpp	3394	0x10005861b	
      3	QApplication::notify	qapplication.cpp	2866	0x10005a543	
      4	QCoreApplication::notifyInternal	qcoreapplication.cpp	767	0x1018d589f	
      5	QCoreApplication::sendEvent	qcoreapplication.h	203	0x100d0415a	
      6	QShortcutMap::tryShortcutEvent	qshortcutmap.cpp	333	0x100d435c4	
      7	QApplication::notify	qapplication.cpp	2849	0x10005a3e8	
      8	QCoreApplication::notifyInternal	qcoreapplication.cpp	767	0x1018d589f	
      9	QCoreApplication::sendSpontaneousEvent	qcoreapplication.h	206	0x10006098f	
      10	QWidgetWindow::handleKeyEvent	qwidgetwindow.cpp	436	0x1000de156	
      11	QWidgetWindow::event	qwidgetwindow.cpp	147	0x1000ddabb	
      12	QApplicationPrivate::notify_helper	qapplication.cpp	3398	0x100058645	
      13	QApplication::notify	qapplication.cpp	2829	0x10005a15f	
      14	QCoreApplication::notifyInternal	qcoreapplication.cpp	767	0x1018d589f	
      15	QCoreApplication::sendSpontaneousEvent	qcoreapplication.h	206	0x100d04d0f	
      16	QGuiApplicationPrivate::processKeyEvent	qguiapplication.cpp	1513	0x100cfe101	
      17	QGuiApplicationPrivate::processWindowSystemEvent	qguiapplication.cpp	1255	0x100cfd014	
      18	QWindowSystemInterface::sendWindowSystemEventsImplementation	qwindowsysteminterface.cpp	536	0x100ce898d	
      19	QWindowSystemInterface::sendWindowSystemEvents	qwindowsysteminterface.cpp	516	0x100ce8a00	
      20	QCocoaEventDispatcherPrivate::processPostedEvents	qcocoaeventdispatcher.mm	1037	0x103e24a94	
      21	QCocoaEventDispatcherPrivate::postedEventsSourceCallback	qcocoaeventdispatcher.mm	1058	0x103e25762	
      22	__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__			0x7fff9548c101	
      23	__CFRunLoopDoSources0			0x7fff9548ba25	
      24	__CFRunLoopRun			0x7fff954aedc5	
      25	CFRunLoopRunSpecific			0x7fff954ae6b2	
      26	RunCurrentEventLoopInMode			0x7fff932310a4	
      27	ReceiveNextEventCommon			0x7fff93230d84	
      28	BlockUntilNextEventMatchingListInMode			0x7fff93230cd3	
      29	_DPSNextEvent			0x7fff93729613	
      30	-[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:]			0x7fff93728ed2	
      31	-[NSApplication run]			0x7fff93720283	
      32	QCocoaEventDispatcher::processEvents	qcocoaeventdispatcher.mm	588	0x103e23b48	
      33	QEventLoop::processEvents	qeventloop.cpp	136	0x1018d104c	
      34	QEventLoop::exec	qeventloop.cpp	212	0x1018d1265	
      35	QCoreApplication::exec	qcoreapplication.cpp	1020	0x1018d6042	
      36	QGuiApplication::exec	qguiapplication.cpp	1183	0x100cfcc16	
      37	QApplication::exec	qapplication.cpp	2673	0x100059ba9	
      38	main	main.cpp	10	0x100002d99	
      

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-30164
          # Subject Branch Project Status CR V

          Activity

            People

              frederik Frederik Gladhorn
              con Eike Ziller
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes