summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qmainwindowlayout.cpp
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/widgets/qmainwindowlayout.cpp
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/widgets/qmainwindowlayout.cpp')
-rw-r--r--src/widgets/widgets/qmainwindowlayout.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/widgets/widgets/qmainwindowlayout.cpp b/src/widgets/widgets/qmainwindowlayout.cpp
index 939453473a..8df197e05c 100644
--- a/src/widgets/widgets/qmainwindowlayout.cpp
+++ b/src/widgets/widgets/qmainwindowlayout.cpp
@@ -70,7 +70,7 @@
#include <private/qapplication_p.h>
#include <private/qlayoutengine_p.h>
#include <private/qwidgetresizehandler_p.h>
-#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
@@ -1129,11 +1129,11 @@ void QMainWindowLayout::removeToolBar(QToolBar *toolbar)
QObject::disconnect(parentWidget(), SIGNAL(toolButtonStyleChanged(Qt::ToolButtonStyle)),
toolbar, SLOT(_q_updateToolButtonStyle(Qt::ToolButtonStyle)));
-#ifdef Q_DEAD_CODE_FROM_QT4_MAC
+#if 0 // Used to be included in Qt4 for Q_WS_MAC
if (usesHIToolBar(toolbar)) {
removeFromMacToolbar(toolbar);
} else
-#endif // Q_DEAD_CODE_FROM_QT4_MAC
+#endif
{
removeWidget(toolbar);
}
@@ -1148,7 +1148,7 @@ void QMainWindowLayout::addToolBar(Qt::ToolBarArea area,
bool)
{
validateToolBarArea(area);
-#ifdef Q_DEAD_CODE_FROM_QT4_MAC
+#if 0 // Used to be included in Qt4 for Q_WS_MAC
if ((area == Qt::TopToolBarArea)
&& layoutState.mainWindow->unifiedTitleAndToolBarOnMac()) {
insertIntoMacToolbar(0, toolbar);
@@ -1174,11 +1174,11 @@ void QMainWindowLayout::addToolBar(Qt::ToolBarArea area,
*/
void QMainWindowLayout::insertToolBar(QToolBar *before, QToolBar *toolbar)
{
-#ifdef Q_DEAD_CODE_FROM_QT4_MAC
+#if 0 // Used to be included in Qt4 for Q_WS_MAC
if (usesHIToolBar(before)) {
insertIntoMacToolbar(before, toolbar);
} else
-#endif // Q_DEAD_CODE_FROM_QT4_MAC
+#endif
{
addChildWidget(toolbar);
QLayoutItem * item = layoutState.toolBarAreaLayout.insertToolBar(before, toolbar);
@@ -1207,7 +1207,7 @@ Qt::ToolBarArea QMainWindowLayout::toolBarArea(QToolBar *toolbar) const
case QInternal::BottomDock: return Qt::BottomToolBarArea;
default: break;
}
-#ifdef Q_DEAD_CODE_FROM_QT4_MAC
+#if 0 // Used to be included in Qt4 for Q_WS_MAC
if (pos == QInternal::DockCount) {
if (qtoolbarsInUnifiedToolbarList.contains(toolbar))
return Qt::TopToolBarArea;
@@ -1230,7 +1230,7 @@ void QMainWindowLayout::getStyleOptionInfo(QStyleOptionToolBar *option, QToolBar
void QMainWindowLayout::toggleToolBarsVisible()
{
bool updateNonUnifiedParts = true;
-#ifdef Q_DEAD_CODE_FROM_QT4_MAC
+#if 0 // Used to be included in Qt4 for Q_WS_MAC
if (layoutState.mainWindow->unifiedTitleAndToolBarOnMac()) {
// If we hit this case, someone has pressed the "toolbar button" which will
// toggle the unified toolbar visibility, because that's what the user wants.
@@ -1876,7 +1876,7 @@ QSize QMainWindowLayout::minimumSize() const
const QSize sbMin = statusbar ? statusbar->minimumSize() : QSize(0, 0);
minSize = QSize(qMax(sbMin.width(), minSize.width()),
sbMin.height() + minSize.height());
-#ifdef Q_DEAD_CODE_FROM_QT4_MAC
+#if 0 // Used to be included in Qt4 for Q_WS_MAC
const QSize storedSize = minSize;
int minWidth = 0;
foreach (QToolBar *toolbar, qtoolbarsInUnifiedToolbarList) {
@@ -2186,7 +2186,7 @@ QMainWindowLayout::QMainWindowLayout(QMainWindow *mainwindow, QLayout *parentLay
#endif // QT_NO_DOCKWIDGET
, widgetAnimator(this)
, pluggingWidget(0)
-#ifdef Q_DEAD_CODE_FROM_QT4_MAC
+#if 0 // Used to be included in Qt4 for Q_WS_MAC
, blockVisiblityCheck(false)
#endif
{
@@ -2213,7 +2213,7 @@ QMainWindowLayout::~QMainWindowLayout()
layoutState.deleteAllLayoutItems();
layoutState.deleteCentralWidgetItem();
-#ifdef Q_DEAD_CODE_FROM_QT4_MAC
+#if 0 // Used to be included in Qt4 for Q_WS_MAC
cleanUpMacToolbarItems();
#endif
@@ -2581,7 +2581,7 @@ bool QMainWindowLayout::restoreState(QDataStream &stream)
// HIToolbar.
bool QMainWindowLayout::usesHIToolBar(QToolBar *toolbar) const
{
-#ifndef Q_DEAD_CODE_FROM_QT4_MAC
+#if 1 // Used to be excluded in Qt4 for Q_WS_MAC
Q_UNUSED(toolbar);
return false;
#else