summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2016-02-05 14:03:39 +0100
committerFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2016-02-05 13:42:21 +0000
commitc4a53f647f4ba7cb6898a38fd1056f81fdcfe371 (patch)
tree14a608527870e7043594ed9a6ad698a5a46e2fb7
parentce29de5c33f9addd22ffa44d575b4b044598b18b (diff)
QtWidgets: Fix build & warnings with QT_NO_GRAPHICSVIEW.
kernel\qapplication.cpp(3157,18) : warning: unused variable 'isGraphicsWidget' [-Wunused-variable] bool isGraphicsWidget = false; ^ kernel\qwidget.cpp(6446,18) : warning: unused variable 'window' [-Wunused-variable] if (QWidget *window = w->window()) { ^ kernel\qwidget.cpp(7949,50) : error: no member named 'proxyWidget' in 'QWExtra' if ((q->isWindow() && (!extra || !extra->proxyWidget)) ~~~~~ ^ kernel\qwidget.cpp(8084,50) : error: no member named 'proxyWidget' in 'QWExtra' if ((q->isWindow() && (!extra || !extra->proxyWidget)) Change-Id: I8474ab0ab4617c6588707ce0c2f7a97e4d0e54da Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
-rw-r--r--src/widgets/kernel/qapplication.cpp3
-rw-r--r--src/widgets/kernel/qwidget.cpp18
2 files changed, 13 insertions, 8 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index 91302d9e62..3ab477ccfb 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -3161,9 +3161,8 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
case QEvent::KeyRelease:
{
bool isWidget = receiver->isWidgetType();
- bool isGraphicsWidget = false;
#ifndef QT_NO_GRAPHICSVIEW
- isGraphicsWidget = !isWidget && qobject_cast<QGraphicsWidget *>(receiver);
+ const bool isGraphicsWidget = !isWidget && qobject_cast<QGraphicsWidget *>(receiver);
#endif
QKeyEvent* key = static_cast<QKeyEvent*>(e);
bool def = key->isAccepted();
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 5bff30524a..58bda5cfb2 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -6415,13 +6415,13 @@ bool QWidget::hasFocus() const
const QWidget* w = this;
while (w->d_func()->extra && w->d_func()->extra->focus_proxy)
w = w->d_func()->extra->focus_proxy;
- if (QWidget *window = w->window()) {
#ifndef QT_NO_GRAPHICSVIEW
+ if (QWidget *window = w->window()) {
QWExtra *e = window->d_func()->extra;
if (e && e->proxyWidget && e->proxyWidget->hasFocus() && window->focusWidget() == w)
return true;
-#endif
}
+#endif // !QT_NO_GRAPHICSVIEW
return (QApplication::focusWidget() == w);
}
@@ -7918,8 +7918,11 @@ void QWidgetPrivate::show_sys()
invalidateBuffer(q->rect());
q->setAttribute(Qt::WA_Mapped);
// add our window the modal window list (native dialogs)
- if ((q->isWindow() && (!extra || !extra->proxyWidget))
- && q->windowModality() != Qt::NonModal && window) {
+ if (window && q->isWindow()
+#ifndef QT_NO_GRAPHICSVIEW
+ && (!extra || !extra->proxyWidget)
+#endif
+ && q->windowModality() != Qt::NonModal) {
QGuiApplicationPrivate::showModalWindow(window);
}
return;
@@ -8053,8 +8056,11 @@ void QWidgetPrivate::hide_sys()
if (q->testAttribute(Qt::WA_DontShowOnScreen)) {
q->setAttribute(Qt::WA_Mapped, false);
// remove our window from the modal window list (native dialogs)
- if ((q->isWindow() && (!extra || !extra->proxyWidget))
- && q->windowModality() != Qt::NonModal && window) {
+ if (window && q->isWindow()
+#ifndef QT_NO_GRAPHICSVIEW
+ && (!extra || !extra->proxyWidget)
+#endif
+ && q->windowModality() != Qt::NonModal) {
QGuiApplicationPrivate::hideModalWindow(window);
}
// do not return here, if window non-zero, we must hide it