Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qshortcut_widgets.cpp File Reference
#include "qshortcut.h"
#include "private/qshortcut_p.h"
#include "private/qwidget_p.h"
#include <qevent.h>
#include <qapplication.h>
#include <private/qapplication_p.h>
#include <private/qshortcutmap_p.h>
#include <private/qwidgetwindow_p.h>
#include <qpa/qplatformmenu.h>
+ Include dependency graph for qshortcut_widgets.cpp:

Go to the source code of this file.

Classes

class  QtWidgetsShortcutPrivate
 

Functions

static QT_BEGIN_NAMESPACE bool correctWidgetContext (Qt::ShortcutContext context, QWidget *w, QWidget *active_window)
 
bool qWidgetShortcutContextMatcher (QObject *object, Qt::ShortcutContext context)
 

Function Documentation

◆ correctWidgetContext()

static bool correctWidgetContext ( Qt::ShortcutContext  context,
QWidget w,
QWidget active_window 
)
static

Definition at line 104 of file qshortcut_widgets.cpp.

References Qt::ApplicationShortcut, context, QWidget::focusProxy(), QApplication::focusWidget(), QObjectPrivate::get(), QWidgetPrivate::get(), QWidget::isWindow(), menuBar, QWidget::parentWidget(), QMenuBar::platformMenuBar(), Qt::Popup, qDebug, Qt::SubWindow, Qt::Tool, QApplicationPrivate::tryModalHelper(), Qt::Widget, Qt::WidgetShortcut, Qt::WidgetWithChildrenShortcut, QWidget::window(), and QWidget::windowType().

Referenced by qWidgetShortcutContextMatcher().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qWidgetShortcutContextMatcher()

bool qWidgetShortcutContextMatcher ( QObject object,
Qt::ShortcutContext  context 
)

Returns true if the widget w is a logical sub window of the current top-level widget.

Definition at line 43 of file qshortcut_widgets.cpp.

References QApplication::activePopupWidget(), QApplication::activeWindow(), context, correctWidgetContext(), QGuiApplication::focusWindow(), Q_ASSERT_X, qobject_cast< QWidget * >(), and qobject_cast< QWindow * >().

Referenced by QtWidgetsShortcutPrivate::contextMatcher(), QWidget::grabShortcut(), and QGraphicsWidget::grabShortcut().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: