summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorShrikant Dhumal <teck.shri@gmail.com>2015-09-03 20:07:27 -0700
committerShrikant Dhumal <teck.shri@gmail.com>2015-09-09 07:33:58 +0000
commit924d4aefd5315c11d0637e2ba1a6b02246e89c44 (patch)
tree1d23be8b8b86955ec21130f847a0bc92b14d44fa /src/widgets
parent933e3e886fe51cc1feb542615b4700294182cc47 (diff)
Fixed build breaks that result after disabling "contextmenu" feature
Change-Id: I261f927ee720e0c65abd18417e1ac48dbee820df Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
Diffstat (limited to 'src/widgets')
-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
7 files changed, 19 insertions, 11 deletions
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) {