diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2009-08-03 01:13:17 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2009-08-03 01:13:17 (GMT) |
commit | 8461a03460dff36c2317e7962485287d26e37295 (patch) | |
tree | aa36e311e195c713965b3cc35b1f1233a6a53349 | |
parent | f10e70cd5953681e5ad11a0ce59e357df82d6e6b (diff) | |
parent | 651b7aa72052faa90b3a268f00f82d56460166d3 (diff) | |
download | Qt-8461a03460dff36c2317e7962485287d26e37295.zip Qt-8461a03460dff36c2317e7962485287d26e37295.tar.gz Qt-8461a03460dff36c2317e7962485287d26e37295.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
-rw-r--r-- | src/declarative/fx/qfximage.cpp | 4 | ||||
-rw-r--r-- | src/declarative/fx/qfxitem.cpp | 4 | ||||
-rw-r--r-- | src/declarative/fx/qfxlineedit.h | 2 | ||||
-rw-r--r-- | src/declarative/fx/qfxlistview.cpp | 10 | ||||
-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 |
9 files changed, 148 insertions, 33 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/qfxitem.cpp b/src/declarative/fx/qfxitem.cpp index 8195edb..4479215 100644 --- a/src/declarative/fx/qfxitem.cpp +++ b/src/declarative/fx/qfxitem.cpp @@ -911,8 +911,6 @@ void QFxItem::keyPressEvent(QKeyEvent *event) QFxKeyEvent ke(*event); emit keyPress(&ke); event->setAccepted(ke.isAccepted()); - if (parentItem() && !ke.isAccepted()) - parentItem()->keyPressEvent(event); } /*! @@ -923,8 +921,6 @@ void QFxItem::keyReleaseEvent(QKeyEvent *event) QFxKeyEvent ke(*event); emit keyRelease(&ke); event->setAccepted(ke.isAccepted()); - if (parentItem() && !ke.isAccepted()) - parentItem()->keyReleaseEvent(event); } /*! diff --git a/src/declarative/fx/qfxlineedit.h b/src/declarative/fx/qfxlineedit.h index 0f56818..846ef52 100644 --- a/src/declarative/fx/qfxlineedit.h +++ b/src/declarative/fx/qfxlineedit.h @@ -60,7 +60,7 @@ class Q_DECLARATIVE_EXPORT QFxLineEdit : public QFxPaintedItem Q_OBJECT Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged) - Q_PROPERTY(QmlFont *font READ font) + Q_PROPERTY(QmlFont *font READ font CONSTANT) Q_PROPERTY(QColor color READ color WRITE setColor) Q_PROPERTY(QFxText::HAlignment hAlign READ hAlign WRITE setHAlign) diff --git a/src/declarative/fx/qfxlistview.cpp b/src/declarative/fx/qfxlistview.cpp index f976aec..1e75026 100644 --- a/src/declarative/fx/qfxlistview.cpp +++ b/src/declarative/fx/qfxlistview.cpp @@ -697,9 +697,11 @@ void QFxListViewPrivate::updateSections() if (visibleIndex > 0) prevSection = sectionAt(visibleIndex-1); for (int i = 0; i < visibleItems.count(); ++i) { - QFxListViewAttached *attached = visibleItems.at(i)->attached; - attached->setPrevSection(prevSection); - prevSection = attached->section(); + if (visibleItems.at(i)->index != -1) { + QFxListViewAttached *attached = visibleItems.at(i)->attached; + attached->setPrevSection(prevSection); + prevSection = attached->section(); + } } } } @@ -1528,6 +1530,7 @@ void QFxListView::itemsRemoved(int modelIndex, int count) d->updateCurrent(qMin(modelIndex, d->model->count()-1)); } d->layout(); + d->updateSections(); emit countChanged(); return; } @@ -1590,6 +1593,7 @@ void QFxListView::itemsRemoved(int modelIndex, int count) } else { // Correct the positioning of the items d->layout(); + d->updateSections(); } emit countChanged(); 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. |