From 878a82f188f29db57cac0d02ae9ca32e3d660916 Mon Sep 17 00:00:00 2001 From: Mikhail Svetkin Date: Fri, 11 May 2018 16:53:58 +0200 Subject: qtlite: Fix build with -no-feature-cursor or -no-feature-dockwidget Change-Id: Iae8c20172e43fcde816df3b87ad67f4ea2cda804 Reviewed-by: Richard Moe Gustavsen --- src/widgets/widgets/qmainwindow.cpp | 4 ++++ src/widgets/widgets/qmainwindowlayout_p.h | 15 +++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/widgets/qmainwindow.cpp b/src/widgets/widgets/qmainwindow.cpp index 2014bdabf3..aca38884a7 100644 --- a/src/widgets/widgets/qmainwindow.cpp +++ b/src/widgets/widgets/qmainwindow.cpp @@ -1312,8 +1312,12 @@ bool QMainWindow::restoreState(const QByteArray &state, int version) bool QMainWindow::event(QEvent *event) { Q_D(QMainWindow); + +#if QT_CONFIG(dockwidget) if (d->layout && d->layout->windowEvent(event)) return true; +#endif + switch (event->type()) { #if QT_CONFIG(toolbar) diff --git a/src/widgets/widgets/qmainwindowlayout_p.h b/src/widgets/widgets/qmainwindowlayout_p.h index aa446cf05b..341e9690cf 100644 --- a/src/widgets/widgets/qmainwindowlayout_p.h +++ b/src/widgets/widgets/qmainwindowlayout_p.h @@ -91,13 +91,16 @@ public: QList hoverSeparator; QPoint hoverPos; -#if !defined(QT_NO_DOCKWIDGET) && !defined(QT_NO_CURSOR) +#if QT_CONFIG(dockwidget) + +#if QT_CONFIG(cursor) QCursor separatorCursor(const QList &path); void adjustCursor(const QPoint &pos); QCursor oldCursor; QCursor adjustedCursor; bool hasOldCursor = false; bool cursorAdjusted = false; +#endif QList movingSeparator; QPoint movingSeparatorOrigin, movingSeparatorPos; @@ -106,13 +109,14 @@ public: bool startSeparatorMove(const QPoint &pos); bool separatorMove(const QPoint &pos); bool endSeparatorMove(const QPoint &pos); - + bool windowEvent(QEvent *e); #endif - bool windowEvent(QEvent *e); }; -#if !defined(QT_NO_DOCKWIDGET) && !defined(QT_NO_CURSOR) +#if QT_CONFIG(dockwidget) + +#if QT_CONFIG(cursor) template QCursor QMainWindowLayoutSeparatorHelper::separatorCursor(const QList &path) { @@ -185,6 +189,7 @@ void QMainWindowLayoutSeparatorHelper::adjustCursor(const QPoint &pos) } } } +#endif // QT_CONFIG(cursor) template bool QMainWindowLayoutSeparatorHelper::windowEvent(QEvent *event) @@ -323,9 +328,7 @@ bool QMainWindowLayoutSeparatorHelper::endSeparatorMove(const QPoint &) layout()->savedState.clear(); return true; } -#endif -#if QT_CONFIG(dockwidget) class QDockWidgetGroupWindow : public QWidget { Q_OBJECT -- cgit v1.2.3