diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2016-10-13 15:54:23 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2016-10-14 08:19:29 +0000 |
commit | 6a35e77ef3f4eae80ca49937c680836eb4acdbe6 (patch) | |
tree | 12462105731748d75d1fa1b7b45daf586b402413 /src/widgets/kernel/qtooltip.cpp | |
parent | dcf7da7c93c0d974bfb72ffa677a1d26fb9be5e0 (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/qtooltip.cpp')
-rw-r--r-- | src/widgets/kernel/qtooltip.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
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)) |