summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel/qapplication.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/kernel/qapplication.cpp')
-rw-r--r--src/widgets/kernel/qapplication.cpp34
1 files changed, 18 insertions, 16 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index d2f4161297..26e9ffbbf0 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -47,7 +47,10 @@
#include "qevent.h"
#include "qfile.h"
#include "qfileinfo.h"
+#if QT_CONFIG(graphicsview)
#include "qgraphicsscene.h"
+#include <QtWidgets/qgraphicsproxywidget.h>
+#endif
#include "qhash.h"
#include "qset.h"
#include "qlayout.h"
@@ -70,7 +73,6 @@
#include "qmessagebox.h"
#endif
#include "qwidgetwindow_p.h"
-#include <QtWidgets/qgraphicsproxywidget.h>
#include <QtGui/qstylehints.h>
#include <QtGui/qinputmethod.h>
#include <QtGui/private/qwindow_p.h>
@@ -1443,13 +1445,13 @@ void QApplicationPrivate::setPalette_helper(const QPalette &palette, const char*
}
// Send to all scenes as well.
-#ifndef QT_NO_GRAPHICSVIEW
+#if QT_CONFIG(graphicsview)
QList<QGraphicsScene *> &scenes = qApp->d_func()->scene_list;
for (QList<QGraphicsScene *>::ConstIterator it = scenes.constBegin();
it != scenes.constEnd(); ++it) {
QApplication::sendEvent(*it, &e);
}
-#endif //QT_NO_GRAPHICSVIEW
+#endif // QT_CONFIG(graphicsview)
}
if (!className && (!QApplicationPrivate::sys_pal || !palette.isCopyOf(*QApplicationPrivate::sys_pal))) {
if (!QApplicationPrivate::set_pal)
@@ -1627,14 +1629,14 @@ void QApplication::setFont(const QFont &font, const char *className)
sendEvent(w, &e);
}
-#ifndef QT_NO_GRAPHICSVIEW
+#if QT_CONFIG(graphicsview)
// Send to all scenes as well.
QList<QGraphicsScene *> &scenes = qApp->d_func()->scene_list;
for (QList<QGraphicsScene *>::ConstIterator it = scenes.constBegin();
it != scenes.constEnd(); ++it) {
QApplication::sendEvent(*it, &e);
}
-#endif //QT_NO_GRAPHICSVIEW
+#endif // QT_CONFIG(graphicsview)
}
if (!className && (!QApplicationPrivate::sys_font || !font.isCopyOf(*QApplicationPrivate::sys_font))) {
if (!QApplicationPrivate::set_font)
@@ -1769,7 +1771,7 @@ QWidget *QApplication::focusWidget()
void QApplicationPrivate::setFocusWidget(QWidget *focus, Qt::FocusReason reason)
{
-#ifndef QT_NO_GRAPHICSVIEW
+#if QT_CONFIG(graphicsview)
if (focus && focus->window()->graphicsProxyWidget())
return;
#endif
@@ -2076,7 +2078,7 @@ void QApplication::setActiveWindow(QWidget* act)
if (QApplicationPrivate::active_window == window)
return;
-#ifndef QT_NO_GRAPHICSVIEW
+#if QT_CONFIG(graphicsview)
if (window && window->graphicsProxyWidget()) {
// Activate the proxy's view->viewport() ?
return;
@@ -2386,7 +2388,7 @@ void QApplicationPrivate::dispatchEnterLeave(QWidget* enter, QWidget* leave, con
//check that we will not call qt_x11_enforce_cursor twice with the same native widget
if (parentOfLeavingCursor && (!enterOnAlien
|| parentOfLeavingCursor->effectiveWinId() != enter->effectiveWinId())) {
-#ifndef QT_NO_GRAPHICSVIEW
+#if QT_CONFIG(graphicsview)
if (!parentOfLeavingCursor->window()->graphicsProxyWidget())
#endif
{
@@ -2405,7 +2407,7 @@ void QApplicationPrivate::dispatchEnterLeave(QWidget* enter, QWidget* leave, con
if (!cursorWidget)
return;
-#ifndef QT_NO_GRAPHICSVIEW
+#if QT_CONFIG(graphicsview)
if (cursorWidget->window()->graphicsProxyWidget()) {
QWidgetPrivate::nearestGraphicsProxyWidget(cursorWidget)->setCursor(cursorWidget->cursor());
} else
@@ -3096,7 +3098,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
case QEvent::KeyRelease:
{
bool isWidget = receiver->isWidgetType();
-#ifndef QT_NO_GRAPHICSVIEW
+#if QT_CONFIG(graphicsview)
const bool isGraphicsWidget = !isWidget && qobject_cast<QGraphicsWidget *>(receiver);
#endif
QKeyEvent* key = static_cast<QKeyEvent*>(e);
@@ -3108,7 +3110,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
else
key->ignore();
QWidget *w = isWidget ? static_cast<QWidget *>(receiver) : 0;
-#ifndef QT_NO_GRAPHICSVIEW
+#if QT_CONFIG(graphicsview)
QGraphicsWidget *gw = isGraphicsWidget ? static_cast<QGraphicsWidget *>(receiver) : 0;
#endif
res = d->notify_helper(receiver, e);
@@ -3128,14 +3130,14 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
*/
|| !pr
|| (isWidget && (w->isWindow() || !w->parentWidget()))
-#ifndef QT_NO_GRAPHICSVIEW
+#if QT_CONFIG(graphicsview)
|| (isGraphicsWidget && (gw->isWindow() || !gw->parentWidget()))
#endif
) {
break;
}
-#ifndef QT_NO_GRAPHICSVIEW
+#if QT_CONFIG(graphicsview)
receiver = w ? (QObject *)w->parentWidget() : (QObject *)gw->parentWidget();
#else
receiver = w->parentWidget();
@@ -3428,7 +3430,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
case QEvent::DragEnter: {
QWidget* w = static_cast<QWidget *>(receiver);
QDragEnterEvent *dragEvent = static_cast<QDragEnterEvent *>(e);
-#ifndef QT_NO_GRAPHICSVIEW
+#if QT_CONFIG(graphicsview)
// QGraphicsProxyWidget handles its own propagation,
// and we must not change QDragManagers currentTarget.
QWExtra *extra = w->window()->d_func()->extra;
@@ -3456,7 +3458,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
case QEvent::Drop:
case QEvent::DragLeave: {
QWidget* w = static_cast<QWidget *>(receiver);
-#ifndef QT_NO_GRAPHICSVIEW
+#if QT_CONFIG(graphicsview)
// QGraphicsProxyWidget handles its own propagation,
// and we must not change QDragManagers currentTarget.
QWExtra *extra = w->window()->d_func()->extra;
@@ -3478,7 +3480,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
}
res = d->notify_helper(w, e);
if (e->type() != QEvent::DragMove
-#ifndef QT_NO_GRAPHICSVIEW
+#if QT_CONFIG(graphicsview)
&& !isProxyWidget
#endif
)