summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/kernel/qevent.cpp2
-rw-r--r--src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp2
-rw-r--r--src/plugins/platforms/xcb/qxcbkeyboard.cpp2
-rw-r--r--src/widgets/dialogs/qmessagebox.cpp6
-rw-r--r--src/widgets/kernel/qwidgetwindow.cpp8
-rw-r--r--src/widgets/util/qsystemtrayicon_x11.cpp4
-rw-r--r--src/widgets/widgets/qcombobox.h2
-rw-r--r--src/widgets/widgets/qlabel.cpp6
-rw-r--r--src/widgets/widgets/qlabel.h2
-rw-r--r--src/widgets/widgets/qtextedit.cpp2
10 files changed, 25 insertions, 11 deletions
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp
index 3873976144..c7df6107f7 100644
--- a/src/gui/kernel/qevent.cpp
+++ b/src/gui/kernel/qevent.cpp
@@ -3940,9 +3940,11 @@ QDebug operator<<(QDebug dbg, const QEvent *e)
QtDebugUtils::formatQEnum(dbg, static_cast<const QApplicationStateChangeEvent *>(e)->applicationState());
dbg << ')';
break;
+# ifndef QT_NO_CONTEXTMENU
case QEvent::ContextMenu:
dbg << "QContextMenuEvent(" << static_cast<const QContextMenuEvent *>(e)->pos() << ')';
break;
+# endif // !QT_NO_CONTEXTMENU
# ifndef QT_NO_TABLETEVENT
case QEvent::TabletEnterProximity:
case QEvent::TabletLeaveProximity:
diff --git a/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp b/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp
index 4a276dc834..2027e010d0 100644
--- a/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp
+++ b/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp
@@ -366,6 +366,7 @@ void QIBusPlatformInputContext::filterEventFinished(QDBusPendingCallWatcher *cal
bool retval = reply.value();
qCDebug(qtQpaInputMethods) << "filterEventFinished return" << code << sym << state << retval;
if (!retval) {
+#ifndef QT_NO_CONTEXTMENU
QWindow *window = dynamic_cast<QWindow *>(input);
if (type == QEvent::KeyPress && qtcode == Qt::Key_Menu
&& window != NULL) {
@@ -374,6 +375,7 @@ void QIBusPlatformInputContext::filterEventFinished(QDBusPendingCallWatcher *cal
QWindowSystemInterface::handleContextMenuEvent(window, false, pos,
globalPos, modifiers);
}
+#endif // QT_NO_CONTEXTMENU
QKeyEvent event(type, qtcode, modifiers, code, sym,
state, string, isAutoRepeat, count);
event.setTimestamp(time);
diff --git a/src/plugins/platforms/xcb/qxcbkeyboard.cpp b/src/plugins/platforms/xcb/qxcbkeyboard.cpp
index 2e088d3ca5..0bfefc962e 100644
--- a/src/plugins/platforms/xcb/qxcbkeyboard.cpp
+++ b/src/plugins/platforms/xcb/qxcbkeyboard.cpp
@@ -1511,11 +1511,13 @@ void QXcbKeyboard::handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type,
QWindow *window = targetWindow->window();
if (!filtered) {
+#ifndef QT_NO_CONTEXTMENU
if (type == QEvent::KeyPress && qtcode == Qt::Key_Menu) {
const QPoint globalPos = window->screen()->handle()->cursor()->pos();
const QPoint pos = window->mapFromGlobal(globalPos);
QWindowSystemInterface::handleContextMenuEvent(window, false, pos, globalPos, modifiers);
}
+#endif // QT_NO_CONTEXTMENU
QWindowSystemInterface::handleExtendedKeyEvent(window, time, type, qtcode, modifiers,
code, sym, state, string, isAutoRepeat);
}
diff --git a/src/widgets/dialogs/qmessagebox.cpp b/src/widgets/dialogs/qmessagebox.cpp
index ef9b55acd6..66e506bd80 100644
--- a/src/widgets/dialogs/qmessagebox.cpp
+++ b/src/widgets/dialogs/qmessagebox.cpp
@@ -89,16 +89,14 @@ public:
{
public:
TextEdit(QWidget *parent=0) : QTextEdit(parent) { }
+#ifndef QT_NO_CONTEXTMENU
void contextMenuEvent(QContextMenuEvent * e) Q_DECL_OVERRIDE
{
-#ifndef QT_NO_CONTEXTMENU
QMenu *menu = createStandardContextMenu();
menu->setAttribute(Qt::WA_DeleteOnClose);
menu->popup(e->globalPos());
-#else
- Q_UNUSED(e);
-#endif
}
+#endif // QT_NO_CONTEXTMENU
};
QMessageBoxDetailsText(QWidget *parent=0)
diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp
index 58436a7d92..f1e25d116d 100644
--- a/src/widgets/kernel/qwidgetwindow.cpp
+++ b/src/widgets/kernel/qwidgetwindow.cpp
@@ -283,7 +283,7 @@ bool QWidgetWindow::event(QEvent *event)
case QEvent::ContextMenu:
handleContextMenuEvent(static_cast<QContextMenuEvent *>(event));
return true;
-#endif
+#endif // QT_NO_CONTEXTMENU
// Handing show events to widgets (see below) here would cause them to be triggered twice
case QEvent::Show:
@@ -510,8 +510,12 @@ void QWidgetWindow::handleMouseEvent(QMouseEvent *event)
popupEvent = popupChild;
QContextMenuEvent e(QContextMenuEvent::Mouse, mapped, event->globalPos(), event->modifiers());
QApplication::sendSpontaneousEvent(popupEvent, &e);
-#endif
}
+#else
+ Q_UNUSED(contextMenuTrigger)
+ Q_UNUSED(oldOpenPopupCount)
+ }
+#endif
if (releaseAfter) {
qt_button_down = 0;
diff --git a/src/widgets/util/qsystemtrayicon_x11.cpp b/src/widgets/util/qsystemtrayicon_x11.cpp
index 9a69db1bc8..e50b0bd12c 100644
--- a/src/widgets/util/qsystemtrayicon_x11.cpp
+++ b/src/widgets/util/qsystemtrayicon_x11.cpp
@@ -170,7 +170,9 @@ void QSystemTrayIconSys::mousePressEvent(QMouseEvent *ev)
#ifndef QT_NO_CONTEXTMENU
if (ev->button() == Qt::RightButton && q->contextMenu())
q->contextMenu()->popup(globalPos);
-#endif
+#else
+ Q_UNUSED(globalPos)
+#endif // QT_NO_CONTEXTMENU
if (QBalloonTip::isBalloonVisible()) {
emit q->messageClicked();
diff --git a/src/widgets/widgets/qcombobox.h b/src/widgets/widgets/qcombobox.h
index 3182a0a3aa..45b601788f 100644
--- a/src/widgets/widgets/qcombobox.h
+++ b/src/widgets/widgets/qcombobox.h
@@ -229,7 +229,9 @@ protected:
#ifndef QT_NO_WHEELEVENT
void wheelEvent(QWheelEvent *e) Q_DECL_OVERRIDE;
#endif
+#ifndef QT_NO_CONTEXTMENU
void contextMenuEvent(QContextMenuEvent *e) Q_DECL_OVERRIDE;
+#endif // QT_NO_CONTEXTMENU
void inputMethodEvent(QInputMethodEvent *) Q_DECL_OVERRIDE;
void initStyleOption(QStyleOptionComboBox *option) const;
diff --git a/src/widgets/widgets/qlabel.cpp b/src/widgets/widgets/qlabel.cpp
index 55e277026c..eeabd5db38 100644
--- a/src/widgets/widgets/qlabel.cpp
+++ b/src/widgets/widgets/qlabel.cpp
@@ -882,13 +882,11 @@ void QLabel::mouseReleaseEvent(QMouseEvent *ev)
d->sendControlEvent(ev);
}
+#ifndef QT_NO_CONTEXTMENU
/*!\reimp
*/
void QLabel::contextMenuEvent(QContextMenuEvent *ev)
{
-#ifdef QT_NO_CONTEXTMENU
- Q_UNUSED(ev);
-#else
Q_D(QLabel);
if (!d->isTextLabel) {
ev->ignore();
@@ -902,8 +900,8 @@ void QLabel::contextMenuEvent(QContextMenuEvent *ev)
ev->accept();
menu->setAttribute(Qt::WA_DeleteOnClose);
menu->popup(ev->globalPos());
-#endif
}
+#endif // QT_NO_CONTEXTMENU
/*!
\reimp
diff --git a/src/widgets/widgets/qlabel.h b/src/widgets/widgets/qlabel.h
index 1a3a68db60..6b6e15e0a8 100644
--- a/src/widgets/widgets/qlabel.h
+++ b/src/widgets/widgets/qlabel.h
@@ -132,7 +132,9 @@ protected:
void mousePressEvent(QMouseEvent *ev) Q_DECL_OVERRIDE;
void mouseMoveEvent(QMouseEvent *ev) Q_DECL_OVERRIDE;
void mouseReleaseEvent(QMouseEvent *ev) Q_DECL_OVERRIDE;
+#ifndef QT_NO_CONTEXTMENU
void contextMenuEvent(QContextMenuEvent *ev) Q_DECL_OVERRIDE;
+#endif // QT_NO_CONTEXTMENU
void focusInEvent(QFocusEvent *ev) Q_DECL_OVERRIDE;
void focusOutEvent(QFocusEvent *ev) Q_DECL_OVERRIDE;
bool focusNextPrevChild(bool next) Q_DECL_OVERRIDE;
diff --git a/src/widgets/widgets/qtextedit.cpp b/src/widgets/widgets/qtextedit.cpp
index 7439005b92..ba6db2971a 100644
--- a/src/widgets/widgets/qtextedit.cpp
+++ b/src/widgets/widgets/qtextedit.cpp
@@ -1060,6 +1060,8 @@ bool QTextEdit::event(QEvent *e)
|| e->type() == QEvent::ToolTip) {
d->sendControlEvent(e);
}
+#else
+ Q_UNUSED(d)
#endif // QT_NO_CONTEXTMENU
#ifdef QT_KEYPAD_NAVIGATION
if (e->type() == QEvent::EnterEditFocus || e->type() == QEvent::LeaveEditFocus) {