diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-11-02 09:11:55 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-11-02 09:11:55 (GMT) |
commit | 9e949e41c2751a0c27ac4bb6edae8e7cfc59851a (patch) | |
tree | a307dd40b6642425e005839fc209dd8b31618885 /src | |
parent | 8b4cbdbd3bfcdc98ca5f8e728b004596a1213127 (diff) | |
parent | 7f86f70e98e0b826ad35b8bb744305b5f4dbbfe8 (diff) | |
download | Qt-9e949e41c2751a0c27ac4bb6edae8e7cfc59851a.zip Qt-9e949e41c2751a0c27ac4bb6edae8e7cfc59851a.tar.gz Qt-9e949e41c2751a0c27ac4bb6edae8e7cfc59851a.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/graphicsitems/graphicsitems.pri | 6 | ||||
-rw-r--r-- | src/declarative/graphicsitems/qmlgraphicslistview.cpp | 2 | ||||
-rw-r--r-- | src/declarative/graphicsitems/qmlgraphicsrectangle.cpp (renamed from src/declarative/graphicsitems/qmlgraphicsrect.cpp) | 74 | ||||
-rw-r--r-- | src/declarative/graphicsitems/qmlgraphicsrectangle_p.h (renamed from src/declarative/graphicsitems/qmlgraphicsrect_p.h) | 14 | ||||
-rw-r--r-- | src/declarative/graphicsitems/qmlgraphicsrectangle_p_p.h (renamed from src/declarative/graphicsitems/qmlgraphicsrect_p_p.h) | 14 | ||||
-rw-r--r-- | src/declarative/util/qmllistmodel.cpp | 4 | ||||
-rw-r--r-- | src/declarative/util/qmllistmodel_p.h | 5 | ||||
-rw-r--r-- | src/declarative/util/qmlstate_p.h | 2 |
8 files changed, 63 insertions, 58 deletions
diff --git a/src/declarative/graphicsitems/graphicsitems.pri b/src/declarative/graphicsitems/graphicsitems.pri index 8eac580..15d775c 100644 --- a/src/declarative/graphicsitems/graphicsitems.pri +++ b/src/declarative/graphicsitems/graphicsitems.pri @@ -28,8 +28,8 @@ HEADERS += \ graphicsitems/qmlgraphicspath_p_p.h \ graphicsitems/qmlgraphicspathview_p.h \ graphicsitems/qmlgraphicspathview_p_p.h \ - graphicsitems/qmlgraphicsrect_p.h \ - graphicsitems/qmlgraphicsrect_p_p.h \ + graphicsitems/qmlgraphicsrectangle_p.h \ + graphicsitems/qmlgraphicsrectangle_p_p.h \ graphicsitems/qmlgraphicsrepeater_p.h \ graphicsitems/qmlgraphicsrepeater_p_p.h \ graphicsitems/qmlgraphicsscalegrid_p_p.h \ @@ -64,7 +64,7 @@ SOURCES += \ graphicsitems/qmlgraphicsmouseregion.cpp \ graphicsitems/qmlgraphicspath.cpp \ graphicsitems/qmlgraphicspathview.cpp \ - graphicsitems/qmlgraphicsrect.cpp \ + graphicsitems/qmlgraphicsrectangle.cpp \ graphicsitems/qmlgraphicsrepeater.cpp \ graphicsitems/qmlgraphicsscalegrid.cpp \ graphicsitems/qmlgraphicstextinput.cpp \ diff --git a/src/declarative/graphicsitems/qmlgraphicslistview.cpp b/src/declarative/graphicsitems/qmlgraphicslistview.cpp index dc8bab2..cf399f9 100644 --- a/src/declarative/graphicsitems/qmlgraphicslistview.cpp +++ b/src/declarative/graphicsitems/qmlgraphicslistview.cpp @@ -994,7 +994,7 @@ QmlGraphicsListView::~QmlGraphicsListView() /*! \qmlattachedproperty bool ListView::isCurrentItem - This attched property is true if this delegate is the current item; otherwise false. + This attached property is true if this delegate is the current item; otherwise false. It is attached to each instance of the delegate. diff --git a/src/declarative/graphicsitems/qmlgraphicsrect.cpp b/src/declarative/graphicsitems/qmlgraphicsrectangle.cpp index 605e82c..8ae40b7 100644 --- a/src/declarative/graphicsitems/qmlgraphicsrect.cpp +++ b/src/declarative/graphicsitems/qmlgraphicsrectangle.cpp @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#include "qmlgraphicsrect_p.h" -#include "qmlgraphicsrect_p_p.h" +#include "qmlgraphicsrectangle_p.h" +#include "qmlgraphicsrectangle_p_p.h" #include <QPainter> #include <QtCore/qmath.h> @@ -149,10 +149,10 @@ void QmlGraphicsGradient::doUpdate() emit updated(); } -QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Rectangle,QmlGraphicsRect) +QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Rectangle,QmlGraphicsRectangle) /*! - \qmlclass Rectangle QmlGraphicsRect + \qmlclass Rectangle QmlGraphicsRectangle \brief The Rectangle item allows you to add rectangles to a scene. \inherits Item @@ -175,28 +175,28 @@ QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Rectangle,QmlGraphicsRect) /*! \internal - \class QmlGraphicsRect - \brief The QmlGraphicsRect class provides a rectangle item that you can add to a QmlView. + \class QmlGraphicsRectangle + \brief The QmlGraphicsRectangle class provides a rectangle item that you can add to a QmlView. */ -QmlGraphicsRect::QmlGraphicsRect(QmlGraphicsItem *parent) - : QmlGraphicsItem(*(new QmlGraphicsRectPrivate), parent) +QmlGraphicsRectangle::QmlGraphicsRectangle(QmlGraphicsItem *parent) + : QmlGraphicsItem(*(new QmlGraphicsRectanglePrivate), parent) { - Q_D(QmlGraphicsRect); + Q_D(QmlGraphicsRectangle); d->init(); setFlag(QGraphicsItem::ItemHasNoContents, false); } -QmlGraphicsRect::QmlGraphicsRect(QmlGraphicsRectPrivate &dd, QmlGraphicsItem *parent) +QmlGraphicsRectangle::QmlGraphicsRectangle(QmlGraphicsRectanglePrivate &dd, QmlGraphicsItem *parent) : QmlGraphicsItem(dd, parent) { - Q_D(QmlGraphicsRect); + Q_D(QmlGraphicsRectangle); d->init(); setFlag(QGraphicsItem::ItemHasNoContents, false); } -void QmlGraphicsRect::doUpdate() +void QmlGraphicsRectangle::doUpdate() { - Q_D(QmlGraphicsRect); + Q_D(QmlGraphicsRectangle); d->rectImage = QPixmap(); const int pw = d->pen && d->pen->isValid() ? d->pen->width() : 0; d->setPaintMargin((pw+1)/2); @@ -214,9 +214,9 @@ void QmlGraphicsRect::doUpdate() To keep the border smooth (rather than blurry), odd widths cause the rectangle to be painted at a half-pixel offset; */ -QmlGraphicsPen *QmlGraphicsRect::border() +QmlGraphicsPen *QmlGraphicsRectangle::border() { - Q_D(QmlGraphicsRect); + Q_D(QmlGraphicsRectangle); return d->getPen(); } @@ -254,15 +254,15 @@ QmlGraphicsPen *QmlGraphicsRect::border() \sa Gradient, color */ -QmlGraphicsGradient *QmlGraphicsRect::gradient() const +QmlGraphicsGradient *QmlGraphicsRectangle::gradient() const { - Q_D(const QmlGraphicsRect); + Q_D(const QmlGraphicsRectangle); return d->gradient; } -void QmlGraphicsRect::setGradient(QmlGraphicsGradient *gradient) +void QmlGraphicsRectangle::setGradient(QmlGraphicsGradient *gradient) { - Q_D(QmlGraphicsRect); + Q_D(QmlGraphicsRectangle); if (d->gradient == gradient) return; if (d->gradient) @@ -282,15 +282,15 @@ void QmlGraphicsRect::setGradient(QmlGraphicsGradient *gradient) painted as a normal rectangle. The same radius is used by all 4 corners; there is currently no way to specify different radii for different corners. */ -qreal QmlGraphicsRect::radius() const +qreal QmlGraphicsRectangle::radius() const { - Q_D(const QmlGraphicsRect); + Q_D(const QmlGraphicsRectangle); return d->radius; } -void QmlGraphicsRect::setRadius(qreal radius) +void QmlGraphicsRectangle::setRadius(qreal radius) { - Q_D(QmlGraphicsRect); + Q_D(QmlGraphicsRectangle); if (d->radius == radius) return; @@ -316,15 +316,15 @@ void QmlGraphicsRect::setRadius(qreal radius) If both a gradient and a color are specified, the gradient will be used. */ -QColor QmlGraphicsRect::color() const +QColor QmlGraphicsRectangle::color() const { - Q_D(const QmlGraphicsRect); + Q_D(const QmlGraphicsRectangle); return d->color; } -void QmlGraphicsRect::setColor(const QColor &c) +void QmlGraphicsRectangle::setColor(const QColor &c) { - Q_D(QmlGraphicsRect); + Q_D(QmlGraphicsRectangle); if (d->color == c) return; @@ -334,9 +334,9 @@ void QmlGraphicsRect::setColor(const QColor &c) emit colorChanged(); } -void QmlGraphicsRect::generateRoundedRect() +void QmlGraphicsRectangle::generateRoundedRect() { - Q_D(QmlGraphicsRect); + Q_D(QmlGraphicsRectangle); if (d->rectImage.isNull()) { const int pw = d->pen && d->pen->isValid() ? d->pen->width() : 0; const int radius = qCeil(d->radius); //ensure odd numbered width/height so we get 1-pixel center @@ -358,9 +358,9 @@ void QmlGraphicsRect::generateRoundedRect() } } -void QmlGraphicsRect::generateBorderedRect() +void QmlGraphicsRectangle::generateBorderedRect() { - Q_D(QmlGraphicsRect); + Q_D(QmlGraphicsRectangle); if (d->rectImage.isNull()) { const int pw = d->pen && d->pen->isValid() ? d->pen->width() : 0; d->rectImage = QPixmap(pw*2 + 3, pw*2 + 3); @@ -382,9 +382,9 @@ void QmlGraphicsRect::generateBorderedRect() } } -void QmlGraphicsRect::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWidget *) +void QmlGraphicsRectangle::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWidget *) { - Q_D(QmlGraphicsRect); + Q_D(QmlGraphicsRectangle); if (d->radius > 0 || (d->pen && d->pen->isValid()) || (d->gradient && d->gradient->gradient()) ) { drawRect(*p); @@ -399,9 +399,9 @@ void QmlGraphicsRect::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWidg } } -void QmlGraphicsRect::drawRect(QPainter &p) +void QmlGraphicsRectangle::drawRect(QPainter &p) { - Q_D(QmlGraphicsRect); + Q_D(QmlGraphicsRectangle); if (d->gradient && d->gradient->gradient()) { // XXX This path is still slower than the image path // Image path won't work for gradients though @@ -466,9 +466,9 @@ void QmlGraphicsRect::drawRect(QPainter &p) \image rect-smooth.png */ -QRectF QmlGraphicsRect::boundingRect() const +QRectF QmlGraphicsRectangle::boundingRect() const { - Q_D(const QmlGraphicsRect); + Q_D(const QmlGraphicsRectangle); return QRectF(-d->paintmargin, -d->paintmargin, d->width+d->paintmargin*2, d->height+d->paintmargin*2); } diff --git a/src/declarative/graphicsitems/qmlgraphicsrect_p.h b/src/declarative/graphicsitems/qmlgraphicsrectangle_p.h index 97334fd..2a80619 100644 --- a/src/declarative/graphicsitems/qmlgraphicsrect_p.h +++ b/src/declarative/graphicsitems/qmlgraphicsrectangle_p.h @@ -130,8 +130,8 @@ private: friend class QmlGraphicsGradientStop; }; -class QmlGraphicsRectPrivate; -class Q_DECLARATIVE_EXPORT QmlGraphicsRect : public QmlGraphicsItem +class QmlGraphicsRectanglePrivate; +class Q_DECLARATIVE_EXPORT QmlGraphicsRectangle : public QmlGraphicsItem { Q_OBJECT @@ -140,7 +140,7 @@ class Q_DECLARATIVE_EXPORT QmlGraphicsRect : public QmlGraphicsItem Q_PROPERTY(QmlGraphicsPen * border READ border CONSTANT) Q_PROPERTY(qreal radius READ radius WRITE setRadius NOTIFY radiusChanged) public: - QmlGraphicsRect(QmlGraphicsItem *parent=0); + QmlGraphicsRectangle(QmlGraphicsItem *parent=0); QColor color() const; void setColor(const QColor &); @@ -170,11 +170,11 @@ private: void drawRect(QPainter &painter); protected: - QmlGraphicsRect(QmlGraphicsRectPrivate &dd, QmlGraphicsItem *parent); + QmlGraphicsRectangle(QmlGraphicsRectanglePrivate &dd, QmlGraphicsItem *parent); private: - Q_DISABLE_COPY(QmlGraphicsRect) - Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QmlGraphicsRect) + Q_DISABLE_COPY(QmlGraphicsRectangle) + Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QmlGraphicsRectangle) }; QT_END_NAMESPACE @@ -182,7 +182,7 @@ QT_END_NAMESPACE QML_DECLARE_TYPE(QmlGraphicsPen) QML_DECLARE_TYPE(QmlGraphicsGradientStop) QML_DECLARE_TYPE(QmlGraphicsGradient) -QML_DECLARE_TYPE(QmlGraphicsRect) +QML_DECLARE_TYPE(QmlGraphicsRectangle) QT_END_HEADER diff --git a/src/declarative/graphicsitems/qmlgraphicsrect_p_p.h b/src/declarative/graphicsitems/qmlgraphicsrectangle_p_p.h index f44e8de..cb914d6 100644 --- a/src/declarative/graphicsitems/qmlgraphicsrect_p_p.h +++ b/src/declarative/graphicsitems/qmlgraphicsrectangle_p_p.h @@ -58,18 +58,18 @@ QT_BEGIN_NAMESPACE class QmlGraphicsGradient; -class QmlGraphicsRect; -class QmlGraphicsRectPrivate : public QmlGraphicsItemPrivate +class QmlGraphicsRectangle; +class QmlGraphicsRectanglePrivate : public QmlGraphicsItemPrivate { - Q_DECLARE_PUBLIC(QmlGraphicsRect) + Q_DECLARE_PUBLIC(QmlGraphicsRectangle) public: - QmlGraphicsRectPrivate() : + QmlGraphicsRectanglePrivate() : color(Qt::white), gradient(0), pen(0), radius(0), paintmargin(0) { } - ~QmlGraphicsRectPrivate() + ~QmlGraphicsRectanglePrivate() { delete pen; } @@ -83,7 +83,7 @@ public: QmlGraphicsGradient *gradient; QmlGraphicsPen *getPen() { if (!pen) { - Q_Q(QmlGraphicsRect); + Q_Q(QmlGraphicsRectangle); pen = new QmlGraphicsPen; QObject::connect(pen, SIGNAL(penChanged()), q, SLOT(doUpdate())); } @@ -96,7 +96,7 @@ public: void setPaintMargin(qreal margin) { - Q_Q(QmlGraphicsRect); + Q_Q(QmlGraphicsRectangle); if (margin == paintmargin) return; q->prepareGeometryChange(); diff --git a/src/declarative/util/qmllistmodel.cpp b/src/declarative/util/qmllistmodel.cpp index dba2203..17083db 100644 --- a/src/declarative/util/qmllistmodel.cpp +++ b/src/declarative/util/qmllistmodel.cpp @@ -457,6 +457,7 @@ void QmlListModel::remove(int index) if (node) delete node; emit itemsRemoved(index,1); + emit countChanged(_root->values.count()); } } @@ -488,6 +489,7 @@ void QmlListModel::insert(int index, const QScriptValue& valuemap) mn->setObjectValue(valuemap); _root->values.insert(index,qVariantFromValue(mn)); emit itemsInserted(index,1); + emit countChanged(_root->values.count()); } /*! @@ -563,6 +565,7 @@ void QmlListModel::append(const QScriptValue& valuemap) mn->setObjectValue(valuemap); _root->values << qVariantFromValue(mn); emit itemsInserted(count()-1,1); + emit countChanged(_root->values.count()); } /*! @@ -642,7 +645,6 @@ void QmlListModel::set(int index, const QString& property, const QVariant& value emit itemsChanged(index,1,roles); } - class QmlListModelParser : public QmlCustomParser { public: diff --git a/src/declarative/util/qmllistmodel_p.h b/src/declarative/util/qmllistmodel_p.h index 8676024..31365d1 100644 --- a/src/declarative/util/qmllistmodel_p.h +++ b/src/declarative/util/qmllistmodel_p.h @@ -62,7 +62,7 @@ struct ModelNode; class QmlListModel : public QListModelInterface { Q_OBJECT - Q_PROPERTY(int count READ count) + Q_PROPERTY(int count READ count NOTIFY countChanged) public: QmlListModel(QObject *parent=0); @@ -81,6 +81,9 @@ public: Q_INVOKABLE void set(int index, const QString& property, const QVariant& value); Q_INVOKABLE void move(int from, int to, int count); +Q_SIGNALS: + void countChanged(int); + private: QVariant valueForNode(ModelNode *) const; mutable QStringList roleStrings; diff --git a/src/declarative/util/qmlstate_p.h b/src/declarative/util/qmlstate_p.h index 92aef8c..ff42893 100644 --- a/src/declarative/util/qmlstate_p.h +++ b/src/declarative/util/qmlstate_p.h @@ -54,7 +54,7 @@ QT_MODULE(Declarative) class ActionEvent; class QmlBinding; -class Action +class Q_DECLARATIVE_EXPORT Action { public: Action(); |