From fefe5cdf0c476db4bf3f49738b9abb9219357a34 Mon Sep 17 00:00:00 2001 From: Tasuku Suzuki Date: Tue, 8 May 2018 16:29:15 +0900 Subject: Fix build without features.cursor Change-Id: I450bd9f160c64f718c49e87d274c1ccc4a657aca Reviewed-by: Oswald Buddenhagen --- src/widgets/widgets/qmainwindowlayout_p.h | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'src/widgets') 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 -- cgit v1.2.3 From c4cbb3f315555858e00b18f2b34a68951a6f5477 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 14 May 2018 16:27:59 +0200 Subject: QFusionStyle: Fix width of editable combo box Add a scaling overlooked in 63d08003cf06b84b871618ba800a7079ae6bf702. Task-number: QTBUG-68194 Change-Id: I97c771435e4316ec55aacc527335b62cb4dfd9ec Reviewed-by: Gabriel de Dietrich --- src/widgets/styles/qfusionstyle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/widgets') diff --git a/src/widgets/styles/qfusionstyle.cpp b/src/widgets/styles/qfusionstyle.cpp index 0c6825cb36..7474cd23d6 100644 --- a/src/widgets/styles/qfusionstyle.cpp +++ b/src/widgets/styles/qfusionstyle.cpp @@ -3513,7 +3513,7 @@ QRect QFusionStyle::subControlRect(ComplexControl control, const QStyleOptionCom int frameWidth = 2; rect = visualRect(option->direction, option->rect, rect); rect.setRect(option->rect.left() + frameWidth, option->rect.top() + frameWidth, - option->rect.width() - 19 - 2 * frameWidth, + option->rect.width() - int(QStyleHelper::dpiScaled(19)) - 2 * frameWidth, option->rect.height() - 2 * frameWidth); if (const QStyleOptionComboBox *box = qstyleoption_cast(option)) { if (!box->editable) { -- cgit v1.2.3