diff options
author | Yann Bodson <yann.bodson@nokia.com> | 2009-08-01 13:58:29 (GMT) |
---|---|---|
committer | Yann Bodson <yann.bodson@nokia.com> | 2009-08-01 13:58:29 (GMT) |
commit | 28c809e996963ba938ce05590da44d260ce70c75 (patch) | |
tree | 11139b50159a66ef5c11061f8d311a794c6b5c25 /src | |
parent | fb496d96b65a9e470d46d73ede00cf58a519a80f (diff) | |
download | Qt-28c809e996963ba938ce05590da44d260ce70c75.zip Qt-28c809e996963ba938ce05590da44d260ce70c75.tar.gz Qt-28c809e996963ba938ce05590da44d260ce70c75.tar.bz2 |
Documentation
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/fx/qfximage.cpp | 4 | ||||
-rw-r--r-- | src/declarative/fx/qfxloader.cpp | 2 | ||||
-rw-r--r-- | src/declarative/util/qmlfontfamily.cpp | 38 | ||||
-rw-r--r-- | src/declarative/util/qmlpalette.cpp | 118 | ||||
-rw-r--r-- | src/declarative/util/qmlpalette.h | 1 | ||||
-rw-r--r-- | src/declarative/util/qmlscript.cpp | 2 |
6 files changed, 140 insertions, 25 deletions
diff --git a/src/declarative/fx/qfximage.cpp b/src/declarative/fx/qfximage.cpp index 605e1ea..5976cd5 100644 --- a/src/declarative/fx/qfximage.cpp +++ b/src/declarative/fx/qfximage.cpp @@ -455,7 +455,7 @@ void QFxImage::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWidget *) \list \o Null - no image has been set \o Ready - the image has been loaded - \o Loading - the images is currently being loaded + \o Loading - the image is currently being loaded \o Error - an error occurred while loading the image \endlist @@ -484,7 +484,7 @@ qreal QFxImage::progress() const } /*! - \qmlproperty string Image::source + \qmlproperty url Image::source Image can handle any image format supported by Qt, loaded from any URL scheme supported by Qt. diff --git a/src/declarative/fx/qfxloader.cpp b/src/declarative/fx/qfxloader.cpp index 7cf85af..6d06ee9 100644 --- a/src/declarative/fx/qfxloader.cpp +++ b/src/declarative/fx/qfxloader.cpp @@ -174,7 +174,7 @@ void QFxLoaderPrivate::_q_sourceLoaded() } /*! - \qmlproperty url Loader::item + \qmlproperty Item Loader::item This property holds the top-level item created from source. */ QFxItem *QFxLoader::item() const diff --git a/src/declarative/util/qmlfontfamily.cpp b/src/declarative/util/qmlfontfamily.cpp index a82527b..73688c1 100644 --- a/src/declarative/util/qmlfontfamily.cpp +++ b/src/declarative/util/qmlfontfamily.cpp @@ -74,12 +74,13 @@ QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,FontFamily,QmlFontFamily) \ingroup group_utility \brief This item allows using fonts by name or url. + Example: \code - FontFamily { id: FixedFont; name: "Courier" } - FontFamily { id: WebFont; source: "http://www.mysite.com/myfont.ttf" } + FontFamily { id: FixedFont; name: "Courier" } + FontFamily { 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 } \endcode */ QmlFontFamily::QmlFontFamily(QObject *parent) @@ -92,8 +93,8 @@ QmlFontFamily::~QmlFontFamily() } /*! - \qmlproperty FontFamily::source - The source for the font. + \qmlproperty url FontFamily::source + The url of the font to load. */ QUrl QmlFontFamily::source() const { @@ -126,6 +127,20 @@ void QmlFontFamily::setSource(const QUrl &url) } } +/*! + \qmlproperty string FontFamily::name + + This property holds the name of the font family. + It is set automatically when a font is loaded using the \c url property. + + Use this to set the \c font.family property of a \c Text item. + + Example: + \qml + FontFamily { id: WebFont; source: "http://www.mysite.com/myfont.ttf" } + Text { text: "Fancy font"; font.family: WebFont.name } + \endqml +*/ QString QmlFontFamily::name() const { Q_D(const QmlFontFamily); @@ -141,6 +156,17 @@ void QmlFontFamily::setName(const QString &name) emit nameChanged(); } +/*! + \qmlproperty enum FontFamily::status + + This property holds the status of font loading. It can be one of: + \list + \o Null - no font has been set + \o Ready - the font has been loaded + \o Loading - the font is currently being loaded + \o Error - an error occurred while loading the font + \endlist +*/ QmlFontFamily::Status QmlFontFamily::status() const { Q_D(const QmlFontFamily); diff --git a/src/declarative/util/qmlpalette.cpp b/src/declarative/util/qmlpalette.cpp index 25576f1..6fade03 100644 --- a/src/declarative/util/qmlpalette.cpp +++ b/src/declarative/util/qmlpalette.cpp @@ -60,19 +60,19 @@ QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Palette,QmlPalette) \brief The Palette item gives access to the Qt palettes. \sa QPalette - + Example: \code - Palette { id: MyPalette; colorGroup: "Active" } - - Rect { - width: 640; height: 480 - color: MyPalette.window - Text { - anchors.fill: parent - text: "Hello!"; color: MyPalette.windowText - } + Palette { id: MyPalette; colorGroup: "Active" } + + Rect { + width: 640; height: 480 + color: MyPalette.window + Text { + anchors.fill: parent + text: "Hello!"; color: MyPalette.windowText } - \endcode + } + \endcode */ QmlPalette::QmlPalette(QObject *parent) : QObject(*(new QmlPalettePrivate), parent) @@ -88,8 +88,10 @@ QmlPalette::~QmlPalette() } /*! - \qmlproperty Palette::window - \brief The window (general background) color of the current color group. + \qmlproperty color Palette::window + The window (general background) color of the current color group. + + \sa QPalette::ColorRole */ QColor QmlPalette::window() const { @@ -98,8 +100,10 @@ QColor QmlPalette::window() const } /*! - \qmlproperty Palette::windowText - \brief The window text (general foreground) color of the current color group. + \qmlproperty color Palette::windowText + The window text (general foreground) color of the current color group. + + \sa QPalette::ColorRole */ QColor QmlPalette::windowText() const { @@ -107,82 +111,166 @@ QColor QmlPalette::windowText() const return d->palette.color(d->group, QPalette::WindowText); } +/*! + \qmlproperty color Palette::base + The base color of the current color group. + + \sa QPalette::ColorRole +*/ QColor QmlPalette::base() const { Q_D(const QmlPalette); return d->palette.color(d->group, QPalette::Base); } +/*! + \qmlproperty color Palette::alternateBase + The alternate base color of the current color group. + + \sa QPalette::ColorRole +*/ QColor QmlPalette::alternateBase() const { Q_D(const QmlPalette); return d->palette.color(d->group, QPalette::AlternateBase); } +/*! + \qmlproperty color Palette::button + The button color of the current color group. + + \sa QPalette::ColorRole +*/ QColor QmlPalette::button() const { Q_D(const QmlPalette); return d->palette.color(d->group, QPalette::Button); } +/*! + \qmlproperty color Palette::buttonText + The button text foreground color of the current color group. + + \sa QPalette::ColorRole +*/ QColor QmlPalette::buttonText() const { Q_D(const QmlPalette); return d->palette.color(d->group, QPalette::ButtonText); } +/*! + \qmlproperty color Palette::light + The light color of the current color group. + + \sa QPalette::ColorRole +*/ QColor QmlPalette::light() const { Q_D(const QmlPalette); return d->palette.color(d->group, QPalette::Light); } +/*! + \qmlproperty color Palette::midlight + The midlight color of the current color group. + + \sa QPalette::ColorRole +*/ QColor QmlPalette::midlight() const { Q_D(const QmlPalette); return d->palette.color(d->group, QPalette::Midlight); } +/*! + \qmlproperty color Palette::dark + The dark color of the current color group. + + \sa QPalette::ColorRole +*/ QColor QmlPalette::dark() const { Q_D(const QmlPalette); return d->palette.color(d->group, QPalette::Dark); } +/*! + \qmlproperty color Palette::mid + The mid color of the current color group. + + \sa QPalette::ColorRole +*/ QColor QmlPalette::mid() const { Q_D(const QmlPalette); return d->palette.color(d->group, QPalette::Mid); } +/*! + \qmlproperty color Palette::shadow + The shadow color of the current color group. + + \sa QPalette::ColorRole +*/ QColor QmlPalette::shadow() const { Q_D(const QmlPalette); return d->palette.color(d->group, QPalette::Shadow); } +/*! + \qmlproperty color Palette::highlight + The highlight color of the current color group. + + \sa QPalette::ColorRole +*/ QColor QmlPalette::highlight() const { Q_D(const QmlPalette); return d->palette.color(d->group, QPalette::Highlight); } +/*! + \qmlproperty color Palette::highlightedText + The highlighted text color of the current color group. + + \sa QPalette::ColorRole +*/ QColor QmlPalette::highlightedText() const { Q_D(const QmlPalette); return d->palette.color(d->group, QPalette::HighlightedText); } +/*! + \qmlproperty color Palette::lighter +*/ QColor QmlPalette::lighter(const QColor& color) const { return color.lighter(); } +/*! + \qmlproperty color Palette::darker +*/ QColor QmlPalette::darker(const QColor& color) const { return color.darker(); } +/*! + \qmlproperty enum 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 + + \sa QPalette::ColorGroup +*/ QmlPalette::ColorGroup QmlPalette::colorGroup() const { Q_D(const QmlPalette); diff --git a/src/declarative/util/qmlpalette.h b/src/declarative/util/qmlpalette.h index b601881..7de5e0e 100644 --- a/src/declarative/util/qmlpalette.h +++ b/src/declarative/util/qmlpalette.h @@ -102,6 +102,7 @@ public: ColorGroup colorGroup() const; void setColorGroup(ColorGroup); + // FIXME: Move to utility class? Q_INVOKABLE QColor lighter(const QColor&) const; Q_INVOKABLE QColor darker(const QColor&) const; diff --git a/src/declarative/util/qmlscript.cpp b/src/declarative/util/qmlscript.cpp index ca9aad5..5651981 100644 --- a/src/declarative/util/qmlscript.cpp +++ b/src/declarative/util/qmlscript.cpp @@ -127,7 +127,7 @@ void QmlScript::setScript(const QString &script) } /*! - \qmlproperty string Script::source + \qmlproperty url Script::source Setting this property causes the Script element to read JavaScript code from the file specified. |