diff --git a/src/widgets/kernel/qshortcut.cpp b/src/widgets/kernel/qshortcut.cpp index 9c3c51dd9a..cb2d08956b 100644 --- a/src/widgets/kernel/qshortcut.cpp +++ b/src/widgets/kernel/qshortcut.cpp @@ -521,9 +521,9 @@ void QShortcut::setContext(Qt::ShortcutContext context) d->redoGrab(qApp->d_func()->shortcutMap); } -Qt::ShortcutContext QShortcut::context() +Qt::ShortcutContext QShortcut::context() const { - Q_D(QShortcut); + Q_D(const QShortcut); return d->sc_context; } diff --git a/src/widgets/kernel/qshortcut.h b/src/widgets/kernel/qshortcut.h index e240ea8864..077028ccd3 100644 --- a/src/widgets/kernel/qshortcut.h +++ b/src/widgets/kernel/qshortcut.h @@ -77,7 +77,7 @@ public: bool isEnabled() const; void setContext(Qt::ShortcutContext context); - Qt::ShortcutContext context(); + Qt::ShortcutContext context() const; void setWhatsThis(const QString &text); QString whatsThis() const;