From fb85af439715ff5ec141473b5c1d8f9744aca19d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Fri, 2 Oct 2009 13:56:53 +0200 Subject: Renamed the values in the Qt::TileRule enum. Stretch, Repeat and Round are too generic. Renamed to StretchTile, RepeatTile and RoundTile. Reviewed-by: Gunnar --- src/corelib/global/qnamespace.h | 6 +++--- src/corelib/global/qnamespace.qdoc | 22 +++++++++++----------- src/gui/painting/qdrawutil.cpp | 36 ++++++++++++++++++------------------ src/gui/painting/qdrawutil.h | 18 +++++++++--------- src/gui/styles/qstylesheetstyle.cpp | 2 +- 5 files changed, 42 insertions(+), 42 deletions(-) diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index a440606..9d76dcc 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -194,9 +194,9 @@ public: }; enum TileRule { - Stretch, - Repeat, - Round + StretchTile, + RepeatTile, + RoundTile }; // Text formatting flags for QPainter::drawText and QLabel. diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index 9106fa8..482beed 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -612,7 +612,7 @@ */ /*! - \enum Qt::CoordinateSystem + \enum Qt::CoordinateSystem \value DeviceCoordinates \value LogicalCoordinates */ @@ -1220,7 +1220,7 @@ touch device will be sent as mouse events. \value WA_TouchPadAcceptSingleTouchEvents Allows touchpad single - touch events to be sent to the widget. + touch events to be sent to the widget. \value WA_DontUseStandardGestures Disables standard gestures on Qt widgets. @@ -1241,7 +1241,7 @@ \omitvalue WA_PendingUpdate \omitvalue WA_LaidOut \omitvalue WA_GrabbedShortcut - \omitvalue WA_DontShowOnScreen + \omitvalue WA_DontShowOnScreen \omitvalue WA_InvalidSize \omitvalue WA_ForceUpdatesDisabled \omitvalue WA_NoX11EventCompression @@ -1259,7 +1259,7 @@ /*! \typedef Qt::HANDLE Platform-specific handle type for system objects. This is - equivalent to \c{void *} on Mac OS X and embedded Linux, + equivalent to \c{void *} on Mac OS X and embedded Linux, and to \c{unsigned long} on X11. On Windows it is the DWORD returned by the Win32 function getCurrentThreadId(). @@ -2762,13 +2762,13 @@ This enum describes how to repeat or stretch the parts of an image when drawing. - \value Stretch Scale the image to fit to the available area. + \value StretchTile Scale the image to fit to the available area. - \value Repeat Tile the image until there is no more space. May crop - the last image. + \value RepeatTile Repeat the image until there is no more space. May + crop the last image. - \value Round Like Repeat, but scales the images down to ensure that - the last image is not cropped. + \value RoundTile Similar to Repeat, but scales the image down to + ensure that the last tile is not cropped. */ /*! @@ -2812,13 +2812,13 @@ \value NavigationModeNone Only the touch screen is used. \value NavigationModeKeypadTabOrder Qt::Key_Up and Qt::Key_Down are used to change focus. \value NavigationModeKeypadDirectional Qt::Key_Up, Qt::Key_Down, Qt::Key_Left and Qt::Key_Right are used to change focus. - \value NavigationModeCursorAuto The mouse cursor is used to change focus, + \value NavigationModeCursorAuto The mouse cursor is used to change focus, it is displayed only on non touchscreen devices. The keypad is used to implement a virtual cursor, unless the device has an analog mouse type of input device (e.g. touchpad). This is the recommended setting for an application such as a web browser that needs pointer control on both touch and non-touch devices. - \value NavigationModeCursorForceVisible The mouse cursor is used to change focus, + \value NavigationModeCursorForceVisible The mouse cursor is used to change focus, it is displayed regardless of device type. The keypad is used to implement a virtual cursor, unless the device has an analog mouse type of input device (e.g. touchpad) diff --git a/src/gui/painting/qdrawutil.cpp b/src/gui/painting/qdrawutil.cpp index 716300e..ac3796a 100644 --- a/src/gui/painting/qdrawutil.cpp +++ b/src/gui/painting/qdrawutil.cpp @@ -1225,7 +1225,7 @@ void qDrawBorderPixmap(QPainter *painter, const QRect &targetRect, const QMargin // horizontal edges switch (rules.horizontal) { - case Qt::Stretch: + case Qt::StretchTile: if (targetMargins.top() > 0 && sourceMargins.top() > 0) { // top const QRect targetTopRect(targetCenterLeft, targetTop, targetCenterWidth, targetMargins.top()); const QRect sourceTopRect(sourceCenterLeft, sourceTop, sourceCenterWidth, sourceMargins.top()); @@ -1237,7 +1237,7 @@ void qDrawBorderPixmap(QPainter *painter, const QRect &targetRect, const QMargin qDrawPixmap(painter, targetBottomRect, pixmap, sourceBottomRect); } break; - case Qt::Repeat: + case Qt::RepeatTile: if (targetMargins.top() > 0 && sourceMargins.top() > 0) { // top const QRect targetTopRect(targetCenterLeft, targetTop, targetCenterWidth, targetMargins.top()); const QRect sourceTopRect(sourceCenterLeft, sourceTop, sourceCenterWidth, sourceMargins.top()); @@ -1249,7 +1249,7 @@ void qDrawBorderPixmap(QPainter *painter, const QRect &targetRect, const QMargin qDrawHorizontallyRepeatedPixmap(painter, targetBottomRect, pixmap, sourceBottomRect); } break; - case Qt::Round: + case Qt::RoundTile: if (targetMargins.top() > 0 && sourceMargins.top() > 0) { // top const QRect targetTopRect(targetCenterLeft, targetTop, targetCenterWidth, targetMargins.top()); const QRect sourceTopRect(sourceCenterLeft, sourceTop, sourceCenterWidth, sourceMargins.top()); @@ -1265,7 +1265,7 @@ void qDrawBorderPixmap(QPainter *painter, const QRect &targetRect, const QMargin // vertical edges switch (rules.vertical) { - case Qt::Stretch: + case Qt::StretchTile: if (targetMargins.left() > 0 && sourceMargins.left() > 0) { // left const QRect targetLeftRect(targetLeft, targetCenterTop, targetMargins.left(), targetCenterHeight); const QRect sourceLeftRect(sourceLeft, sourceCenterTop, sourceMargins.left(), sourceCenterHeight); @@ -1277,7 +1277,7 @@ void qDrawBorderPixmap(QPainter *painter, const QRect &targetRect, const QMargin qDrawPixmap(painter, targetRightRect, pixmap, sourceRightRect); } break; - case Qt::Repeat: + case Qt::RepeatTile: if (targetMargins.left() > 0 && sourceMargins.left() > 0) { // left const QRect targetLeftRect(targetLeft, targetCenterTop, targetMargins.left(), targetCenterHeight); const QRect sourceLeftRect(sourceLeft, sourceCenterTop, sourceMargins.left(), sourceCenterHeight); @@ -1289,7 +1289,7 @@ void qDrawBorderPixmap(QPainter *painter, const QRect &targetRect, const QMargin qDrawVerticallyRepeatedPixmap(painter, targetRightRect, pixmap, sourceRightRect); } break; - case Qt::Round: + case Qt::RoundTile: if (targetMargins.left() > 0 && sourceMargins.left() > 0) { // left const QRect targetLeftRect(targetLeft, targetCenterTop, targetMargins.left(), targetCenterHeight); const QRect sourceLeftRect(sourceLeft, sourceCenterTop, sourceMargins.left(), sourceCenterHeight); @@ -1308,41 +1308,41 @@ void qDrawBorderPixmap(QPainter *painter, const QRect &targetRect, const QMargin const QRect targetCenterRect(targetCenterLeft, targetCenterTop, targetCenterWidth, targetCenterHeight); const QRect sourceCenterRect(sourceCenterLeft, sourceCenterTop, sourceCenterWidth, sourceCenterHeight); switch (rules.horizontal) { - case Qt::Stretch: + case Qt::StretchTile: switch (rules.vertical) { - case Qt::Stretch: // stretch stretch + case Qt::StretchTile: // stretch stretch qDrawPixmap(painter, targetCenterRect, pixmap, sourceCenterRect); break; - case Qt::Repeat: // stretch repeat + case Qt::RepeatTile: // stretch repeat qVerticalRepeat(painter, targetCenterRect, pixmap, sourceCenterRect, qDrawPixmap); break; - case Qt::Round: // stretch round + case Qt::RoundTile: // stretch round qVerticalRound(painter, targetCenterRect, pixmap, sourceCenterRect, qDrawPixmap); break; } break; - case Qt::Repeat: + case Qt::RepeatTile: switch (rules.vertical) { - case Qt::Stretch: // repeat stretch + case Qt::StretchTile: // repeat stretch qHorizontalRepeat(painter, targetCenterRect, pixmap, sourceCenterRect, qDrawPixmap); break; - case Qt::Repeat: // repeat repeat + case Qt::RepeatTile: // repeat repeat qVerticalRepeat(painter, targetCenterRect, pixmap, sourceCenterRect, qDrawHorizontallyRepeatedPixmap); break; - case Qt::Round: // repeat round + case Qt::RoundTile: // repeat round qVerticalRound(painter, targetCenterRect, pixmap, sourceCenterRect, qDrawHorizontallyRepeatedPixmap); break; } break; - case Qt::Round: + case Qt::RoundTile: switch (rules.vertical) { - case Qt::Stretch: // round stretch + case Qt::StretchTile: // round stretch qHorizontalRound(painter, targetCenterRect, pixmap, sourceCenterRect, qDrawPixmap); break; - case Qt::Repeat: // round repeat + case Qt::RepeatTile: // round repeat qHorizontalRound(painter, targetCenterRect, pixmap, sourceCenterRect, qDrawVerticallyRepeatedPixmap); break; - case Qt::Round: // round round + case Qt::RoundTile: // round round qHorizontalRound(painter, targetCenterRect, pixmap, sourceCenterRect, qDrawVerticallyRoundedPixmap); break; } diff --git a/src/gui/painting/qdrawutil.h b/src/gui/painting/qdrawutil.h index 3a2dd0e..22a57e9 100644 --- a/src/gui/painting/qdrawutil.h +++ b/src/gui/painting/qdrawutil.h @@ -137,22 +137,22 @@ struct QTileRules { inline QTileRules(Qt::TileRule horizontalRule, Qt::TileRule verticalRule) : horizontal(horizontalRule), vertical(verticalRule) {} - inline QTileRules(Qt::TileRule rule = Qt::Stretch) + inline QTileRules(Qt::TileRule rule = Qt::StretchTile) : horizontal(rule), vertical(rule) {} Qt::TileRule horizontal; Qt::TileRule vertical; }; -Q_GUI_EXPORT void qDrawBorderPixmap(QPainter *painter, - const QRect &targetRect, - const QMargins &targetMargins, +Q_GUI_EXPORT void qDrawBorderPixmap(QPainter *painter, + const QRect &targetRect, + const QMargins &targetMargins, const QPixmap &pixmap, - const QRect &sourceRect, - const QMargins &sourceMargins, + const QRect &sourceRect, + const QMargins &sourceMargins, const QTileRules &rules = QTileRules()); -inline void qDrawBorderPixmap(QPainter *painter, - const QRect &target, - const QMargins &margins, +inline void qDrawBorderPixmap(QPainter *painter, + const QRect &target, + const QMargins &margins, const QPixmap &pixmap) { qDrawBorderPixmap(painter, target, margins, pixmap, pixmap.rect(), margins); diff --git a/src/gui/styles/qstylesheetstyle.cpp b/src/gui/styles/qstylesheetstyle.cpp index 0f3a88b..707b05e 100644 --- a/src/gui/styles/qstylesheetstyle.cpp +++ b/src/gui/styles/qstylesheetstyle.cpp @@ -1126,7 +1126,7 @@ void QRenderRule::fixupBorder(int nativeWidth) void QRenderRule::drawBorderImage(QPainter *p, const QRect& rect) { static const Qt::TileRule tileMode2TileRule[] = { - Qt::Stretch, Qt::Round, Qt::Stretch, Qt::Repeat, Qt::Stretch }; + Qt::StretchTile, Qt::RoundTile, Qt::StretchTile, Qt::RepeatTile, Qt::StretchTile }; const QStyleSheetBorderImageData *borderImageData = border()->borderImage(); const int *targetBorders = border()->borders; -- cgit v0.12