summaryrefslogtreecommitdiffstats
path: root/src/declarative/util
diff options
context:
space:
mode:
authorBea Lam <bea.lam@nokia.com>2010-06-11 01:13:37 (GMT)
committerBea Lam <bea.lam@nokia.com>2010-06-11 01:57:02 (GMT)
commitab0d9f5efd274c8062a03fb3a1c83e4d16afd6fb (patch)
treeeccc035f60887e74cf5553763c64006db8c00f46 /src/declarative/util
parentaa30b0002573b5377b17f26f9fd72ca7d098a36c (diff)
downloadQt-ab0d9f5efd274c8062a03fb3a1c83e4d16afd6fb.zip
Qt-ab0d9f5efd274c8062a03fb3a1c83e4d16afd6fb.tar.gz
Qt-ab0d9f5efd274c8062a03fb3a1c83e4d16afd6fb.tar.bz2
Doc improvements, including snippet fixes, linking to examples, making
docs more consistent
Diffstat (limited to 'src/declarative/util')
-rw-r--r--src/declarative/util/qdeclarativefontloader.cpp21
-rw-r--r--src/declarative/util/qdeclarativesystempalette.cpp42
2 files changed, 40 insertions, 23 deletions
diff --git a/src/declarative/util/qdeclarativefontloader.cpp b/src/declarative/util/qdeclarativefontloader.cpp
index 3c2e239..83bdb17 100644
--- a/src/declarative/util/qdeclarativefontloader.cpp
+++ b/src/declarative/util/qdeclarativefontloader.cpp
@@ -79,18 +79,27 @@ public:
/*!
\qmlclass FontLoader QDeclarativeFontLoader
\since 4.7
- \brief This item allows using fonts by name or url.
+ \brief The FontLoader element allows fonts to be loaded by name or URL.
- Example:
+ The FontLoader element is used to load fonts by name or URL.
+
+ The \l status indicates when the font has been loaded, which is useful
+ for fonts loaded from remote sources.
+
+ For example:
\qml
import Qt 4.7
- FontLoader { id: fixedFont; name: "Courier" }
- FontLoader { id: webFont; source: "http://www.mysite.com/myfont.ttf" }
+ Column {
+ FontLoader { id: fixedFont; name: "Courier" }
+ FontLoader { id: webFont; source: "http://www.mysite.com/myfont.ttf" }
- Text { text: "Fixed-size font"; font.family: fixedFont.name }
- Text { text: "Fancy font"; font.family: webFont.name }
+ Text { text: "Fixed-size font"; font.family: fixedFont.name }
+ Text { text: "Fancy font"; font.family: webFont.name }
+ }
\endqml
+
+ \sa {declarative/text/fonts}{Fonts example}
*/
QDeclarativeFontLoader::QDeclarativeFontLoader(QObject *parent)
: QObject(*(new QDeclarativeFontLoaderPrivate), parent)
diff --git a/src/declarative/util/qdeclarativesystempalette.cpp b/src/declarative/util/qdeclarativesystempalette.cpp
index 6c62446..c334859 100644
--- a/src/declarative/util/qdeclarativesystempalette.cpp
+++ b/src/declarative/util/qdeclarativesystempalette.cpp
@@ -59,22 +59,25 @@ public:
/*!
\qmlclass SystemPalette QDeclarativeSystemPalette
\since 4.7
- \brief The SystemPalette item gives access to the Qt palettes.
- \sa QPalette
+ \brief The SystemPalette element provides access to the Qt palettes.
- Example:
- \qml
- SystemPalette { id: myPalette; colorGroup: Qt.Active }
+ The SystemPalette element provides access to the Qt application
+ palettes. This provides information about the standard colors used
+ for application windows, buttons and other features. These colors
+ are grouped into three \e {color groups}: \c Active, \c Inactive,
+ and \c Disabled. See the QPalette documentation for details about
+ color groups and the properties provided by SystemPalette.
- Rectangle {
- width: 640; height: 480
- color: myPalette.window
- Text {
- anchors.fill: parent
- text: "Hello!"; color: myPalette.windowText
- }
- }
- \endqml
+ This can be used to color items in a way that provides a more
+ native look and feel.
+
+ The following example creates a palette from the \c Active color
+ group and uses this to color the window and text items
+ appropriately:
+
+ \snippet doc/src/snippets/declarative/systempalette.qml 0
+
+ \sa QPalette
*/
QDeclarativeSystemPalette::QDeclarativeSystemPalette(QObject *parent)
: QObject(*(new QDeclarativeSystemPalettePrivate), parent)
@@ -258,10 +261,15 @@ QColor QDeclarativeSystemPalette::highlightedText() const
}
/*!
- \qmlproperty QDeclarativeSystemPalette::ColorGroup SystemPalette::colorGroup
+ \qmlproperty enumeration SystemPalette::colorGroup
+
+ The color group of the palette. This can be one of:
- The color group of the palette. It can be Active, Inactive or Disabled.
- Active is the default.
+ \list
+ \o SystemPalette.Active (default)
+ \o SystemPalette.Inactive
+ \o SystemPalette.Disabled
+ \endlist
\sa QPalette::ColorGroup
*/