diff --git a/src/plugins/platforms/xcb/qxcbcursor.cpp b/src/plugins/platforms/xcb/qxcbcursor.cpp index 8d151b760b..b401100dd4 100644 --- a/src/plugins/platforms/xcb/qxcbcursor.cpp +++ b/src/plugins/platforms/xcb/qxcbcursor.cpp @@ -301,8 +301,10 @@ QXcbCursorCacheKey::QXcbCursorCacheKey(const QCursor &c) QXcbCursor::QXcbCursor(QXcbConnection *conn, QXcbScreen *screen) : QXcbObject(conn), m_screen(screen), m_gtkCursorThemeInitialized(false) { +#if QT_CONFIG(cursor) // see NUM_BITMAPS in libXcursor/src/xcursorint.h m_bitmapCache.setMaxCost(8); +#endif if (cursorCount++) return; diff --git a/src/widgets/widgets/qmainwindowlayout_p.h b/src/widgets/widgets/qmainwindowlayout_p.h index aa446cf05b..4ccfb1786e 100644 --- a/src/widgets/widgets/qmainwindowlayout_p.h +++ b/src/widgets/widgets/qmainwindowlayout_p.h @@ -91,13 +91,15 @@ 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 // QT_CONFIG(cursor) QList movingSeparator; QPoint movingSeparatorOrigin, movingSeparatorPos; @@ -107,12 +109,12 @@ public: bool separatorMove(const QPoint &pos); bool endSeparatorMove(const QPoint &pos); -#endif +#endif // QT_CONFIG(dockwidget) bool windowEvent(QEvent *e); }; -#if !defined(QT_NO_DOCKWIDGET) && !defined(QT_NO_CURSOR) +#if QT_CONFIG(dockwidget) && QT_CONFIG(cursor) template QCursor QMainWindowLayoutSeparatorHelper::separatorCursor(const QList &path) { @@ -185,12 +187,14 @@ void QMainWindowLayoutSeparatorHelper::adjustCursor(const QPoint &pos) } } } +#endif // QT_CONFIG(cursor) && QT_CONFIG(dockwidget) template bool QMainWindowLayoutSeparatorHelper::windowEvent(QEvent *event) { QWidget *w = window(); switch (event->type()) { +#if QT_CONFIG(dockwidget) case QEvent::Paint: { QPainter p(w); QRegion r = static_cast(event)->region(); @@ -198,7 +202,7 @@ bool QMainWindowLayoutSeparatorHelper::windowEvent(QEvent *event) break; } -#ifndef QT_NO_CURSOR +#if QT_CONFIG(cursor) case QEvent::HoverMove: { adjustCursor(static_cast(event)->pos()); break; @@ -214,7 +218,7 @@ bool QMainWindowLayoutSeparatorHelper::windowEvent(QEvent *event) case QEvent::ShortcutOverride: // when a menu pops up adjustCursor(QPoint(0, 0)); break; -#endif // QT_NO_CURSOR +#endif // QT_CONFIG(cursor) case QEvent::MouseButtonPress: { QMouseEvent *e = static_cast(event); @@ -229,7 +233,7 @@ bool QMainWindowLayoutSeparatorHelper::windowEvent(QEvent *event) case QEvent::MouseMove: { QMouseEvent *e = static_cast(event); -#ifndef QT_NO_CURSOR +#if QT_CONFIG(cursor) adjustCursor(e->pos()); #endif if (e->buttons() & Qt::LeftButton) { @@ -253,7 +257,7 @@ bool QMainWindowLayoutSeparatorHelper::windowEvent(QEvent *event) break; } -#if !defined(QT_NO_CURSOR) +#if QT_CONFIG(cursor) case QEvent::CursorChange: // CursorChange events are triggered as mouse moves to new widgets even // if the cursor doesn't actually change, so do not change oldCursor if @@ -266,7 +270,7 @@ bool QMainWindowLayoutSeparatorHelper::windowEvent(QEvent *event) w->setCursor(adjustedCursor); } break; -#endif +#endif // QT_CONFIG(cursor) case QEvent::Timer: if (static_cast(event)->timerId() == separatorMoveTimer.timerId()) { // let's move the separators @@ -286,12 +290,14 @@ bool QMainWindowLayoutSeparatorHelper::windowEvent(QEvent *event) return true; } break; +#endif // QT_CONFIG(dockwidget) default: break; } return false; } +#if QT_CONFIG(dockwidget) template bool QMainWindowLayoutSeparatorHelper::startSeparatorMove(const QPoint &pos) { @@ -323,9 +329,7 @@ bool QMainWindowLayoutSeparatorHelper::endSeparatorMove(const QPoint &) layout()->savedState.clear(); return true; } -#endif -#if QT_CONFIG(dockwidget) class QDockWidgetGroupWindow : public QWidget { Q_OBJECT @@ -371,7 +375,7 @@ public: private: QLayout *lay() const { return const_cast(this)->widget()->layout(); } }; -#endif +#endif // QT_CONFIG(dockwidget) /* This data structure represents the state of all the tool-bars and dock-widgets. It's value based so it can be easilly copied into a temporary variable. All operations are performed without moving