summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Bodson <yann.bodson@nokia.com>2009-07-31 00:51:42 (GMT)
committerYann Bodson <yann.bodson@nokia.com>2009-07-31 00:51:42 (GMT)
commita80468f33d8216ab06c23551b9f6a7b2722ddc14 (patch)
treef65181eda8ff95c6a6aed122b19ab7495df9f36f
parente74dd280af6ea8d7b30369e02344a473478a9ccc (diff)
downloadQt-a80468f33d8216ab06c23551b9f6a7b2722ddc14.zip
Qt-a80468f33d8216ab06c23551b9f6a7b2722ddc14.tar.gz
Qt-a80468f33d8216ab06c23551b9f6a7b2722ddc14.tar.bz2
Docs
-rw-r--r--src/declarative/util/qmlpalette.cpp34
-rw-r--r--src/declarative/util/qmlpalette.h10
2 files changed, 30 insertions, 14 deletions
diff --git a/src/declarative/util/qmlpalette.cpp b/src/declarative/util/qmlpalette.cpp
index 3a6dadc..25576f1 100644
--- a/src/declarative/util/qmlpalette.cpp
+++ b/src/declarative/util/qmlpalette.cpp
@@ -55,10 +55,24 @@ public:
QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Palette,QmlPalette)
/*!
- \internal
- \class QmlPalette
+ \qmlclass Palette QmlPalette
\ingroup group_utility
- \brief The QmlPalette class gives access to the Qt palettes.
+ \brief The Palette item gives access to the Qt palettes.
+ \sa QPalette
+
+
+ \code
+ Palette { id: MyPalette; colorGroup: "Active" }
+
+ Rect {
+ width: 640; height: 480
+ color: MyPalette.window
+ Text {
+ anchors.fill: parent
+ text: "Hello!"; color: MyPalette.windowText
+ }
+ }
+ \endcode
*/
QmlPalette::QmlPalette(QObject *parent)
: QObject(*(new QmlPalettePrivate), parent)
@@ -73,12 +87,20 @@ QmlPalette::~QmlPalette()
{
}
+/*!
+ \qmlproperty Palette::window
+ \brief The window (general background) color of the current color group.
+*/
QColor QmlPalette::window() const
{
Q_D(const QmlPalette);
return d->palette.color(d->group, QPalette::Window);
}
+/*!
+ \qmlproperty Palette::windowText
+ \brief The window text (general foreground) color of the current color group.
+*/
QColor QmlPalette::windowText() const
{
Q_D(const QmlPalette);
@@ -174,12 +196,6 @@ void QmlPalette::setColorGroup(ColorGroup colorGroup)
emit paletteChanged();
}
-QPalette QmlPalette::palette() const
-{
- Q_D(const QmlPalette);
- return d->palette;
-}
-
bool QmlPalette::eventFilter(QObject *watched, QEvent *event)
{
if (watched == qApp) {
diff --git a/src/declarative/util/qmlpalette.h b/src/declarative/util/qmlpalette.h
index 3030557..b601881 100644
--- a/src/declarative/util/qmlpalette.h
+++ b/src/declarative/util/qmlpalette.h
@@ -99,19 +99,19 @@ public:
QColor highlight() const;
QColor highlightedText() const;
- QPalette palette() const;
-
ColorGroup colorGroup() const;
void setColorGroup(ColorGroup);
- bool virtual eventFilter(QObject *watched, QEvent *event);
- bool virtual event(QEvent *event);
-
Q_INVOKABLE QColor lighter(const QColor&) const;
Q_INVOKABLE QColor darker(const QColor&) const;
Q_SIGNALS:
void paletteChanged();
+
+private:
+ bool eventFilter(QObject *watched, QEvent *event);
+ bool event(QEvent *event);
+
};
QT_END_NAMESPACE