diff options
author | Jason McDonald <jason.mcdonald@nokia.com> | 2012-04-11 22:22:26 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-04-12 10:40:23 +0200 |
commit | 4f929e01e0dbdbbc618083e5a10cdfb7edc7d9bc (patch) | |
tree | 5b04c8809b25bd81021b22baa9194f560735f4c3 /src/widgets/dialogs/qcolordialog.cpp | |
parent | 1035c93245ef299c2f29be5b119b736430e81dc3 (diff) |
Address Qt 5 to-do comment for QColorDialog.
- change customColor() to return QColor instead of QRgb.
- change setCustomColor() and setStandardColor() to take
a QColor instead of QRgb.
- add missing standardColor() getter method.
Task-number: QTBUG-25087
Change-Id: Ic6adb2031ef47f5e9b15fa3560a5322e6847c0bb
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src/widgets/dialogs/qcolordialog.cpp')
-rw-r--r-- | src/widgets/dialogs/qcolordialog.cpp | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/src/widgets/dialogs/qcolordialog.cpp b/src/widgets/dialogs/qcolordialog.cpp index 569a10653f..606b9b00f7 100644 --- a/src/widgets/dialogs/qcolordialog.cpp +++ b/src/widgets/dialogs/qcolordialog.cpp @@ -433,36 +433,45 @@ int QColorDialog::customCount() /*! \since 4.5 - Returns the custom color at the given \a index as a QRgb value. + Returns the custom color at the given \a index as a QColor value. */ -QRgb QColorDialog::customColor(int index) +QColor QColorDialog::customColor(int index) { - return QColorDialogOptions::customColor(index); + return QColor(QColorDialogOptions::customColor(index)); } /*! - Sets the custom color at \a index to the QRgb \a color value. + Sets the custom color at \a index to the QColor \a color value. \note This function does not apply to the Native Color Dialog on the Mac OS X platform. If you still require this function, use the QColorDialog::DontUseNativeDialog option. */ -void QColorDialog::setCustomColor(int index, QRgb color) +void QColorDialog::setCustomColor(int index, QColor color) { - QColorDialogOptions::setCustomColor(index, color); + QColorDialogOptions::setCustomColor(index, color.rgba()); } /*! - Sets the standard color at \a index to the QRgb \a color value. + \since 5.0 + + Returns the standard color at the given \a index as a QColor value. +*/ +QColor QColorDialog::standardColor(int index) +{ + return QColor(QColorDialogOptions::standardColor(index)); +} + +/*! + Sets the standard color at \a index to the QColor \a color value. \note This function does not apply to the Native Color Dialog on the Mac OS X platform. If you still require this function, use the QColorDialog::DontUseNativeDialog option. */ - -void QColorDialog::setStandardColor(int index, QRgb color) +void QColorDialog::setStandardColor(int index, QColor color) { - QColorDialogOptions::setStandardColor(index, color); + QColorDialogOptions::setStandardColor(index, color.rgba()); } static inline void rgb2hsv(QRgb rgb, int &h, int &s, int &v) |