summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2016-10-13 15:54:23 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2016-10-14 08:19:29 +0000
commit6a35e77ef3f4eae80ca49937c680836eb4acdbe6 (patch)
tree12462105731748d75d1fa1b7b45daf586b402413 /src/widgets/kernel
parentdcf7da7c93c0d974bfb72ffa677a1d26fb9be5e0 (diff)
Change confusing Q_DEAD_CODE_FROM_QT4_FOO define
Commit c5db8fc74 changed all instances of Q_WS_FOO to have the prefix Q_DEAD_CODE_FROM_QT4 instead, to make it clearer when reading the code that the code in question was a left-over from Qt4, when we used Q_WS_ defines instead of Q_OS_ defines. This worked well for cases of #ifdef Q_DEAD_CODE_FROM_QT4, but less so for cases of #ifndef Q_DEAD_CODE_FROM_QT4, where the code was actually unconditionally included. To make this even clearer, the defines have been replaced by checks for 1 or 0, with a comment describing how the code used to look in Qt4. The use of constants in the check also makes it easier for editors to parse the condition and show visually that the code is defined out. Change-Id: I152070d87334df7259b417cd5e17d7b7950379b7 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/widgets/kernel')
-rw-r--r--src/widgets/kernel/qapplication_p.h20
-rw-r--r--src/widgets/kernel/qgesturemanager.cpp4
-rw-r--r--src/widgets/kernel/qt_widgets_pch.h2
-rw-r--r--src/widgets/kernel/qtooltip.cpp16
-rw-r--r--src/widgets/kernel/qwhatsthis.cpp6
-rw-r--r--src/widgets/kernel/qwidget.cpp158
-rw-r--r--src/widgets/kernel/qwidget.h4
-rw-r--r--src/widgets/kernel/qwidget_p.h18
-rw-r--r--src/widgets/kernel/qwidgetbackingstore.cpp4
9 files changed, 116 insertions, 116 deletions
diff --git a/src/widgets/kernel/qapplication_p.h b/src/widgets/kernel/qapplication_p.h
index dd0edc7c80..3bef773187 100644
--- a/src/widgets/kernel/qapplication_p.h
+++ b/src/widgets/kernel/qapplication_p.h
@@ -118,7 +118,7 @@ public:
virtual bool shouldQuit() Q_DECL_OVERRIDE;
bool tryCloseAllWindows() Q_DECL_OVERRIDE;
-#if defined(Q_DEAD_CODE_FROM_QT4_X11)
+#if 0 // Used to be included in Qt4 for Q_WS_X11
#ifndef QT_NO_SETTINGS
static bool x11_apply_settings();
#endif
@@ -138,7 +138,7 @@ public:
static bool isBlockedByModal(QWidget *widget);
static bool modalState();
static bool tryModalHelper(QWidget *widget, QWidget **rettop = 0);
-#ifdef Q_DEAD_CODE_FROM_QT4_MAC
+#if 0 // Used to be included in Qt4 for Q_WS_MAC
static QWidget *tryModalHelper_sys(QWidget *top);
bool canQuit();
#endif
@@ -152,14 +152,14 @@ public:
bool notify_helper(QObject *receiver, QEvent * e);
void init(
-#ifdef Q_DEAD_CODE_FROM_QT4_X11
+#if 0 // Used to be included in Qt4 for Q_WS_X11
Display *dpy = 0, Qt::HANDLE visual = 0, Qt::HANDLE cmap = 0
#endif
);
void initialize();
void process_cmdline();
-#if defined(Q_DEAD_CODE_FROM_QT4_X11)
+#if 0 // Used to be included in Qt4 for Q_WS_X11
static void x11_initialize_style();
#endif
@@ -214,7 +214,7 @@ public:
static void initializeWidgetFontHash();
static void setSystemFont(const QFont &font);
-#if defined(Q_DEAD_CODE_FROM_QT4_X11)
+#if 0 // Used to be included in Qt4 for Q_WS_X11
static void applyX11SpecificCommandLineArguments(QWidget *main_widget);
#endif
@@ -225,7 +225,7 @@ public:
static Qt::NavigationMode navigationMode;
#endif
-#if defined(Q_DEAD_CODE_FROM_QT4_MAC) || defined(Q_DEAD_CODE_FROM_QT4_X11)
+#if 0 /* Used to be included in Qt4 for Q_WS_MAC */ || 0 /* Used to be included in Qt4 for Q_WS_X11 */
void _q_alertTimeOut();
QHash<QWidget *, QTimer *> alertTimerHash;
#endif
@@ -265,12 +265,12 @@ public:
QGestureManager *gestureManager;
QWidget *gestureWidget;
#endif
-#if defined(Q_DEAD_CODE_FROM_QT4_X11) || defined(Q_DEAD_CODE_FROM_QT4_WIN)
+#if 0 /* Used to be included in Qt4 for Q_WS_X11 */ || 0 /* Used to be included in Qt4 for Q_WS_WIN */
QPixmap *move_cursor;
QPixmap *copy_cursor;
QPixmap *link_cursor;
#endif
-#if defined(Q_DEAD_CODE_FROM_QT4_WIN)
+#if 0 // Used to be included in Qt4 for Q_WS_WIN
QPixmap *ignore_cursor;
#endif
@@ -301,9 +301,9 @@ private:
static bool isAlien(QWidget *);
};
-#if defined(Q_DEAD_CODE_FROM_QT4_WIN)
+#if 0 // Used to be included in Qt4 for Q_WS_WIN
extern void qt_win_set_cursor(QWidget *, bool);
-#elif defined(Q_DEAD_CODE_FROM_QT4_X11)
+#elif 0 // Used to be included in Qt4 for Q_WS_X11
extern void qt_x11_enforce_cursor(QWidget *, bool);
extern void qt_x11_enforce_cursor(QWidget *);
#else
diff --git a/src/widgets/kernel/qgesturemanager.cpp b/src/widgets/kernel/qgesturemanager.cpp
index c901285d1a..2e5c2c53bd 100644
--- a/src/widgets/kernel/qgesturemanager.cpp
+++ b/src/widgets/kernel/qgesturemanager.cpp
@@ -52,7 +52,7 @@
#ifdef Q_OS_OSX
#include "qmacgesturerecognizer_p.h"
#endif
-#if defined(Q_DEAD_CODE_FROM_QT4_WIN) && !defined(QT_NO_NATIVE_GESTURES)
+#if 0 /* Used to be included in Qt4 for Q_WS_WIN */ && !defined(QT_NO_NATIVE_GESTURES)
#include "qwinnativepangesturerecognizer_win_p.h"
#endif
@@ -100,7 +100,7 @@ QGestureManager::QGestureManager(QObject *parent)
registerGestureRecognizer(new QSwipeGestureRecognizer);
registerGestureRecognizer(new QTapGestureRecognizer);
#endif
-#if defined(Q_DEAD_CODE_FROM_QT4_WIN)
+#if 0 // Used to be included in Qt4 for Q_WS_WIN
#if !defined(QT_NO_NATIVE_GESTURES)
if (QApplicationPrivate::HasTouchSupport)
registerGestureRecognizer(new QWinNativePanGestureRecognizer);
diff --git a/src/widgets/kernel/qt_widgets_pch.h b/src/widgets/kernel/qt_widgets_pch.h
index f30202d89e..924a68d62e 100644
--- a/src/widgets/kernel/qt_widgets_pch.h
+++ b/src/widgets/kernel/qt_widgets_pch.h
@@ -50,7 +50,7 @@
#include <qtwidgetsglobal.h>
-#ifdef Q_DEAD_CODE_FROM_QT4_WIN
+#if 0 // Used to be included in Qt4 for Q_WS_WIN
# define _POSIX_
# include <limits.h>
# undef _POSIX_
diff --git a/src/widgets/kernel/qtooltip.cpp b/src/widgets/kernel/qtooltip.cpp
index 78929d8cd5..a92dc2cbf7 100644
--- a/src/widgets/kernel/qtooltip.cpp
+++ b/src/widgets/kernel/qtooltip.cpp
@@ -36,7 +36,7 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#ifdef Q_DEAD_CODE_FROM_QT4_MAC
+#if 0 // Used to be included in Qt4 for Q_WS_MAC
# include <private/qcore_mac_p.h>
#endif
@@ -56,7 +56,7 @@
#include <private/qstylesheetstyle_p.h>
#ifndef QT_NO_TOOLTIP
-#ifdef Q_DEAD_CODE_FROM_QT4_MAC
+#if 0 // Used to be included in Qt4 for Q_WS_MAC
# include <private/qcore_mac_p.h>
#include <private/qt_cocoa_helpers_mac_p.h>
#endif
@@ -284,7 +284,7 @@ void QTipLabel::timerEvent(QTimerEvent *e)
|| e->timerId() == expireTimer.timerId()){
hideTimer.stop();
expireTimer.stop();
-#if defined(Q_DEAD_CODE_FROM_QT4_MAC) && !defined(QT_NO_EFFECTS)
+#if 0 /* Used to be included in Qt4 for Q_WS_MAC */ && !defined(QT_NO_EFFECTS)
if (QApplication::isEffectEnabled(Qt::UI_FadeTooltip)){
// Fade out tip on mac (makes it invisible).
// The tip will not be deleted until a new tip is shown.
@@ -304,7 +304,7 @@ void QTipLabel::timerEvent(QTimerEvent *e)
bool QTipLabel::eventFilter(QObject *o, QEvent *e)
{
switch (e->type()) {
-#ifdef Q_DEAD_CODE_FROM_QT4_MAC
+#if 0 // Used to be included in Qt4 for Q_WS_MAC
case QEvent::KeyPress:
case QEvent::KeyRelease: {
int key = static_cast<QKeyEvent *>(e)->key();
@@ -386,7 +386,7 @@ void QTipLabel::placeTip(const QPoint &pos, QWidget *w)
#endif //QT_NO_STYLE_STYLESHEET
-#ifdef Q_DEAD_CODE_FROM_QT4_MAC
+#if 0 // Used to be included in Qt4 for Q_WS_MAC
// When in full screen mode, there is no Dock nor Menu so we can use
// the whole screen for displaying the tooltip. However when not in
// full screen mode we need to save space for the dock, so we use
@@ -403,7 +403,7 @@ void QTipLabel::placeTip(const QPoint &pos, QWidget *w)
QPoint p = pos;
p += QPoint(2,
-#ifdef Q_DEAD_CODE_FROM_QT4_WIN
+#if 0 // Used to be included in Qt4 for Q_WS_WIN
21
#else
16
@@ -492,7 +492,7 @@ void QToolTip::showText(const QPoint &pos, const QString &text, QWidget *w, cons
}
if (!text.isEmpty()){ // no tip can be reused, create new tip:
-#ifndef Q_DEAD_CODE_FROM_QT4_WIN
+#if 1 // Used to be excluded in Qt4 for Q_WS_WIN
new QTipLabel(text, w, msecDisplayTime); // sets QTipLabel::instance to itself
#else
// On windows, we can't use the widget as parent otherwise the window will be
@@ -504,7 +504,7 @@ void QToolTip::showText(const QPoint &pos, const QString &text, QWidget *w, cons
QTipLabel::instance->setObjectName(QLatin1String("qtooltip_label"));
-#if !defined(QT_NO_EFFECTS) && !defined(Q_DEAD_CODE_FROM_QT4_MAC)
+#if !defined(QT_NO_EFFECTS) && !0 /* Used to be included in Qt4 for Q_WS_MAC */
if (QApplication::isEffectEnabled(Qt::UI_FadeTooltip))
qFadeEffect(QTipLabel::instance);
else if (QApplication::isEffectEnabled(Qt::UI_AnimateTooltip))
diff --git a/src/widgets/kernel/qwhatsthis.cpp b/src/widgets/kernel/qwhatsthis.cpp
index 32fe5f5e64..6061af5f38 100644
--- a/src/widgets/kernel/qwhatsthis.cpp
+++ b/src/widgets/kernel/qwhatsthis.cpp
@@ -570,7 +570,7 @@ void QWhatsThisPrivate::say(QWidget * widget, const QString &text, int x, int y)
// make a fresh widget, and set it up
QWhatsThat *whatsThat = new QWhatsThat(
text,
-#if defined(Q_DEAD_CODE_FROM_QT4_X11) && !defined(QT_NO_CURSOR)
+#if 0 /* Used to be included in Qt4 for Q_WS_X11 */ && !defined(QT_NO_CURSOR)
QApplication::desktop()->screen(widget ? widget->x11Info().screen() : QCursor::x11Screen()),
#else
0,
@@ -583,11 +583,11 @@ void QWhatsThisPrivate::say(QWidget * widget, const QString &text, int x, int y)
int scr = (widget ?
QApplication::desktop()->screenNumber(widget) :
-#if defined(Q_DEAD_CODE_FROM_QT4_X11) && !defined(QT_NO_CURSOR)
+#if 0 /* Used to be included in Qt4 for Q_WS_X11 */ && !defined(QT_NO_CURSOR)
QCursor::x11Screen()
#else
QApplication::desktop()->screenNumber(QPoint(x,y))
-#endif // Q_DEAD_CODE_FROM_QT4_X11
+#endif
);
QRect screen = QApplication::desktop()->screenGeometry(scr);
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 51e1ef9aaf..cf52a21716 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -59,7 +59,7 @@
#ifndef QT_NO_ACCESSIBILITY
# include "qaccessible.h"
#endif
-#ifdef Q_DEAD_CODE_FROM_QT4_MAC
+#if 0 // Used to be included in Qt4 for Q_WS_MAC
# include "qt_mac_p.h"
# include "qt_cocoa_helpers_mac_p.h"
# include "qmainwindow.h"
@@ -85,7 +85,7 @@
#include <private/qgraphicseffect_p.h>
#include <qbackingstore.h>
#include <private/qwidgetbackingstore_p.h>
-#ifdef Q_DEAD_CODE_FROM_QT4_MAC
+#if 0 // Used to be included in Qt4 for Q_WS_MAC
# include <private/qpaintengine_mac_p.h>
#endif
#include <private/qpaintengine_raster_p.h>
@@ -118,7 +118,7 @@
QT_BEGIN_NAMESPACE
static bool qt_enable_backingstore = true;
-#ifdef Q_DEAD_CODE_FROM_QT4_X11
+#if 0 // Used to be included in Qt4 for Q_WS_X11
// for compatibility with Qt 4.0
Q_WIDGETS_EXPORT void qt_x11_set_global_double_buffer(bool enable)
{
@@ -126,7 +126,7 @@ Q_WIDGETS_EXPORT void qt_x11_set_global_double_buffer(bool enable)
}
#endif
-#ifdef Q_DEAD_CODE_FROM_QT4_MAC
+#if 0 // Used to be included in Qt4 for Q_WS_MAC
bool qt_mac_clearDirtyOnWidgetInsideDrawWidget = false;
#endif
@@ -141,7 +141,7 @@ static inline bool hasBackingStoreSupport()
return true;
}
-#ifdef Q_DEAD_CODE_FROM_QT4_MAC
+#if 0 // Used to be included in Qt4 for Q_WS_MAC
# define QT_NO_PAINT_DEBUG
#endif
@@ -288,13 +288,13 @@ QWidgetPrivate::QWidgetPrivate(int version)
#if defined(Q_OS_WIN)
, noPaintOnScreen(0)
#endif
-#if defined(Q_DEAD_CODE_FROM_QT4_X11)
+#if 0 // Used to be included in Qt4 for Q_WS_X11
, picture(0)
-#elif defined(Q_DEAD_CODE_FROM_QT4_WIN)
+#elif 0 // Used to be included in Qt4 for Q_WS_WIN
#ifndef QT_NO_GESTURES
, nativeGesturePanEnabled(0)
#endif
-#elif defined(Q_DEAD_CODE_FROM_QT4_MAC)
+#elif 0 // Used to be included in Qt4 for Q_WS_MAC
, needWindowChange(0)
, window_event(0)
, qd_hd(0)
@@ -317,7 +317,7 @@ QWidgetPrivate::QWidgetPrivate(int version)
isWidget = true;
memset(high_attributes, 0, sizeof(high_attributes));
-#ifdef Q_DEAD_CODE_FROM_QT4_MAC
+#if 0 // Used to be included in Qt4 for Q_WS_MAC
drawRectOriginalAdded = false;
originalDrawMethod = true;
changeMethods = false;
@@ -326,7 +326,7 @@ QWidgetPrivate::QWidgetPrivate(int version)
toolbar_ancestor = 0;
flushRequested = false;
touchEventsEnabled = false;
-#endif // Q_DEAD_CODE_FROM_QT4_MAC
+#endif
#ifdef QWIDGET_EXTRA_DEBUG
static int count = 0;
qDebug() << "widgets" << ++count;
@@ -1087,7 +1087,7 @@ void QWidgetPrivate::adjustFlags(Qt::WindowFlags &flags, QWidget *w)
// Only enable this on non-Mac platforms. Since the old way of doing this would
// interpret WindowSystemMenuHint as a close button and we can't change that behavior
// we can't just add this in.
-#ifndef Q_DEAD_CODE_FROM_QT4_MAC
+#if 1 // Used to be excluded in Qt4 for Q_WS_MAC
if ((flags & (Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint | Qt::WindowContextHelpButtonHint))
# ifdef Q_OS_WIN
&& type != Qt::Dialog // QTBUG-2027, allow for menu-less dialogs.
@@ -1147,7 +1147,7 @@ void QWidgetPrivate::init(QWidget *parentWidget, Qt::WindowFlags f)
}
#endif
-#if defined(Q_DEAD_CODE_FROM_QT4_X11)
+#if 0 // Used to be included in Qt4 for Q_WS_X11
if (desktopWidget) {
// make sure the widget is created on the same screen as the
// programmer specified desktop widget
@@ -1181,7 +1181,7 @@ void QWidgetPrivate::init(QWidget *parentWidget, Qt::WindowFlags f)
mustHaveWindowHandle = 1;
q->setAttribute(Qt::WA_NativeWindow);
}
-//#ifdef Q_DEAD_CODE_FROM_QT4_MAC
+//#if 0 // Used to be included in Qt4 for Q_WS_MAC
// q->setAttribute(Qt::WA_NativeWindow);
//#endif
@@ -1206,9 +1206,9 @@ void QWidgetPrivate::init(QWidget *parentWidget, Qt::WindowFlags f)
setOpaque(q->isWindow() && background.style() != Qt::NoBrush && background.isOpaque());
}
data.fnt = QFont(data.fnt, q);
-#if defined(Q_DEAD_CODE_FROM_QT4_X11)
+#if 0 // Used to be included in Qt4 for Q_WS_X11
data.fnt.x11SetScreen(xinfo.screen());
-#endif // Q_DEAD_CODE_FROM_QT4_X11
+#endif
q->setAttribute(Qt::WA_PendingMoveEvent);
q->setAttribute(Qt::WA_PendingResizeEvent);
@@ -1225,7 +1225,7 @@ void QWidgetPrivate::init(QWidget *parentWidget, Qt::WindowFlags f)
extraPaintEngine = 0;
-#ifdef Q_DEAD_CODE_FROM_QT4_MAC
+#if 0 // Used to be included in Qt4 for Q_WS_MAC
// If we add a child to the unified toolbar, we have to redirect the painting.
if (parentWidget && parentWidget->d_func() && parentWidget->d_func()->isInUnifiedToolbar) {
if (parentWidget->d_func()->unifiedSurface) {
@@ -1233,7 +1233,7 @@ void QWidgetPrivate::init(QWidget *parentWidget, Qt::WindowFlags f)
parentWidget->d_func()->unifiedSurface->recursiveRedirect(toolbar, toolbar, toolbar->d_func()->toolbar_offset);
}
}
-#endif // Q_DEAD_CODE_FROM_QT4_MAC
+#endif
}
@@ -1323,14 +1323,14 @@ void QWidget::create(WId window, bool initializeWindow, bool destroyOldWindow)
<< "Alien?" << !testAttribute(Qt::WA_NativeWindow);
#endif
-#if defined (Q_DEAD_CODE_FROM_QT4_WIN) && !defined(QT_NO_DRAGANDDROP)
+#if 0 /* Used to be included in Qt4 for Q_WS_WIN */ && !defined(QT_NO_DRAGANDDROP)
// Unregister the dropsite (if already registered) before we
// re-create the widget with a native window.
if (testAttribute(Qt::WA_WState_Created) && !internalWinId() && testAttribute(Qt::WA_NativeWindow)
&& d->extra && d->extra->dropTarget) {
d->registerDropSite(false);
}
-#endif // defined (Q_DEAD_CODE_FROM_QT4_WIN) && !defined(QT_NO_DRAGANDDROP)
+#endif
d->updateIsOpaque();
@@ -1630,7 +1630,7 @@ QWidget::~QWidget()
}
}
-#if defined(Q_DEAD_CODE_FROM_QT4_WIN) || defined(Q_DEAD_CODE_FROM_QT4_X11)|| defined(Q_DEAD_CODE_FROM_QT4_MAC)
+#if 0 /* Used to be included in Qt4 for Q_WS_WIN */ || 0 /* Used to be included in Qt4 for Q_WS_X11 */|| 0 /* Used to be included in Qt4 for Q_WS_MAC */
else if (!internalWinId() && isVisible()) {
qApp->d_func()->sendSyntheticEnterLeave(this);
}
@@ -1677,7 +1677,7 @@ QWidget::~QWidget()
d->blockSig = blocked;
-#ifdef Q_DEAD_CODE_FROM_QT4_MAC
+#if 0 // Used to be included in Qt4 for Q_WS_MAC
// QCocoaView holds a pointer back to this widget. Clear it now
// to make sure it's not followed later on. The lifetime of the
// QCocoaView might exceed the lifetime of this widget in cases
@@ -1728,7 +1728,7 @@ void QWidgetPrivate::setWinId(WId id) // set widget identifier
const WId oldWinId = data.winid;
data.winid = id;
-#if defined(Q_DEAD_CODE_FROM_QT4_X11)
+#if 0 // Used to be included in Qt4 for Q_WS_X11
hd = id; // X11: hd == ident
#endif
if (mapper && id && !userDesktopWidget) {
@@ -1764,9 +1764,9 @@ void QWidgetPrivate::createTLExtra()
x->window = 0;
x->shareContext = 0;
x->initialScreenIndex = -1;
-#ifdef Q_DEAD_CODE_FROM_QT4_MAC
+#if 0 // Used to be included in Qt4 for Q_WS_MAC
x->wasMaximized = false;
-#endif // Q_DEAD_CODE_FROM_QT4_MAC
+#endif
#ifdef QWIDGET_EXTRA_DEBUG
static int count = 0;
qDebug() << "tlextra" << ++count;
@@ -2191,10 +2191,10 @@ void QWidgetPrivate::subtractOpaqueSiblings(QRegion &sourceRegion, bool *hasDirt
if (disableSubtractOpaqueSiblings || q->isWindow())
return;
-#ifdef Q_DEAD_CODE_FROM_QT4_MAC
+#if 0 // Used to be included in Qt4 for Q_WS_MAC
if (q->d_func()->isInUnifiedToolbar)
return;
-#endif // Q_DEAD_CODE_FROM_QT4_MAC
+#endif
QRect clipBoundingRect;
bool dirtyClipBoundingRect = true;
@@ -2328,7 +2328,7 @@ void QWidgetPrivate::updateIsOpaque()
#endif //QT_NO_GRAPHICSEFFECT
Q_Q(QWidget);
-#ifdef Q_DEAD_CODE_FROM_QT4_X11
+#if 0 // Used to be included in Qt4 for Q_WS_X11
if (q->testAttribute(Qt::WA_X11OpenGLOverlay)) {
setOpaque(false);
return;
@@ -2387,7 +2387,7 @@ static inline void fillRegion(QPainter *painter, const QRegion &rgn, const QBrus
Q_ASSERT(painter);
if (brush.style() == Qt::TexturePattern) {
-#ifdef Q_DEAD_CODE_FROM_QT4_MAC
+#if 0 // Used to be included in Qt4 for Q_WS_MAC
// Optimize pattern filling on mac by using HITheme directly
// when filling with the standard widget background.
// Defined in qmacstyle_mac.cpp
@@ -2399,7 +2399,7 @@ static inline void fillRegion(QPainter *painter, const QRegion &rgn, const QBrus
painter->setClipRegion(rgn);
painter->drawTiledPixmap(rect, brush.texture(), rect.topLeft());
}
-#endif // Q_DEAD_CODE_FROM_QT4_MAC
+#endif
} else if (brush.gradient()
&& brush.gradient()->coordinateMode() == QGradient::ObjectBoundingMode) {
@@ -2470,7 +2470,7 @@ void QWidgetPrivate::paintBackground(QPainter *painter, const QRegion &rgn, int
visible widgets.
*/
-#ifdef Q_DEAD_CODE_FROM_QT4_MAC
+#if 0 // Used to be included in Qt4 for Q_WS_MAC
extern QPointer<QWidget> qt_button_down;
#else
extern QWidget *qt_button_down;
@@ -2750,7 +2750,7 @@ void QWidget::setStyle(QStyle *style)
}
void QWidgetPrivate::setStyle_helper(QStyle *newStyle, bool propagate, bool
-#ifdef Q_DEAD_CODE_FROM_QT4_MAC
+#if 0 // Used to be included in Qt4 for Q_WS_MAC
metalHack
#endif
)
@@ -2761,7 +2761,7 @@ void QWidgetPrivate::setStyle_helper(QStyle *newStyle, bool propagate, bool
QPointer<QStyle> origStyle;
#endif
-#ifdef Q_DEAD_CODE_FROM_QT4_MAC
+#if 0 // Used to be included in Qt4 for Q_WS_MAC
// the metalhack boolean allows Qt/Mac to do a proper re-polish depending
// on how the Qt::WA_MacBrushedMetal attribute is set. It is only ever
// set when changing that attribute and passes the widget's CURRENT style.
@@ -2781,12 +2781,12 @@ void QWidgetPrivate::setStyle_helper(QStyle *newStyle, bool propagate, bool
if (q->windowType() != Qt::Desktop) {
if (polished) {
oldStyle->unpolish(q);
-#ifdef Q_DEAD_CODE_FROM_QT4_MAC
+#if 0 // Used to be included in Qt4 for Q_WS_MAC
if (metalHack)
macUpdateMetalAttribute();
#endif
q->style()->polish(q);
-#ifdef Q_DEAD_CODE_FROM_QT4_MAC
+#if 0 // Used to be included in Qt4 for Q_WS_MAC
} else if (metalHack) {
macUpdateMetalAttribute();
#endif
@@ -3151,7 +3151,7 @@ bool QWidget::isFullScreen() const
*/
void QWidget::showFullScreen()
{
-#ifdef Q_DEAD_CODE_FROM_QT4_MAC
+#if 0 // Used to be included in Qt4 for Q_WS_MAC
// If the unified toolbar is enabled, we have to disable it before going fullscreen.
QMainWindow *mainWindow = qobject_cast<QMainWindow*>(this);
if (mainWindow && mainWindow->unifiedTitleAndToolBarOnMac()) {
@@ -3159,7 +3159,7 @@ void QWidget::showFullScreen()
QMainWindowLayout *mainLayout = qobject_cast<QMainWindowLayout*>(mainWindow->layout());
mainLayout->activateUnifiedToolbarAfterFullScreen = true;
}
-#endif // Q_DEAD_CODE_FROM_QT4_MAC
+#endif
ensurePolished();
setWindowState((windowState() & ~(Qt::WindowMinimized | Qt::WindowMaximized))
@@ -3187,7 +3187,7 @@ void QWidget::showMaximized()
setWindowState((windowState() & ~(Qt::WindowMinimized | Qt::WindowFullScreen))
| Qt::WindowMaximized);
-#ifdef Q_DEAD_CODE_FROM_QT4_MAC
+#if 0 // Used to be included in Qt4 for Q_WS_MAC
// If the unified toolbar was enabled before going fullscreen, we have to enable it back.
QMainWindow *mainWindow = qobject_cast<QMainWindow*>(this);
if (mainWindow)
@@ -3198,7 +3198,7 @@ void QWidget::showMaximized()
mainLayout->activateUnifiedToolbarAfterFullScreen = false;
}
}
-#endif // Q_DEAD_CODE_FROM_QT4_MAC
+#endif
setVisible(true);
}
@@ -3216,7 +3216,7 @@ void QWidget::showNormal()
setWindowState(windowState() & ~(Qt::WindowMinimized
| Qt::WindowMaximized
| Qt::WindowFullScreen));
-#ifdef Q_DEAD_CODE_FROM_QT4_MAC
+#if 0 // Used to be included in Qt4 for Q_WS_MAC
// If the unified toolbar was enabled before going fullscreen, we have to enable it back.
QMainWindow *mainWindow = qobject_cast<QMainWindow*>(this);
if (mainWindow)
@@ -3227,7 +3227,7 @@ void QWidget::showNormal()
mainLayout->activateUnifiedToolbarAfterFullScreen = false;
}
}
-#endif // Q_DEAD_CODE_FROM_QT4_MAC
+#endif
setVisible(true);
}
@@ -3443,7 +3443,7 @@ void QWidgetPrivate::setEnabled_helper(bool enable)
if (w && !w->testAttribute(attribute))
w->d_func()->setEnabled_helper(enable);
}
-#if defined(Q_DEAD_CODE_FROM_QT4_X11)
+#if 0 // Used to be included in Qt4 for Q_WS_X11
if (q->testAttribute(Qt::WA_SetCursor) || q->isWindow()) {
// enforce the windows behavior of clearing the cursor on
// disabled widgets
@@ -3457,7 +3457,7 @@ void QWidgetPrivate::setEnabled_helper(bool enable)
qt_qpa_set_cursor(q, false);
}
#endif
-#if defined(Q_DEAD_CODE_FROM_QT4_MAC)
+#if 0 // Used to be included in Qt4 for Q_WS_MAC
setEnabled_helper_sys(enable);
#endif
#ifndef QT_NO_IM
@@ -4561,7 +4561,7 @@ const QPalette &QWidget::palette() const
) {
data->pal.setCurrentColorGroup(QPalette::Active);
} else {
-#ifdef Q_DEAD_CODE_FROM_QT4_MAC
+#if 0 // Used to be included in Qt4 for Q_WS_MAC
extern bool qt_mac_can_clickThrough(const QWidget *); //qwidget_mac.cpp
if (qt_mac_can_clickThrough(this))
data->pal.setCurrentColorGroup(QPalette::Active);
@@ -4819,7 +4819,7 @@ void QWidgetPrivate::updateFont(const QFont &font)
#endif
data.fnt = QFont(font, q);
-#if defined(Q_DEAD_CODE_FROM_QT4_X11)
+#if 0 // Used to be included in Qt4 for Q_WS_X11
// make sure the font set on this widget is associated with the correct screen
data.fnt.x11SetScreen(xinfo.screen());
#endif
@@ -4992,7 +4992,7 @@ void QWidget::setCursor(const QCursor &cursor)
{
Q_D(QWidget);
// On Mac we must set the cursor even if it is the ArrowCursor.
-#if !defined(Q_DEAD_CODE_FROM_QT4_MAC)
+#if 1 // Used to be excluded in Qt4 for Q_WS_MAC
if (cursor.shape() != Qt::ArrowCursor
|| (d->extra && d->extra->curs))
#endif
@@ -5424,7 +5424,7 @@ void QWidgetPrivate::render_helper(QPainter *painter, const QPoint &targetOffset
Q_ASSERT(!toBePainted.isEmpty());
Q_Q(QWidget);
-#ifndef Q_DEAD_CODE_FROM_QT4_MAC
+#if 1 // Used to be excluded in Qt4 for Q_WS_MAC
const QTransform originalTransform = painter->worldTransform();
const bool useDeviceCoordinates = originalTransform.isScaling();
if (!useDeviceCoordinates) {
@@ -5451,7 +5451,7 @@ void QWidgetPrivate::render_helper(QPainter *painter, const QPoint &targetOffset
if (restore)
painter->setRenderHints(QPainter::SmoothPixmapTransform, false);
-#ifndef Q_DEAD_CODE_FROM_QT4_MAC
+#if 1 // Used to be excluded in Qt4 for Q_WS_MAC
} else {
// Render via a pixmap in device coordinates (to avoid pixmap scaling).
QTransform transform = originalTransform;
@@ -5560,7 +5560,7 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP
if (paintEngine) {
setRedirected(pdev, -offset);
-#ifdef Q_DEAD_CODE_FROM_QT4_MAC
+#if 0 // Used to be included in Qt4 for Q_WS_MAC
// (Alien support) Special case for Mac when redirecting: If the paint device
// is of the Widget type we need to set WA_WState_InPaintEvent since painting
// outside the paint event is not supported on QWidgets. The attributeis
@@ -5646,7 +5646,7 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP
//restore
if (paintEngine) {
-#ifdef Q_DEAD_CODE_FROM_QT4_MAC
+#if 0 // Used to be included in Qt4 for Q_WS_MAC
if (pdev->devType() == QInternal::Widget)
static_cast<QWidget *>(pdev)->setAttribute(Qt::WA_WState_InPaintEvent, false);
#endif
@@ -5720,7 +5720,7 @@ void QWidgetPrivate::render(QPaintDevice *target, const QPoint &targetOffset,
if (paintRegion.isEmpty())
return;
-#ifndef Q_DEAD_CODE_FROM_QT4_MAC
+#if 1 // Used to be excluded in Qt4 for Q_WS_MAC
QPainter *oldSharedPainter = inRenderWithPainter ? sharedPainter() : 0;
// Use the target's shared painter if set (typically set when doing
@@ -6501,7 +6501,7 @@ void QWidget::setFocus(Qt::FocusReason reason)
f = f->d_func()->extra->focus_proxy;
if (QApplication::focusWidget() == f
-#if defined(Q_DEAD_CODE_FROM_QT4_WIN)
+#if 0 // Used to be included in Qt4 for Q_WS_WIN
&& GetFocus() == f->internalWinId()
#endif
)
@@ -6686,7 +6686,7 @@ void QWidget::clearFocus()
if (hasFocus()) {
// Update proxy state
QApplicationPrivate::setFocusWidget(0, Qt::OtherFocusReason);
-#if defined(Q_DEAD_CODE_FROM_QT4_WIN)
+#if 0 // Used to be included in Qt4 for Q_WS_WIN
if (!(windowType() == Qt::Popup) && GetFocus() == internalWinId())
SetFocus(0);
else
@@ -7318,7 +7318,7 @@ void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove)
*/
QByteArray QWidget::saveGeometry() const
{
-#ifdef Q_DEAD_CODE_FROM_QT4_MAC
+#if 0 // Used to be included in Qt4 for Q_WS_MAC
// We check if the window was maximized during this invocation. If so, we need to record the
// starting position as 0,0.
Q_D(const QWidget);
@@ -7329,7 +7329,7 @@ QByteArray QWidget::saveGeometry() const
newFramePosition.moveTo(0, 0);
newNormalPosition.moveTo(0, 0);
}
-#endif // Q_DEAD_CODE_FROM_QT4_MAC
+#endif
QByteArray array;
QDataStream stream(&array, QIODevice::WriteOnly);
stream.setVersion(QDataStream::Qt_4_0);
@@ -7343,13 +7343,13 @@ QByteArray QWidget::saveGeometry() const
stream << magicNumber
<< majorVersion
<< minorVersion
-#ifdef Q_DEAD_CODE_FROM_QT4_MAC
+#if 0 // Used to be included in Qt4 for Q_WS_MAC
<< newFramePosition
<< newNormalPosition
#else
<< frameGeometry()
<< normalGeometry()
-#endif // Q_DEAD_CODE_FROM_QT4_MAC
+#endif
<< qint32(screenNumber)
<< quint8(windowState() & Qt::WindowMaximized)
<< quint8(windowState() & Qt::WindowFullScreen)
@@ -7457,7 +7457,7 @@ bool QWidget::restoreGeometry(const QByteArray &geometry)
// - The title bar is outside the available geometry.
// - (Mac only) The window is higher than the available geometry. It must
// be possible to bring the size grip on screen by moving the window.
-#ifdef Q_DEAD_CODE_FROM_QT4_MAC
+#if 0 // Used to be included in Qt4 for Q_WS_MAC
restoredFrameGeometry.setHeight(qMin(restoredFrameGeometry.height(), availableGeometry.height()));
restoredNormalGeometry.setHeight(qMin(restoredNormalGeometry.height(), availableGeometry.height() - frameHeight));
#endif
@@ -7506,7 +7506,7 @@ bool QWidget::restoreGeometry(const QByteArray &geometry)
d_func()->topData()->normalGeometry = restoredNormalGeometry;
} else {
QPoint offset;
-#ifdef Q_DEAD_CODE_FROM_QT4_X11
+#if 0 // Used to be included in Qt4 for Q_WS_X11
if (isFullScreen())
offset = d_func()->topData()->fullScreenOffset;
#endif
@@ -7904,7 +7904,7 @@ void QWidgetPrivate::show_helper()
// On Windows, show the popup now so that our own focus handling
// stores the correct old focus widget even if it's stolen in the
// showevent
-#if defined(Q_DEAD_CODE_FROM_QT4_WIN) || defined(Q_DEAD_CODE_FROM_QT4_MAC)
+#if 0 /* Used to be included in Qt4 for Q_WS_WIN */ || 0 /* Used to be included in Qt4 for Q_WS_MAC */
if (!isEmbedded && q->windowType() == Qt::Popup)
qApp->d_func()->openPopup(q);
#endif
@@ -8033,7 +8033,7 @@ void QWidgetPrivate::hide_helper()
if (!isEmbedded && (q->windowType() == Qt::Popup))
qApp->d_func()->closePopup(q);
-#if defined(Q_DEAD_CODE_FROM_QT4_WIN)
+#if 0 // Used to be included in Qt4 for Q_WS_WIN
if (q->isWindow() && !(q->windowType() == Qt::Popup) && q->parentWidget()
&& !q->parentWidget()->isHidden() && q->isActiveWindow())
q->parentWidget()->activateWindow(); // Activate parent
@@ -8217,7 +8217,7 @@ void QWidget::setVisible(bool visible)
} else { // hide
if (testAttribute(Qt::WA_WState_ExplicitShowHide) && testAttribute(Qt::WA_WState_Hidden))
return;
-#if defined(Q_DEAD_CODE_FROM_QT4_WIN)
+#if 0 // Used to be included in Qt4 for Q_WS_WIN
// reset WS_DISABLED style in a Blocked window
if(isWindow() && testAttribute(Qt::WA_WState_Created)
&& QApplicationPrivate::isBlockedByModal(this))
@@ -8302,7 +8302,7 @@ void QWidgetPrivate::hideChildren(bool spontaneous)
QWidget *widget = qobject_cast<QWidget*>(childList.at(i));
if (!widget || widget->isWindow() || widget->testAttribute(Qt::WA_WState_Hidden))
continue;
-#ifdef Q_DEAD_CODE_FROM_QT4_MAC
+#if 0 // Used to be included in Qt4 for Q_WS_MAC
// Before doing anything we need to make sure that we don't leave anything in a non-consistent state.
// When hiding a widget we need to make sure that no mouse_down events are active, because
// the mouse_up event will never be received by a hidden widget or one of its descendants.
@@ -8318,7 +8318,7 @@ void QWidgetPrivate::hideChildren(bool spontaneous)
// supposed to trigger because it is not visible.
if(widget == qt_button_down)
qt_button_down = 0;
-#endif // Q_DEAD_CODE_FROM_QT4_MAC
+#endif
if (spontaneous)
widget->setAttribute(Qt::WA_Mapped, false);
else
@@ -8553,7 +8553,7 @@ QSize QWidgetPrivate::adjustedSize() const
s.setWidth(qMax(s.width(), 200));
if (exp & Qt::Vertical)
s.setHeight(qMax(s.height(), 100));
-#if defined(Q_DEAD_CODE_FROM_QT4_X11)
+#if 0 // Used to be included in Qt4 for Q_WS_X11
QRect screen = QApplication::desktop()->screenGeometry(q->x11Info().screen());
#else // all others
QRect screen = QApplication::desktop()->screenGeometry(q->pos());
@@ -8682,7 +8682,7 @@ bool QWidget::isAncestorOf(const QWidget *child) const
return false;
}
-#if defined(Q_DEAD_CODE_FROM_QT4_WIN)
+#if 0 // Used to be included in Qt4 for Q_WS_WIN
inline void setDisabledStyle(QWidget *w, bool setStyle)
{
// set/reset WS_DISABLED style.
@@ -9114,7 +9114,7 @@ bool QWidget::event(QEvent *event)
}
}
}
-#if defined(Q_DEAD_CODE_FROM_QT4_WIN)
+#if 0 // Used to be included in Qt4 for Q_WS_WIN
setDisabledStyle(this, (event->type() == QEvent::WindowBlocked));
#endif
break;
@@ -9141,7 +9141,7 @@ bool QWidget::event(QEvent *event)
case QEvent::EmbeddingControl:
d->topData()->frameStrut.setCoords(0 ,0, 0, 0);
data->fstrut_dirty = false;
-#if defined(Q_DEAD_CODE_FROM_QT4_WIN) || defined(Q_DEAD_CODE_FROM_QT4_X11)
+#if 0 /* Used to be included in Qt4 for Q_WS_WIN */ || 0 /* Used to be included in Qt4 for Q_WS_X11 */
d->topData()->embedded = 1;
#endif
break;
@@ -9166,7 +9166,7 @@ bool QWidget::event(QEvent *event)
}
break;
}
-#ifdef Q_DEAD_CODE_FROM_QT4_MAC
+#if 0 // Used to be included in Qt4 for Q_WS_MAC
case QEvent::MacGLWindowChange:
d->needWindowChange = false;
break;
@@ -9280,7 +9280,7 @@ void QWidget::changeEvent(QEvent * event)
case QEvent::MacSizeChange:
updateGeometry();
break;
-#elif defined Q_DEAD_CODE_FROM_QT4_MAC
+#elif 0 // Used to be included in Qt4 for Q_WS_MAC
case QEvent::ToolTipChange:
case QEvent::MouseTrackingChange:
qt_mac_update_mouseTracking(this);
@@ -10561,7 +10561,7 @@ void QWidget::setParent(QWidget *parent, Qt::WindowFlags f)
// (f & Qt::MSWindowsOwnDC) clause (which is set on QGLWidgets on all
// platforms).
if (newParent
-#if defined(Q_DEAD_CODE_FROM_QT4_WIN) || defined(QT_OPENGL_ES)
+#if 0 /* Used to be included in Qt4 for Q_WS_WIN */ || defined(QT_OPENGL_ES)
|| (f & Qt::MSWindowsOwnDC)
#endif
) {
@@ -10581,7 +10581,7 @@ void QWidget::setParent(QWidget *parent, Qt::WindowFlags f)
}
//### already hidden above ---> must probably do something smart on the mac
-// #ifdef Q_DEAD_CODE_FROM_QT4_MAC
+// #if 0 // Used to be included in Qt4 for Q_WS_MAC
// extern bool qt_mac_is_macdrawer(const QWidget *); //qwidget_mac.cpp
// if(!qt_mac_is_macdrawer(q)) //special case
// q->setAttribute(Qt::WA_WState_Hidden);
@@ -11109,7 +11109,7 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on)
d->receiveChildEvents = !on;
break;
case Qt::WA_MacBrushedMetal:
-#ifdef Q_DEAD_CODE_FROM_QT4_MAC
+#if 0 // Used to be included in Qt4 for Q_WS_MAC
d->setStyle_helper(style(), false, true); // Make sure things get unpolished/polished correctly.
// fall through since changing the metal attribute affects the opaque size grip.
case Qt::WA_MacOpaqueSizeGrip:
@@ -11126,7 +11126,7 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on)
break;
#endif
case Qt::WA_MacAlwaysShowToolWindow:
-#ifdef Q_DEAD_CODE_FROM_QT4_MAC
+#if 0 // Used to be included in Qt4 for Q_WS_MAC
d->macUpdateHideOnSuspend();
#endif
break;
@@ -11203,7 +11203,7 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on)
}
case Qt::WA_PaintOnScreen:
d->updateIsOpaque();
-#if defined(Q_DEAD_CODE_FROM_QT4_WIN) || defined(Q_DEAD_CODE_FROM_QT4_X11) || defined(Q_DEAD_CODE_FROM_QT4_MAC)
+#if 0 /* Used to be included in Qt4 for Q_WS_WIN */ || 0 /* Used to be included in Qt4 for Q_WS_X11 */ || 0 /* Used to be included in Qt4 for Q_WS_MAC */
// Recreate the widget if it's already created as an alien widget and
// WA_PaintOnScreen is enabled. Paint on screen widgets must have win id.
// So must their children.
@@ -11223,7 +11223,7 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on)
d->updateSystemBackground();
break;
case Qt::WA_TransparentForMouseEvents:
-#ifdef Q_DEAD_CODE_FROM_QT4_MAC
+#if 0 // Used to be included in Qt4 for Q_WS_MAC
d->macUpdateIgnoreMouseEvents();
#endif
break;
@@ -11242,7 +11242,7 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on)
d->resolveFont();
d->resolveLocale();
break;
-#ifdef Q_DEAD_CODE_FROM_QT4_X11
+#if 0 // Used to be included in Qt4 for Q_WS_X11
case Qt::WA_NoX11EventCompression:
if (!d->extra)
d->createExtra();
@@ -11299,7 +11299,7 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on)
break;
case Qt::WA_AcceptTouchEvents:
-#if defined(Q_DEAD_CODE_FROM_QT4_WIN) || defined(Q_DEAD_CODE_FROM_QT4_MAC)
+#if 0 /* Used to be included in Qt4 for Q_WS_WIN */ || 0 /* Used to be included in Qt4 for Q_WS_MAC */
if (on)
d->registerTouchWindow();
#endif
@@ -11918,7 +11918,7 @@ QRect QWidgetPrivate::frameStrut() const
}
if (data.fstrut_dirty
-#ifndef Q_DEAD_CODE_FROM_QT4_WIN
+#if 1 // Used to be excluded in Qt4 for Q_WS_WIN
// ### Fix properly for 4.3
&& q->isVisible()
#endif
@@ -12854,7 +12854,7 @@ void QWidget::setMask(const QRegion &newMask)
d->extra->mask = newMask;
d->extra->hasMask = !newMask.isEmpty();
-#ifndef Q_DEAD_CODE_FROM_QT4_MAC
+#if 1 // Used to be excluded in Qt4 for Q_WS_MAC
if (!testAttribute(Qt::WA_WState_Created))
return;
#endif
diff --git a/src/widgets/kernel/qwidget.h b/src/widgets/kernel/qwidget.h
index bca89fe2c5..5edf2c62da 100644
--- a/src/widgets/kernel/qwidget.h
+++ b/src/widgets/kernel/qwidget.h
@@ -570,12 +570,12 @@ public:
inline QWidget *childAt(int x, int y) const;
QWidget *childAt(const QPoint &p) const;
-#if defined(Q_DEAD_CODE_FROM_QT4_X11)
+#if 0 // Used to be included in Qt4 for Q_WS_X11
const QX11Info &x11Info() const;
Qt::HANDLE x11PictureHandle() const;
#endif
-#if defined(Q_DEAD_CODE_FROM_QT4_MAC)
+#if 0 // Used to be included in Qt4 for Q_WS_MAC
Qt::HANDLE macQDHandle() const;
Qt::HANDLE macCGHandle() const;
#endif
diff --git a/src/widgets/kernel/qwidget_p.h b/src/widgets/kernel/qwidget_p.h
index 3e57f9de41..2720c0dc31 100644
--- a/src/widgets/kernel/qwidget_p.h
+++ b/src/widgets/kernel/qwidget_p.h
@@ -189,7 +189,7 @@ struct QTLWExtra {
uint embedded : 1;
// *************************** Platform specific values (bit fields first) **********
-#if defined(Q_DEAD_CODE_FROM_QT4_X11) // <----------------------------------------------------------- X11
+#if 0 /* Used to be included in Qt4 for Q_WS_X11 */ // <----------------------------------------------------------- X11
uint spont_unmapped: 1; // window was spontaneously unmapped
uint dnd : 1; // DND properties installed
uint validWMState : 1; // is WM_STATE valid?
@@ -203,11 +203,11 @@ struct QTLWExtra {
qint32 newCounterValueHi;
quint32 newCounterValueLo;
#endif
-#elif defined(Q_DEAD_CODE_FROM_QT4_WIN) // <--------------------------------------------------------- WIN
+#elif 0 /* Used to be included in Qt4 for Q_WS_WIN */ // <--------------------------------------------------------- WIN
uint hotkeyRegistered: 1; // Hot key from the STARTUPINFO has been registered.
HICON winIconBig; // internal big Windows icon
HICON winIconSmall; // internal small Windows icon
-#elif defined(Q_DEAD_CODE_FROM_QT4_MAC) // <--------------------------------------------------------- MAC
+#elif 0 /* Used to be included in Qt4 for Q_WS_MAC */ // <--------------------------------------------------------- MAC
uint resizer : 4;
uint isSetGeometry : 1;
uint isMove : 1;
@@ -262,15 +262,15 @@ struct QWExtra {
uint hasWindowContainer : 1;
// *************************** Platform specific values (bit fields first) **********
-#if defined(Q_DEAD_CODE_FROM_QT4_WIN) // <----------------------------------------------------------- WIN
+#if 0 /* Used to be included in Qt4 for Q_WS_WIN */ // <----------------------------------------------------------- WIN
#ifndef QT_NO_DRAGANDDROP
QOleDropTarget *dropTarget; // drop target
QList<QPointer<QWidget> > oleDropWidgets;
#endif
-#elif defined(Q_DEAD_CODE_FROM_QT4_X11) // <--------------------------------------------------------- X11
+#elif 0 /* Used to be included in Qt4 for Q_WS_X11 */ // <--------------------------------------------------------- X11
uint compress_events : 1;
WId xDndProxy; // XDND forwarding to embedded windows
-#elif defined(Q_DEAD_CODE_FROM_QT4_MAC) // <------------------------------------------------------ MAC
+#elif 0 /* Used to be included in Qt4 for Q_WS_MAC */ // <------------------------------------------------------ MAC
// Cocoa Mask stuff
QImage maskBits;
CGImageRef imageMask;
@@ -761,7 +761,7 @@ public:
#if defined(Q_OS_WIN)
uint noPaintOnScreen : 1; // see qwidget.cpp ::paintEngine()
#endif
-#if defined(Q_DEAD_CODE_FROM_QT4_X11) // <----------------------------------------------------------- X11
+#if 0 /* Used to be included in Qt4 for Q_WS_X11 */ // <----------------------------------------------------------- X11
Qt::HANDLE picture;
static QWidget *mouseGrabber;
static QWidget *keyboardGrabber;
@@ -773,7 +773,7 @@ public:
void updateX11AcceptFocus();
QPoint mapToGlobal(const QPoint &pos) const;
QPoint mapFromGlobal(const QPoint &pos) const;
-#elif defined(Q_DEAD_CODE_FROM_QT4_WIN) // <--------------------------------------------------------- WIN
+#elif 0 /* Used to be included in Qt4 for Q_WS_WIN */ // <--------------------------------------------------------- WIN
#ifndef QT_NO_GESTURES
uint nativeGesturePanEnabled : 1;
#endif
@@ -789,7 +789,7 @@ public:
void winSetupGestures();
#elif defined(Q_OS_MAC) // <--------------------------------------------------------- MAC
void macUpdateSizeAttribute();
-#elif defined(Q_DEAD_CODE_FROM_QT4_MAC) // <--------------------------------------------------------- MAC (old stuff)
+#elif 0 /* Used to be included in Qt4 for Q_WS_MAC */ // <--------------------------------------------------------- MAC (old stuff)
// This is new stuff
uint needWindowChange : 1;
diff --git a/src/widgets/kernel/qwidgetbackingstore.cpp b/src/widgets/kernel/qwidgetbackingstore.cpp
index 81fbe49a43..a10c88308c 100644
--- a/src/widgets/kernel/qwidgetbackingstore.cpp
+++ b/src/widgets/kernel/qwidgetbackingstore.cpp
@@ -699,7 +699,7 @@ void QWidgetBackingStore::markDirtyOnScreen(const QRegion &region, QWidget *widg
if (!widget || widget->d_func()->paintOnScreen() || region.isEmpty())
return;
-#if defined(Q_DEAD_CODE_FROM_QT4_MAC)
+#if 0 // Used to be included in Qt4 for Q_WS_MAC
if (!widget->testAttribute(Qt::WA_WState_InPaintEvent))
dirtyOnScreen += region.translated(topLevelOffset);
return;
@@ -1624,7 +1624,7 @@ void QWidgetPrivate::repaint_sys(const QRegion &rgn)
&& (usesDoubleBufferedGLContext || q->autoFillBackground());
QRegion toBePainted(noPartialUpdateSupport ? q->rect() : rgn);
-#ifdef Q_DEAD_CODE_FROM_QT4_MAC
+#if 0 // Used to be included in Qt4 for Q_WS_MAC
// No difference between update() and repaint() on the Mac.
update_sys(toBePainted);
return;