diff options
author | Martin Jones <martin.jones@nokia.com> | 2009-07-29 01:36:23 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2009-07-29 01:36:23 (GMT) |
commit | 452a5c855bdccc8bbe0c95f7cb74c4309d0ecc64 (patch) | |
tree | 44621312c2a44a2645d9cadd786bf2d013883632 /src/declarative/util | |
parent | b155698f5408b9753a6b28e6c2833d83aff2ceb4 (diff) | |
parent | 93ad359f93de72ef8c4d5f0073dc20ba22b9023c (diff) | |
download | Qt-452a5c855bdccc8bbe0c95f7cb74c4309d0ecc64.zip Qt-452a5c855bdccc8bbe0c95f7cb74c4309d0ecc64.tar.gz Qt-452a5c855bdccc8bbe0c95f7cb74c4309d0ecc64.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src/declarative/util')
-rw-r--r-- | src/declarative/util/qmlpalette.cpp | 11 | ||||
-rw-r--r-- | src/declarative/util/qmlpalette.h | 16 |
2 files changed, 20 insertions, 7 deletions
diff --git a/src/declarative/util/qmlpalette.cpp b/src/declarative/util/qmlpalette.cpp index 01b5ad3..3a6dadc 100644 --- a/src/declarative/util/qmlpalette.cpp +++ b/src/declarative/util/qmlpalette.cpp @@ -161,10 +161,17 @@ QColor QmlPalette::darker(const QColor& color) const return color.darker(); } -void QmlPalette::setColorGroup(QPalette::ColorGroup colorGroup) +QmlPalette::ColorGroup QmlPalette::colorGroup() const +{ + Q_D(const QmlPalette); + return (QmlPalette::ColorGroup)int(d->group); +} + +void QmlPalette::setColorGroup(ColorGroup colorGroup) { Q_D(QmlPalette); - d->group = colorGroup; + d->group = (QPalette::ColorGroup)int(colorGroup); + emit paletteChanged(); } QPalette QmlPalette::palette() const diff --git a/src/declarative/util/qmlpalette.h b/src/declarative/util/qmlpalette.h index 7f26f9a..3030557 100644 --- a/src/declarative/util/qmlpalette.h +++ b/src/declarative/util/qmlpalette.h @@ -57,11 +57,9 @@ class Q_DECLARATIVE_EXPORT QmlPalette : public QObject { Q_OBJECT Q_DECLARE_PRIVATE(QmlPalette) + Q_ENUMS(ColorGroup) -public: - QmlPalette(QObject *parent=0); - ~QmlPalette(); - + Q_PROPERTY(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) @@ -76,6 +74,13 @@ public: Q_PROPERTY(QColor highlight READ highlight NOTIFY paletteChanged) Q_PROPERTY(QColor highlightedText READ highlightedText NOTIFY paletteChanged) +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; @@ -96,7 +101,8 @@ public: QPalette palette() const; - void setColorGroup(QPalette::ColorGroup); + ColorGroup colorGroup() const; + void setColorGroup(ColorGroup); bool virtual eventFilter(QObject *watched, QEvent *event); bool virtual event(QEvent *event); |