summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@qt.io>2017-01-25 12:09:51 +0100
committerPaul Olav Tvete <paul.tvete@qt.io>2017-01-25 14:38:17 +0000
commitb0b726f8c7d8b17853962262fefd6e0b56de2b92 (patch)
tree82141196220753cbefe6d2915cc68b609ac8797e /src/widgets/widgets
parent624b67c6fb3c833ffe94cc2a52a2d1164eef839e (diff)
Fix build with -no-feature-tabbar
Change-Id: I97c5345f2627743876aa05a94ffc03f2a6012b6c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/widgets/widgets')
-rw-r--r--src/widgets/widgets/qdockarealayout.cpp2
-rw-r--r--src/widgets/widgets/qmainwindowlayout.cpp25
-rw-r--r--src/widgets/widgets/qmainwindowlayout_p.h2
-rw-r--r--src/widgets/widgets/qmdiarea.cpp2
4 files changed, 26 insertions, 5 deletions
diff --git a/src/widgets/widgets/qdockarealayout.cpp b/src/widgets/widgets/qdockarealayout.cpp
index ad19e5d5f9..30eaa73b9e 100644
--- a/src/widgets/widgets/qdockarealayout.cpp
+++ b/src/widgets/widgets/qdockarealayout.cpp
@@ -3175,6 +3175,7 @@ void QDockAreaLayout::resizeDocks(const QList<QDockWidget *> &docks,
while (path.size() > 1) {
QDockAreaLayoutInfo *info = this->info(path);
+#if QT_CONFIG(tabbar)
if (!info->tabbed && info->o == o) {
info->item_list[path.constLast()].size = size;
int totalSize = 0;
@@ -3187,6 +3188,7 @@ void QDockAreaLayout::resizeDocks(const QList<QDockWidget *> &docks,
}
size = totalSize;
}
+#endif // QT_CONFIG(tabbar)
path.removeLast();
}
diff --git a/src/widgets/widgets/qmainwindowlayout.cpp b/src/widgets/widgets/qmainwindowlayout.cpp
index 8eb1eaec18..72e06e4efa 100644
--- a/src/widgets/widgets/qmainwindowlayout.cpp
+++ b/src/widgets/widgets/qmainwindowlayout.cpp
@@ -125,8 +125,11 @@ static void dumpLayout(QTextStream &qout, const QDockAreaLayoutInfo &layout, QSt
<< layout.rect.height()
<< " min size: " << minSize.width() << ',' << minSize.height()
<< " orient:" << layout.o
+#if QT_CONFIG(tabbar)
<< " tabbed:" << layout.tabbed
- << " tbshape:" << layout.tabBarShape << '\n';
+ << " tbshape:" << layout.tabBarShape
+#endif
+ << '\n';
indent += QLatin1String(" ");
@@ -226,7 +229,9 @@ public:
if (li->isEmpty())
return;
int fw = frameWidth();
+#if QT_CONFIG(tabbar)
li->reparentWidgets(parentWidget());
+#endif
li->rect = r.adjusted(fw, fw, -fw, -fw);
li->fitItems();
li->apply(false);
@@ -317,6 +322,7 @@ QDockWidget *QDockWidgetGroupWindow::topDockWidget() const
{
QDockAreaLayoutInfo *info = layoutInfo();
QDockWidget *dw = 0;
+#if QT_CONFIG(tabbar)
if (info->tabBar && info->tabBar->currentIndex() >= 0) {
int i = info->tabIndexToListIndex(info->tabBar->currentIndex());
if (i >= 0) {
@@ -325,6 +331,7 @@ QDockWidget *QDockWidgetGroupWindow::topDockWidget() const
dw = qobject_cast<QDockWidget *>(item.widgetItem->widget());
}
}
+#endif
if (!dw) {
for (int i = 0; !dw && i < info->item_list.count(); ++i) {
const QDockAreaLayoutItem &item = info->item_list.at(i);
@@ -373,8 +380,10 @@ void QDockWidgetGroupWindow::destroyOrHideIfEmpty()
if (!wasHidden)
dw->show();
}
+#if QT_CONFIG(tabbar)
foreach (QTabBar *tb, findChildren<QTabBar *>(QString(), Qt::FindDirectChildrenOnly))
tb->setParent(parentWidget());
+#endif
deleteLater();
}
@@ -1802,10 +1811,10 @@ bool QMainWindowLayout::endSeparatorMove(const QPoint&)
void QMainWindowLayout::raise(QDockWidget *widget)
{
+#ifndef QT_NO_TABBAR
QDockAreaLayoutInfo *info = dockInfo(widget);
if (info == 0)
return;
-#ifndef QT_NO_TABBAR
if (!info->tabbed)
return;
info->setCurrentTab(widget);
@@ -2031,6 +2040,7 @@ bool QMainWindowLayout::plug(QLayoutItem *widgetItem)
currentHoveredFloat = floatingTabs;
}
#endif // QT_CONFIG(tabwidget)
+#if QT_CONFIG(tabbar)
QDockWidgetGroupWindow *dwgw = qobject_cast<QDockWidgetGroupWindow *>(currentHoveredFloat);
Q_ASSERT(dwgw);
Q_ASSERT(dwgw->layoutInfo()->tabbed); // because floating group should always be tabbed
@@ -2042,6 +2052,7 @@ bool QMainWindowLayout::plug(QLayoutItem *widgetItem)
globalRect.moveTopLeft(dwgw->mapToGlobal(globalRect.topLeft()));
pluggingWidget = widget;
widgetAnimator.animate(widget, globalRect, dockOptions & QMainWindow::AnimatedDocks);
+#endif // QT_CONFIG(tabbar)
return true;
}
#endif
@@ -2120,7 +2131,9 @@ void QMainWindowLayout::animationFinished(QWidget *widget)
if (QDockWidgetGroupWindow *dropTo = qobject_cast<QDockWidgetGroupWindow *>(currentHoveredFloat)) {
parentInfo = dropTo->layoutInfo();
+#if QT_CONFIG(tabbar)
Q_ASSERT(parentInfo->tabbed);
+#endif
path = parentInfo->indexOf(widget);
Q_ASSERT(path.size() == 1);
} else {
@@ -2129,7 +2142,7 @@ void QMainWindowLayout::animationFinished(QWidget *widget)
parentInfo = layoutState.dockAreaLayout.info(path);
Q_ASSERT(parentInfo);
}
-
+#if QT_CONFIG(tabbar)
if (parentInfo->tabbed) {
// merge the two tab widgets
int idx = path.constLast();
@@ -2143,15 +2156,19 @@ void QMainWindowLayout::animationFinished(QWidget *widget)
parentInfo->reparentWidgets(currentHoveredFloat ? currentHoveredFloat.data() : parentWidget());
parentInfo->updateTabBar();
parentInfo->setCurrentTabId(currentId);
- } else {
+ } else
+#endif // QT_CONFIG(tabbar)
+ {
QDockAreaLayoutItem &item = layoutState.dockAreaLayout.item(path);
Q_ASSERT(item.widgetItem->widget() == dwgw);
delete item.widgetItem;
item.widgetItem = 0;
item.subinfo = new QDockAreaLayoutInfo(qMove(*info));
*info = QDockAreaLayoutInfo();
+#if QT_CONFIG(tabbar)
item.subinfo->reparentWidgets(parentWidget());
item.subinfo->setTabBarShape(parentInfo->tabBarShape);
+#endif
}
dwgw->destroyOrHideIfEmpty();
}
diff --git a/src/widgets/widgets/qmainwindowlayout_p.h b/src/widgets/widgets/qmainwindowlayout_p.h
index 40336caeba..857a05eb8e 100644
--- a/src/widgets/widgets/qmainwindowlayout_p.h
+++ b/src/widgets/widgets/qmainwindowlayout_p.h
@@ -231,9 +231,9 @@ public:
void raise(QDockWidget *widget);
void setVerticalTabsEnabled(bool enabled);
bool restoreDockWidget(QDockWidget *dockwidget);
- QDockAreaLayoutInfo *dockInfo(QWidget *w);
#ifndef QT_NO_TABBAR
+ QDockAreaLayoutInfo *dockInfo(QWidget *w);
bool _documentMode;
bool documentMode() const;
void setDocumentMode(bool enabled);
diff --git a/src/widgets/widgets/qmdiarea.cpp b/src/widgets/widgets/qmdiarea.cpp
index 6b23e22bc1..18cb823702 100644
--- a/src/widgets/widgets/qmdiarea.cpp
+++ b/src/widgets/widgets/qmdiarea.cpp
@@ -1539,9 +1539,11 @@ void QMdiAreaPrivate::showRubberBandFor(QMdiSubWindow *subWindow)
if (!subWindow || !rubberBand)
return;
+#if QT_CONFIG(tabbar)
if (viewMode == QMdiArea::TabbedView)
rubberBand->setGeometry(tabBar->tabRect(childWindows.indexOf(subWindow)));
else
+#endif
rubberBand->setGeometry(subWindow->geometry());
rubberBand->raise();