summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Bodson <yann.bodson@nokia.com>2009-08-03 03:45:35 (GMT)
committerYann Bodson <yann.bodson@nokia.com>2009-08-03 03:45:35 (GMT)
commit77e802215ad8d3d94fb1821abf1932540ee7fb9f (patch)
treedb9ed8c03fd4c28afd9c5e4a362f366686d20d6e
parentc823c27033254d3561982678fb32a4485d844d9a (diff)
downloadQt-77e802215ad8d3d94fb1821abf1932540ee7fb9f.zip
Qt-77e802215ad8d3d94fb1821abf1932540ee7fb9f.tar.gz
Qt-77e802215ad8d3d94fb1821abf1932540ee7fb9f.tar.bz2
Use QPalette::ColorGroup directly.
-rw-r--r--src/declarative/util/qmlpalette.cpp18
-rw-r--r--src/declarative/util/qmlpalette.h10
2 files changed, 10 insertions, 18 deletions
diff --git a/src/declarative/util/qmlpalette.cpp b/src/declarative/util/qmlpalette.cpp
index 6fade03..3756878 100644
--- a/src/declarative/util/qmlpalette.cpp
+++ b/src/declarative/util/qmlpalette.cpp
@@ -260,27 +260,23 @@ QColor QmlPalette::darker(const QColor& color) const
}
/*!
- \qmlproperty enum Palette::colorGroup
+ \qmlproperty QPalette::ColorGroup Palette::colorGroup
- The color group of the palette. It can be one of:
- \list
- \o Active - used for the window that has focus.
- \o Inactive - used for other windows.
- \o Disabled - used for widgets that are disabled for some reason.
- \endlist
+ The color group of the palette. It can be Active, Inactive or Disabled.
+ Active is the default.
\sa QPalette::ColorGroup
*/
-QmlPalette::ColorGroup QmlPalette::colorGroup() const
+QPalette::ColorGroup QmlPalette::colorGroup() const
{
Q_D(const QmlPalette);
- return (QmlPalette::ColorGroup)int(d->group);
+ return d->group;
}
-void QmlPalette::setColorGroup(ColorGroup colorGroup)
+void QmlPalette::setColorGroup(QPalette::ColorGroup colorGroup)
{
Q_D(QmlPalette);
- d->group = (QPalette::ColorGroup)int(colorGroup);
+ d->group = colorGroup;
emit paletteChanged();
}
diff --git a/src/declarative/util/qmlpalette.h b/src/declarative/util/qmlpalette.h
index 7de5e0e..4c2cc31 100644
--- a/src/declarative/util/qmlpalette.h
+++ b/src/declarative/util/qmlpalette.h
@@ -57,9 +57,8 @@ class Q_DECLARATIVE_EXPORT QmlPalette : public QObject
{
Q_OBJECT
Q_DECLARE_PRIVATE(QmlPalette)
- Q_ENUMS(ColorGroup)
- Q_PROPERTY(ColorGroup colorGroup READ colorGroup WRITE setColorGroup NOTIFY paletteChanged)
+ Q_PROPERTY(QPalette::ColorGroup colorGroup READ colorGroup WRITE setColorGroup NOTIFY paletteChanged)
Q_PROPERTY(QColor window READ window NOTIFY paletteChanged)
Q_PROPERTY(QColor windowText READ windowText NOTIFY paletteChanged)
Q_PROPERTY(QColor base READ base NOTIFY paletteChanged)
@@ -78,9 +77,6 @@ public:
QmlPalette(QObject *parent=0);
~QmlPalette();
- enum ColorGroup { Disabled = QPalette::Disabled, Active = QPalette::Active,
- Inactive = QPalette::Inactive, Normal = QPalette::Normal };
-
QColor window() const;
QColor windowText() const;
@@ -99,8 +95,8 @@ public:
QColor highlight() const;
QColor highlightedText() const;
- ColorGroup colorGroup() const;
- void setColorGroup(ColorGroup);
+ QPalette::ColorGroup colorGroup() const;
+ void setColorGroup(QPalette::ColorGroup);
// FIXME: Move to utility class?
Q_INVOKABLE QColor lighter(const QColor&) const;