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/widgets/qmainwindow.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/widgets/qmainwindow.cpp')
-rw-r--r-- | src/widgets/widgets/qmainwindow.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/widgets/widgets/qmainwindow.cpp b/src/widgets/widgets/qmainwindow.cpp index 2477510520..5c79c64793 100644 --- a/src/widgets/widgets/qmainwindow.cpp +++ b/src/widgets/widgets/qmainwindow.cpp @@ -61,7 +61,7 @@ #ifdef Q_OS_OSX #include <qpa/qplatformnativeinterface.h> #endif -#ifdef Q_DEAD_CODE_FROM_QT4_MAC +#if 0 // Used to be included in Qt4 for Q_WS_MAC #include <private/qt_mac_p.h> #include <private/qt_cocoa_helpers_mac_p.h> QT_BEGIN_NAMESPACE @@ -80,7 +80,7 @@ public: #ifdef Q_OS_OSX , useUnifiedToolBar(false) #endif -#ifdef Q_DEAD_CODE_FROM_QT4_MAC +#if 0 // Used to be included in Qt4 for Q_WS_MAC , useHIToolBar(false) , activateUnifiedToolbarAfterFullScreen(false) #endif @@ -95,7 +95,7 @@ public: #ifdef Q_OS_OSX bool useUnifiedToolBar; #endif -#ifdef Q_DEAD_CODE_FROM_QT4_MAC +#if 0 // Used to be included in Qt4 for Q_WS_MAC bool useHIToolBar; bool activateUnifiedToolbarAfterFullScreen; #endif @@ -1110,7 +1110,7 @@ void QMainWindow::addDockWidget(Qt::DockWidgetArea area, QDockWidget *dockwidget d_func()->layout->removeWidget(dockwidget); // in case it was already in here addDockWidget(area, dockwidget, orientation); -#ifdef Q_DEAD_CODE_FROM_QT4_MAC //drawer support +#if 0 // Used to be included in Qt4 for Q_WS_MAC //drawer support QMacAutoReleasePool pool; extern bool qt_mac_is_macdrawer(const QWidget *); //qwidget_mac.cpp if (qt_mac_is_macdrawer(dockwidget)) { @@ -1514,7 +1514,7 @@ bool QMainWindow::event(QEvent *event) if (!d->explicitIconSize) setIconSize(QSize()); break; -#ifdef Q_DEAD_CODE_FROM_QT4_MAC +#if 0 // Used to be included in Qt4 for Q_WS_MAC case QEvent::Show: if (unifiedTitleAndToolBarOnMac()) d->layout->syncUnifiedToolbarVisibility(); @@ -1533,7 +1533,7 @@ bool QMainWindow::event(QEvent *event) } } break; -#endif // Q_DEAD_CODE_FROM_QT4_MAC +#endif #if !defined(QT_NO_DOCKWIDGET) && !defined(QT_NO_CURSOR) case QEvent::CursorChange: // CursorChange events are triggered as mouse moves to new widgets even @@ -1589,7 +1589,7 @@ void QMainWindow::setUnifiedTitleAndToolBarOnMac(bool set) } #endif -#ifdef Q_DEAD_CODE_FROM_QT4_MAC +#if 0 // Used to be included in Qt4 for Q_WS_MAC Q_D(QMainWindow); if (!isWindow() || d->useHIToolBar == set || QSysInfo::MacintoshVersion < QSysInfo::MV_10_3) return; @@ -1624,7 +1624,7 @@ bool QMainWindow::unifiedTitleAndToolBarOnMac() const #ifdef Q_OS_OSX return d_func()->useUnifiedToolBar; #endif -#ifdef Q_DEAD_CODE_FROM_QT4_MAC +#if 0 // Used to be included in Qt4 for Q_WS_MAC return d_func()->useHIToolBar && !testAttribute(Qt::WA_MacBrushedMetal) && !(windowFlags() & Qt::FramelessWindowHint); #endif return false; |