From fcab7186668de71a7c0f9055fb75c98b906f5dc7 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Tue, 24 Jan 2017 16:37:25 +0100 Subject: Fix build with -no-feature-dockwidget Change-Id: Id484b54fd7191715e61ba6708247357b83159f28 Reviewed-by: Lars Knoll --- src/widgets/widgets/qmainwindowlayout.cpp | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/widgets/widgets/qmainwindowlayout.cpp b/src/widgets/widgets/qmainwindowlayout.cpp index 14d7f3d835..9e1af16625 100644 --- a/src/widgets/widgets/qmainwindowlayout.cpp +++ b/src/widgets/widgets/qmainwindowlayout.cpp @@ -2172,7 +2172,9 @@ void QMainWindowLayout::animationFinished(QWidget *widget) savedState.clear(); currentGapPos.clear(); pluggingWidget = 0; - currentHoveredFloat = Q_NULLPTR; +#if QT_CONFIG(dockwidget) + currentHoveredFloat = nullptr; +#endif //applying the state will make sure that the currentGap is updated correctly //and all the geometries (especially the one from the central widget) is correct layoutState.apply(false); @@ -2408,8 +2410,16 @@ QLayoutItem *QMainWindowLayout::unplug(QWidget *widget, bool group) void QMainWindowLayout::updateGapIndicator() { #ifndef QT_NO_RUBBERBAND - if ((!widgetAnimator.animating() && !currentGapPos.isEmpty()) || currentHoveredFloat) { - QWidget *expectedParent = currentHoveredFloat ? currentHoveredFloat.data() : parentWidget(); + if ((!widgetAnimator.animating() && !currentGapPos.isEmpty()) +#if QT_CONFIG(dockwidget) + || currentHoveredFloat +#endif + ) { + QWidget *expectedParent = +#if QT_CONFIG(dockwidget) + currentHoveredFloat ? currentHoveredFloat.data() : +#endif + parentWidget(); if (!gapIndicator) { gapIndicator = new QRubberBand(QRubberBand::Rectangle, expectedParent); // For accessibility to identify this special widget. @@ -2417,7 +2427,11 @@ void QMainWindowLayout::updateGapIndicator() } else if (gapIndicator->parent() != expectedParent) { gapIndicator->setParent(expectedParent); } - gapIndicator->setGeometry(currentHoveredFloat ? currentHoveredFloat->rect() : currentGapRect); + gapIndicator->setGeometry( +#if QT_CONFIG(dockwidget) + currentHoveredFloat ? currentHoveredFloat->rect() : +#endif + currentGapRect); gapIndicator->show(); gapIndicator->raise(); } else if (gapIndicator) { @@ -2540,12 +2554,14 @@ void QMainWindowLayout::hover(QLayoutItem *widgetItem, const QPoint &mousePos) updateGapIndicator(); } +#if QT_CONFIG(dockwidget) QDockWidgetGroupWindow *QMainWindowLayout::createTabbedDockWindow() { QDockWidgetGroupWindow* f = new QDockWidgetGroupWindow(parentWidget(), Qt::Tool); new QDockWidgetGroupLayout(f); return f; } +#endif void QMainWindowLayout::applyState(QMainWindowLayoutState &newState, bool animate) { -- cgit v1.2.3