summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/kernel')
-rw-r--r--src/widgets/kernel/qaction.cpp2
-rw-r--r--src/widgets/kernel/qshortcut.cpp6
-rw-r--r--src/widgets/kernel/qwidget.cpp5
-rw-r--r--src/widgets/kernel/qwindowcontainer.cpp9
4 files changed, 15 insertions, 7 deletions
diff --git a/src/widgets/kernel/qaction.cpp b/src/widgets/kernel/qaction.cpp
index e5bf606901..72aae647e0 100644
--- a/src/widgets/kernel/qaction.cpp
+++ b/src/widgets/kernel/qaction.cpp
@@ -1304,8 +1304,10 @@ Q_WIDGETS_EXPORT QDebug operator<<(QDebug d, const QAction *action)
d << " toolTip=" << action->toolTip();
if (action->isCheckable())
d << " checked=" << action->isChecked();
+#ifndef QT_NO_SHORTCUT
if (!action->shortcut().isEmpty())
d << " shortcut=" << action->shortcut();
+#endif
d << " menuRole=";
QtDebugUtils::formatQEnum(d, action->menuRole());
d << " visible=" << action->isVisible();
diff --git a/src/widgets/kernel/qshortcut.cpp b/src/widgets/kernel/qshortcut.cpp
index 7bd9e74924..6eec5ff7e8 100644
--- a/src/widgets/kernel/qshortcut.cpp
+++ b/src/widgets/kernel/qshortcut.cpp
@@ -141,7 +141,7 @@ bool qWidgetShortcutContextMatcher(QObject *object, Qt::ShortcutContext context)
static bool correctWidgetContext(Qt::ShortcutContext context, QWidget *w, QWidget *active_window)
{
bool visible = w->isVisible();
-#ifdef Q_OS_MAC
+#if defined(Q_OS_DARWIN) && !defined(QT_NO_MENUBAR)
if (!qApp->testAttribute(Qt::AA_DontUseNativeMenuBar) && qobject_cast<QMenuBar *>(w))
visible = true;
#endif
@@ -204,7 +204,7 @@ static bool correctWidgetContext(Qt::ShortcutContext context, QWidget *w, QWidge
static bool correctGraphicsWidgetContext(Qt::ShortcutContext context, QGraphicsWidget *w, QWidget *active_window)
{
bool visible = w->isVisible();
-#ifdef Q_OS_MAC
+#if defined(Q_OS_DARWIN) && !defined(QT_NO_MENUBAR)
if (!qApp->testAttribute(Qt::AA_DontUseNativeMenuBar) && qobject_cast<QMenuBar *>(w))
visible = true;
#endif
@@ -272,7 +272,7 @@ static bool correctActionContext(Qt::ShortcutContext context, QAction *a, QWidge
QWidget *w = widgets.at(i);
#ifndef QT_NO_MENU
if (QMenu *menu = qobject_cast<QMenu *>(w)) {
-#ifdef Q_OS_MAC
+#ifdef Q_OS_DARWIN
// On Mac, menu item shortcuts are processed before reaching any window.
// That means that if a menu action shortcut has not been already processed
// (and reaches this point), then the menu item itself has been disabled.
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index d0971443ba..2e3d1cf9f8 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -9441,10 +9441,13 @@ void QWidget::tabletEvent(QTabletEvent *event)
void QWidget::keyPressEvent(QKeyEvent *event)
{
+#ifndef QT_NO_SHORTCUT
if ((windowType() == Qt::Popup) && event->matches(QKeySequence::Cancel)) {
event->accept();
close();
- } else {
+ } else
+#endif
+ {
event->ignore();
}
}
diff --git a/src/widgets/kernel/qwindowcontainer.cpp b/src/widgets/kernel/qwindowcontainer.cpp
index d7f4b1f989..bb25a3a986 100644
--- a/src/widgets/kernel/qwindowcontainer.cpp
+++ b/src/widgets/kernel/qwindowcontainer.cpp
@@ -97,11 +97,14 @@ public:
}
QWidget *p = q->parentWidget();
while (p) {
- if (
+ if (false
#ifndef QT_NO_MDIAREA
- qobject_cast<QMdiSubWindow *>(p) != 0 ||
+ || qobject_cast<QMdiSubWindow *>(p) != 0
#endif
- qobject_cast<QAbstractScrollArea *>(p) != 0) {
+#ifndef QT_NO_SCROLLAREA
+ || qobject_cast<QAbstractScrollArea *>(p) != 0
+#endif
+ ) {
q->winId();
usesNativeWidgets = true;
break;