diff options
author | Tor Arne Vestbø <tor.arne.vestbo@digia.com> | 2015-02-02 18:49:18 +0100 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com> | 2015-02-03 11:49:14 +0000 |
commit | c5db8fc74a9d437a4e7c0af077aed7c1f1bd4e26 (patch) | |
tree | f7d42e0be35dd0ed85e74eaecdbbad4f319bc1d1 /src/widgets/graphicsview | |
parent | 611bcc3cd337fe77ea5d3b898d897582da6f7ee2 (diff) |
Make it more obvious that Q_WS_ is dead code, and should perhaps be ported
We still have a bunch of Q_WS_ ifdefs in our code, which are easy to
mistake for Q_OS_ ifdefs when quickly scanning the code. By renaming
the ifdefs we make it clear that the code in question is dead.
In incremental follow-ups, we can then selectively either remove, or
port, the pieces that are dead code.
Change-Id: Ib5ef3e9e0662d321f179f3e25122cacafff0f41f
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'src/widgets/graphicsview')
-rw-r--r-- | src/widgets/graphicsview/qgraphicsitem.cpp | 2 | ||||
-rw-r--r-- | src/widgets/graphicsview/qgraphicsscene.cpp | 4 | ||||
-rw-r--r-- | src/widgets/graphicsview/qgraphicsview.cpp | 4 | ||||
-rw-r--r-- | src/widgets/graphicsview/qgraphicsview_p.h | 4 | ||||
-rw-r--r-- | src/widgets/graphicsview/qgraphicswidget.cpp | 2 | ||||
-rw-r--r-- | src/widgets/graphicsview/qgraphicswidget_p.cpp | 4 |
6 files changed, 10 insertions, 10 deletions
diff --git a/src/widgets/graphicsview/qgraphicsitem.cpp b/src/widgets/graphicsview/qgraphicsitem.cpp index 3e9294343e..c38785bcd6 100644 --- a/src/widgets/graphicsview/qgraphicsitem.cpp +++ b/src/widgets/graphicsview/qgraphicsitem.cpp @@ -7404,7 +7404,7 @@ void QGraphicsItem::setInputMethodHints(Qt::InputMethodHints hints) */ void QGraphicsItem::updateMicroFocus() { -#if !defined(QT_NO_IM) && defined(Q_WS_X11) +#if !defined(QT_NO_IM) && defined(Q_DEAD_CODE_FROM_QT4_X11) if (QWidget *fw = QApplication::focusWidget()) { if (scene()) { for (int i = 0 ; i < scene()->views().count() ; ++i) { diff --git a/src/widgets/graphicsview/qgraphicsscene.cpp b/src/widgets/graphicsview/qgraphicsscene.cpp index aa42445b2a..44e39e5ef7 100644 --- a/src/widgets/graphicsview/qgraphicsscene.cpp +++ b/src/widgets/graphicsview/qgraphicsscene.cpp @@ -4136,7 +4136,7 @@ void QGraphicsScene::wheelEvent(QGraphicsSceneWheelEvent *wheelEvent) wheelEvent->scenePos(), wheelEvent->widget()); -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC // On Mac, ignore the event if the first item under the mouse is not the last opened // popup (or one of its descendant) if (!d->popupWidgets.isEmpty() && !wheelCandidates.isEmpty() && wheelCandidates.first() != d->popupWidgets.back() && !d->popupWidgets.back()->isAncestorOf(wheelCandidates.first())) { @@ -4375,7 +4375,7 @@ void QGraphicsScenePrivate::drawItemHelper(QGraphicsItem *item, QPainter *painte // Render directly, using no cache. if (cacheMode == QGraphicsItem::NoCache -#ifdef Q_WS_X11 +#ifdef Q_DEAD_CODE_FROM_QT4_X11 || !X11->use_xrender #endif ) { diff --git a/src/widgets/graphicsview/qgraphicsview.cpp b/src/widgets/graphicsview/qgraphicsview.cpp index b92655013e..ef4218bf86 100644 --- a/src/widgets/graphicsview/qgraphicsview.cpp +++ b/src/widgets/graphicsview/qgraphicsview.cpp @@ -3484,7 +3484,7 @@ void QGraphicsView::paintEvent(QPaintEvent *event) // Draw background if ((d->cacheMode & CacheBackground) -#ifdef Q_WS_X11 +#ifdef Q_DEAD_CODE_FROM_QT4_X11 && X11->use_xrender #endif ) { @@ -3683,7 +3683,7 @@ void QGraphicsView::scrollContentsBy(int dx, int dy) d->updateLastCenterPoint(); if ((d->cacheMode & CacheBackground) -#ifdef Q_WS_X11 +#ifdef Q_DEAD_CODE_FROM_QT4_X11 && X11->use_xrender #endif ) { diff --git a/src/widgets/graphicsview/qgraphicsview_p.h b/src/widgets/graphicsview/qgraphicsview_p.h index 546f34ba81..836cb6d435 100644 --- a/src/widgets/graphicsview/qgraphicsview_p.h +++ b/src/widgets/graphicsview/qgraphicsview_p.h @@ -176,7 +176,7 @@ public: inline void dispatchPendingUpdateRequests() { -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC // QWidget::update() works slightly different on the Mac without the raster engine; // it's not part of our backing store so it needs special threatment. if (QApplicationPrivate::graphics_system_name != QLatin1String("raster")) { @@ -187,7 +187,7 @@ public: extern void qt_mac_dispatchPendingUpdateRequests(QWidget *); qt_mac_dispatchPendingUpdateRequests(viewport->window()); } else -#endif // !Q_WS_MAC +#endif // !Q_DEAD_CODE_FROM_QT4_MAC { if (qt_widget_private(viewport)->paintOnScreen()) QCoreApplication::sendPostedEvents(viewport, QEvent::UpdateRequest); diff --git a/src/widgets/graphicsview/qgraphicswidget.cpp b/src/widgets/graphicsview/qgraphicswidget.cpp index fd4f66e3a8..87b4b2b5a8 100644 --- a/src/widgets/graphicsview/qgraphicswidget.cpp +++ b/src/widgets/graphicsview/qgraphicswidget.cpp @@ -694,7 +694,7 @@ void QGraphicsWidget::initStyleOption(QStyleOption *option) const option->state |= QStyle::State_Window; /* ### -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC extern bool qt_mac_can_clickThrough(const QGraphicsWidget *w); //qwidget_mac.cpp if (!(option->state & QStyle::State_Active) && !qt_mac_can_clickThrough(widget)) option->state &= ~QStyle::State_Enabled; diff --git a/src/widgets/graphicsview/qgraphicswidget_p.cpp b/src/widgets/graphicsview/qgraphicswidget_p.cpp index fa369463f7..b9d9745faa 100644 --- a/src/widgets/graphicsview/qgraphicswidget_p.cpp +++ b/src/widgets/graphicsview/qgraphicswidget_p.cpp @@ -46,7 +46,7 @@ #include <QtWidgets/qstyleoption.h> #include <QtWidgets/QStyleOptionTitleBar> #include <QtWidgets/QGraphicsSceneMouseEvent> -#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC) +#if defined(Q_DEAD_CODE_FROM_QT4_MAC) && !defined(QT_NO_STYLE_MAC) # include <private/qmacstyle_mac_p.h> #endif @@ -682,7 +682,7 @@ void QGraphicsWidgetPrivate::windowFrameHoverMoveEvent(QGraphicsSceneHoverEvent case Qt::TitleBarArea: windowData->buttonRect = q->style()->subControlRect( QStyle::CC_TitleBar, &bar, QStyle::SC_TitleBarCloseButton, 0); -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC // On mac we should hover if we are in the 'area' of the buttons windowData->buttonRect |= q->style()->subControlRect( QStyle::CC_TitleBar, &bar, QStyle::SC_TitleBarMinButton, 0); |