diff options
Diffstat (limited to 'src/declarative/fx')
-rw-r--r-- | src/declarative/fx/qfxanchors.cpp | 25 | ||||
-rw-r--r-- | src/declarative/fx/qfxanchors.h | 45 | ||||
-rw-r--r-- | src/declarative/fx/qfxanchors_p.h | 14 | ||||
-rw-r--r-- | src/declarative/fx/qfxevents_p.h | 11 | ||||
-rw-r--r-- | src/declarative/fx/qfxflickable.cpp | 4 | ||||
-rw-r--r-- | src/declarative/fx/qfxgridview.cpp | 12 | ||||
-rw-r--r-- | src/declarative/fx/qfxitem.cpp | 97 | ||||
-rw-r--r-- | src/declarative/fx/qfxitem.h | 38 | ||||
-rw-r--r-- | src/declarative/fx/qfxitem_p.h | 2 | ||||
-rw-r--r-- | src/declarative/fx/qfxlistview.cpp | 4 |
10 files changed, 134 insertions, 118 deletions
diff --git a/src/declarative/fx/qfxanchors.cpp b/src/declarative/fx/qfxanchors.cpp index 84ccadf..9a5c516 100644 --- a/src/declarative/fx/qfxanchors.cpp +++ b/src/declarative/fx/qfxanchors.cpp @@ -51,7 +51,6 @@ QT_BEGIN_NAMESPACE QML_DEFINE_TYPE(QFxAnchors,Anchors) //TODO: should we cache relationships, so we don't have to check each time (parent-child or sibling)? -//TODO: baseline support //TODO: support non-parent, non-sibling (need to find lowest common ancestor) //### const item? @@ -760,13 +759,13 @@ void QFxAnchors::resetHorizontalCenter() d->updateHorizontalAnchors(); } -int QFxAnchors::leftMargin() const +qreal QFxAnchors::leftMargin() const { Q_D(const QFxAnchors); return d->leftMargin; } -void QFxAnchors::setLeftMargin(int offset) +void QFxAnchors::setLeftMargin(qreal offset) { Q_D(QFxAnchors); if (d->leftMargin == offset) @@ -776,13 +775,13 @@ void QFxAnchors::setLeftMargin(int offset) emit leftMarginChanged(); } -int QFxAnchors::rightMargin() const +qreal QFxAnchors::rightMargin() const { Q_D(const QFxAnchors); return d->rightMargin; } -void QFxAnchors::setRightMargin(int offset) +void QFxAnchors::setRightMargin(qreal offset) { Q_D(QFxAnchors); if (d->rightMargin == offset) @@ -792,13 +791,13 @@ void QFxAnchors::setRightMargin(int offset) emit rightMarginChanged(); } -int QFxAnchors::horizontalCenterOffset() const +qreal QFxAnchors::horizontalCenterOffset() const { Q_D(const QFxAnchors); return d->hCenterOffset; } -void QFxAnchors::setHorizontalCenterOffset(int offset) +void QFxAnchors::setHorizontalCenterOffset(qreal offset) { Q_D(QFxAnchors); if (d->hCenterOffset == offset) @@ -808,13 +807,13 @@ void QFxAnchors::setHorizontalCenterOffset(int offset) emit horizontalCenterOffsetChanged(); } -int QFxAnchors::topMargin() const +qreal QFxAnchors::topMargin() const { Q_D(const QFxAnchors); return d->topMargin; } -void QFxAnchors::setTopMargin(int offset) +void QFxAnchors::setTopMargin(qreal offset) { Q_D(QFxAnchors); if (d->topMargin == offset) @@ -824,13 +823,13 @@ void QFxAnchors::setTopMargin(int offset) emit topMarginChanged(); } -int QFxAnchors::bottomMargin() const +qreal QFxAnchors::bottomMargin() const { Q_D(const QFxAnchors); return d->bottomMargin; } -void QFxAnchors::setBottomMargin(int offset) +void QFxAnchors::setBottomMargin(qreal offset) { Q_D(QFxAnchors); if (d->bottomMargin == offset) @@ -840,13 +839,13 @@ void QFxAnchors::setBottomMargin(int offset) emit bottomMarginChanged(); } -int QFxAnchors::verticalCenterOffset() const +qreal QFxAnchors::verticalCenterOffset() const { Q_D(const QFxAnchors); return d->vCenterOffset; } -void QFxAnchors::setVerticalCenterOffset(int offset) +void QFxAnchors::setVerticalCenterOffset(qreal offset) { Q_D(QFxAnchors); if (d->vCenterOffset == offset) diff --git a/src/declarative/fx/qfxanchors.h b/src/declarative/fx/qfxanchors.h index 206a05c..94c22a6 100644 --- a/src/declarative/fx/qfxanchors.h +++ b/src/declarative/fx/qfxanchors.h @@ -46,15 +46,13 @@ #include <QtDeclarative/qfxglobal.h> #include <QtDeclarative/qml.h> - QT_BEGIN_HEADER QT_BEGIN_NAMESPACE QT_MODULE(Declarative) -class QFxItem; -class QFxAnchorsPrivate; +class QFxItem; class QFxAnchorLine { public: @@ -93,12 +91,12 @@ class Q_DECLARATIVE_EXPORT QFxAnchors : public QObject Q_PROPERTY(QFxAnchorLine bottom READ bottom WRITE setBottom RESET resetBottom) Q_PROPERTY(QFxAnchorLine verticalCenter READ verticalCenter WRITE setVerticalCenter RESET resetVerticalCenter) Q_PROPERTY(QFxAnchorLine baseline READ baseline WRITE setBaseline RESET resetBaseline) - Q_PROPERTY(int leftMargin READ leftMargin WRITE setLeftMargin NOTIFY leftMarginChanged) - Q_PROPERTY(int rightMargin READ rightMargin WRITE setRightMargin NOTIFY rightMarginChanged) - Q_PROPERTY(int horizontalCenterOffset READ horizontalCenterOffset WRITE setHorizontalCenterOffset NOTIFY horizontalCenterOffsetChanged()) - Q_PROPERTY(int topMargin READ topMargin WRITE setTopMargin NOTIFY topMarginChanged) - Q_PROPERTY(int bottomMargin READ bottomMargin WRITE setBottomMargin NOTIFY bottomMarginChanged) - Q_PROPERTY(int verticalCenterOffset READ verticalCenterOffset WRITE setVerticalCenterOffset NOTIFY verticalCenterOffsetChanged()) + Q_PROPERTY(qreal leftMargin READ leftMargin WRITE setLeftMargin NOTIFY leftMarginChanged) + Q_PROPERTY(qreal rightMargin READ rightMargin WRITE setRightMargin NOTIFY rightMarginChanged) + Q_PROPERTY(qreal horizontalCenterOffset READ horizontalCenterOffset WRITE setHorizontalCenterOffset NOTIFY horizontalCenterOffsetChanged()) + Q_PROPERTY(qreal topMargin READ topMargin WRITE setTopMargin NOTIFY topMarginChanged) + Q_PROPERTY(qreal bottomMargin READ bottomMargin WRITE setBottomMargin NOTIFY bottomMarginChanged) + Q_PROPERTY(qreal verticalCenterOffset READ verticalCenterOffset WRITE setVerticalCenterOffset NOTIFY verticalCenterOffsetChanged()) Q_PROPERTY(QFxItem *fill READ fill WRITE setFill) Q_PROPERTY(QFxItem *centeredIn READ centeredIn WRITE setCenteredIn) @@ -121,7 +119,7 @@ public: QFxAnchorLine left() const; void setLeft(const QFxAnchorLine &edge); - Q_INVOKABLE void resetLeft(); //### temporarily invokable for testing + void resetLeft(); QFxAnchorLine right() const; void setRight(const QFxAnchorLine &edge); @@ -147,23 +145,23 @@ public: void setBaseline(const QFxAnchorLine &edge); void resetBaseline(); - int leftMargin() const; - void setLeftMargin(int); + qreal leftMargin() const; + void setLeftMargin(qreal); - int rightMargin() const; - void setRightMargin(int); + qreal rightMargin() const; + void setRightMargin(qreal); - int horizontalCenterOffset() const; - void setHorizontalCenterOffset(int); + qreal horizontalCenterOffset() const; + void setHorizontalCenterOffset(qreal); - int topMargin() const; - void setTopMargin(int); + qreal topMargin() const; + void setTopMargin(qreal); - int bottomMargin() const; - void setBottomMargin(int); + qreal bottomMargin() const; + void setBottomMargin(qreal); - int verticalCenterOffset() const; - void setVerticalCenterOffset(int); + qreal verticalCenterOffset() const; + void setVerticalCenterOffset(qreal); QFxItem *fill() const; void setFill(QFxItem *); @@ -188,11 +186,10 @@ private: Q_DISABLE_COPY(QFxAnchors) Q_DECLARE_PRIVATE(QFxAnchors) }; - QML_DECLARE_TYPE(QFxAnchors) - QT_END_NAMESPACE QT_END_HEADER + #endif diff --git a/src/declarative/fx/qfxanchors_p.h b/src/declarative/fx/qfxanchors_p.h index 9ff6869..a7c904b 100644 --- a/src/declarative/fx/qfxanchors_p.h +++ b/src/declarative/fx/qfxanchors_p.h @@ -56,8 +56,8 @@ #include "qfxanchors.h" #include "private/qobject_p.h" - QT_BEGIN_NAMESPACE + class QFxAnchorsPrivate : public QObjectPrivate { Q_DECLARE_PUBLIC(QFxAnchors) @@ -119,12 +119,12 @@ public: QFxAnchorLine hCenter; QFxAnchorLine baseline; - int leftMargin; - int rightMargin; - int topMargin; - int bottomMargin; - int vCenterOffset; - int hCenterOffset; + qreal leftMargin; + qreal rightMargin; + qreal topMargin; + qreal bottomMargin; + qreal vCenterOffset; + qreal hCenterOffset; }; diff --git a/src/declarative/fx/qfxevents_p.h b/src/declarative/fx/qfxevents_p.h index 2eb29af..60494e6 100644 --- a/src/declarative/fx/qfxevents_p.h +++ b/src/declarative/fx/qfxevents_p.h @@ -42,6 +42,17 @@ #ifndef QFXEVENTS_P_H #define QFXEVENTS_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtDeclarative/qfxglobal.h> #include <QtDeclarative/qml.h> #include <QtCore/qobject.h> diff --git a/src/declarative/fx/qfxflickable.cpp b/src/declarative/fx/qfxflickable.cpp index bc4a5fc..3580edb 100644 --- a/src/declarative/fx/qfxflickable.cpp +++ b/src/declarative/fx/qfxflickable.cpp @@ -112,8 +112,8 @@ void QFxFlickablePrivate::init() QObject::connect(&_tl, SIGNAL(completed()), q, SLOT(movementEnding())); q->setAcceptedMouseButtons(Qt::LeftButton); q->setOptions(QSimpleCanvasItem::ChildMouseFilter | QSimpleCanvasItem::MouseEvents); - QObject::connect(_flick, SIGNAL(leftChanged()), q, SIGNAL(positionChanged())); - QObject::connect(_flick, SIGNAL(topChanged()), q, SIGNAL(positionChanged())); + QObject::connect(_flick, SIGNAL(xChanged()), q, SIGNAL(positionChanged())); + QObject::connect(_flick, SIGNAL(yChanged()), q, SIGNAL(positionChanged())); QObject::connect(&elasticX, SIGNAL(updated()), q, SLOT(ticked())); QObject::connect(&elasticY, SIGNAL(updated()), q, SLOT(ticked())); QObject::connect(q, SIGNAL(heightChanged()), q, SLOT(heightChange())); diff --git a/src/declarative/fx/qfxgridview.cpp b/src/declarative/fx/qfxgridview.cpp index a6ffbb9..11b630a 100644 --- a/src/declarative/fx/qfxgridview.cpp +++ b/src/declarative/fx/qfxgridview.cpp @@ -368,8 +368,8 @@ void QFxGridViewPrivate::releaseItem(FxGridItem *item) if (!item) return; if (trackedItem == item) { - QObject::disconnect(trackedItem->item, SIGNAL(topChanged()), q, SLOT(trackedPositionChanged())); - QObject::disconnect(trackedItem->item, SIGNAL(leftChanged()), q, SLOT(trackedPositionChanged())); + QObject::disconnect(trackedItem->item, SIGNAL(yChanged()), q, SLOT(trackedPositionChanged())); + QObject::disconnect(trackedItem->item, SIGNAL(xChanged()), q, SLOT(trackedPositionChanged())); trackedItem = 0; } if (model->release(item->item) == 0) { @@ -548,15 +548,15 @@ void QFxGridViewPrivate::updateTrackedItem() item = highlight; if (trackedItem && item != trackedItem) { - QObject::disconnect(trackedItem->item, SIGNAL(topChanged()), q, SLOT(trackedPositionChanged())); - QObject::disconnect(trackedItem->item, SIGNAL(leftChanged()), q, SLOT(trackedPositionChanged())); + QObject::disconnect(trackedItem->item, SIGNAL(yChanged()), q, SLOT(trackedPositionChanged())); + QObject::disconnect(trackedItem->item, SIGNAL(xChanged()), q, SLOT(trackedPositionChanged())); trackedItem = 0; } if (!trackedItem && item) { trackedItem = item; - QObject::connect(trackedItem->item, SIGNAL(topChanged()), q, SLOT(trackedPositionChanged())); - QObject::connect(trackedItem->item, SIGNAL(leftChanged()), q, SLOT(trackedPositionChanged())); + QObject::connect(trackedItem->item, SIGNAL(yChanged()), q, SLOT(trackedPositionChanged())); + QObject::connect(trackedItem->item, SIGNAL(xChanged()), q, SLOT(trackedPositionChanged())); q->trackedPositionChanged(); } if (trackedItem) diff --git a/src/declarative/fx/qfxitem.cpp b/src/declarative/fx/qfxitem.cpp index 73786a8..1c35290 100644 --- a/src/declarative/fx/qfxitem.cpp +++ b/src/declarative/fx/qfxitem.cpp @@ -65,10 +65,10 @@ #include <qsimplecanvasfilter.h> #include <qmlcomponent.h> - QT_BEGIN_NAMESPACE -#ifndef INT_MAX -#define INT_MAX 2147483647 + +#ifndef FLT_MAX +#define FLT_MAX 1E+37 #endif QML_DEFINE_NOCREATE_TYPE(QFxContents) @@ -123,84 +123,92 @@ QML_DEFINE_NOCREATE_TYPE(QSimpleCanvasFilter) */ -QFxContents::QFxContents() : _height(0), _width(0) +QFxContents::QFxContents() : m_height(0), m_width(0) { } /*! + \qmlproperty qreal Item::contents.width + \qmlproperty qreal Item::contents.height + + The contents properties allow an item access to the size of its + children. This property is useful if you have an item that needs to be + sized to fit its children. +/*! \property QFxContents::height \brief The height of the contents. */ -int QFxContents::height() const +qreal QFxContents::height() const { - return _height; + return m_height; } /*! \property QFxContents::width \brief The width of the contents. */ -int QFxContents::width() const +qreal QFxContents::width() const { - return _width; + return m_width; } //TODO: optimization: only check sender(), if there is one void QFxContents::calcHeight() { - int oldheight = _height; + qreal oldheight = m_height; - int top = INT_MAX; - int bottom = 0; + qreal top = FLT_MAX; + qreal bottom = 0; - const QList<QSimpleCanvasItem *> &children = _item->QSimpleCanvasItem::children(); + const QList<QSimpleCanvasItem *> &children = m_item->QSimpleCanvasItem::children(); for (int i = 0; i < children.count(); ++i) { const QSimpleCanvasItem *child = children.at(i); - int y = int(child->y()); + qreal y = child->y(); if (y + child->height() > bottom) bottom = y + child->height(); if (y < top) top = y; } - _height = bottom - top; + m_height = qMax(bottom - top, qreal(0.0)); - if (_height != oldheight) + if (m_height != oldheight) emit heightChanged(); } //TODO: optimization: only check sender(), if there is one void QFxContents::calcWidth() { - int oldwidth = _width; + qreal oldwidth = m_width; - int left = INT_MAX; - int right = 0; - const QList<QSimpleCanvasItem *> &children = _item->QSimpleCanvasItem::children(); + qreal left = FLT_MAX; + qreal right = 0; + + const QList<QSimpleCanvasItem *> &children = m_item->QSimpleCanvasItem::children(); for (int i = 0; i < children.count(); ++i) { const QSimpleCanvasItem *child = children.at(i); - int x = int(child->x()); + qreal x = int(child->x()); if (x + child->width() > right) right = x + child->width(); if (x < left) left = x; } - _width = right - left; + m_width = qMax(right - left, qreal(0.0)); - if (_width != oldwidth) + if (m_width != oldwidth) emit widthChanged(); } void QFxContents::setItem(QFxItem *item) { - _item = item; + m_item = item; - const QList<QSimpleCanvasItem *> &children = _item->QSimpleCanvasItem::children(); + const QList<QSimpleCanvasItem *> &children = m_item->QSimpleCanvasItem::children(); for (int i = 0; i < children.count(); ++i) { const QSimpleCanvasItem *child = children.at(i); connect(child, SIGNAL(heightChanged()), this, SLOT(calcHeight())); - connect(child, SIGNAL(topChanged()), this, SLOT(calcHeight())); + connect(child, SIGNAL(yChanged()), this, SLOT(calcHeight())); connect(child, SIGNAL(widthChanged()), this, SLOT(calcWidth())); - connect(child, SIGNAL(leftChanged()), this, SLOT(calcWidth())); + connect(child, SIGNAL(xChanged()), this, SLOT(calcWidth())); } calcHeight(); @@ -268,15 +276,15 @@ void QFxContents::setItem(QFxItem *item) */ /*! - \fn void QFxItem::leftChanged() + \fn void QFxItem::xChanged() - This signal is emitted when the left coordinate of the item changes. + This signal is emitted when the x coordinate of the item changes. */ /*! - \fn void QFxItem::topChanged() + \fn void QFxItem::yChanged() - This signal is emitted when the top coordinate of the item changes. + This signal is emitted when the y coordinate of the item changes. */ /*! @@ -925,8 +933,8 @@ void QFxItem::qmlLoaded() /*! \qmlproperty real Item::x \qmlproperty real Item::y - \qmlproperty int Item::width - \qmlproperty int Item::height + \qmlproperty real Item::width + \qmlproperty real Item::height Defines the item's position and size relative to its parent. @@ -1067,11 +1075,11 @@ void QFxItem::geometryChanged(const QRectF &newGeometry, } if (newGeometry.x() != oldGeometry.x()) - emit leftChanged(); + emit xChanged(); if (newGeometry.width() != oldGeometry.width()) emit widthChanged(); if (newGeometry.y() != oldGeometry.y()) - emit topChanged(); + emit yChanged(); if (newGeometry.height() != oldGeometry.height()) emit heightChanged(); @@ -1346,13 +1354,14 @@ QFxAnchorLine QFxItem::baseline() const \qmlproperty AnchorLine Item::anchors.baseline \qmlproperty Item Item::anchors.fill - - \qmlproperty int Item::anchors.topMargin - \qmlproperty int Item::anchors.bottomMargin - \qmlproperty int Item::anchors.leftMargin - \qmlproperty int Item::anchors.rightMargin - \qmlproperty int Item::anchors.horizontalCenterOffset - \qmlproperty int Item::anchors.verticalCenterOffset + \qmlproperty Item Item::anchors.centeredIn + + \qmlproperty real Item::anchors.topMargin + \qmlproperty real Item::anchors.bottomMargin + \qmlproperty real Item::anchors.leftMargin + \qmlproperty real Item::anchors.rightMargin + \qmlproperty real Item::anchors.horizontalCenterOffset + \qmlproperty real Item::anchors.verticalCenterOffset Anchors provide a way to position an item by specifying its relationship with other items. @@ -1411,11 +1420,11 @@ QFxAnchorLine QFxItem::baseline() const For non-text items, a default baseline offset of 0 is used. */ -int QFxItem::baselineOffset() const +qreal QFxItem::baselineOffset() const { Q_D(const QFxItem); if (!d->_baselineOffset.isValid()) { - return 0; + return 0.0; } else return d->_baselineOffset; } @@ -1423,7 +1432,7 @@ int QFxItem::baselineOffset() const /*! \internal */ -void QFxItem::setBaselineOffset(int offset) +void QFxItem::setBaselineOffset(qreal offset) { Q_D(QFxItem); if (offset == d->_baselineOffset) diff --git a/src/declarative/fx/qfxitem.h b/src/declarative/fx/qfxitem.h index 3c872e1..67a4553 100644 --- a/src/declarative/fx/qfxitem.h +++ b/src/declarative/fx/qfxitem.h @@ -53,7 +53,6 @@ #include <QtDeclarative/qmlcomponent.h> #include <QtDeclarative/qmlstate.h> - QT_BEGIN_HEADER QT_BEGIN_NAMESPACE @@ -63,14 +62,14 @@ QT_MODULE(Declarative) class Q_DECLARATIVE_EXPORT QFxContents : public QObject { Q_OBJECT - Q_PROPERTY(int height READ height NOTIFY heightChanged) - Q_PROPERTY(int width READ width NOTIFY widthChanged) + Q_PROPERTY(qreal height READ height NOTIFY heightChanged) + Q_PROPERTY(qreal width READ width NOTIFY widthChanged) public: QFxContents(); - int height() const; + qreal height() const; - int width() const; + qreal width() const; void setItem(QFxItem *item); @@ -83,9 +82,9 @@ Q_SIGNALS: void widthChanged(); private: - QFxItem *_item; - int _height; - int _width; + QFxItem *m_item; + qreal m_height; + qreal m_width; }; QML_DECLARE_TYPE(QFxContents) Q_DECLARE_OPERATORS_FOR_FLAGS(QFxAnchors::UsedAnchors) @@ -113,14 +112,11 @@ class Q_DECLARATIVE_EXPORT QFxItem : public QSimpleCanvasItem, public QmlParserS Q_PROPERTY(QString state READ state WRITE setState NOTIFY stateChanged) Q_PROPERTY(QUrl qml READ qml WRITE setQml NOTIFY qmlChanged) Q_PROPERTY(QFxItem *qmlItem READ qmlItem NOTIFY qmlChanged) - Q_PROPERTY(qreal x READ x WRITE setX NOTIFY leftChanged) - Q_PROPERTY(qreal y READ y WRITE setY NOTIFY topChanged) + Q_PROPERTY(qreal x READ x WRITE setX NOTIFY xChanged) + Q_PROPERTY(qreal y READ y WRITE setY NOTIFY yChanged) Q_PROPERTY(qreal z READ z WRITE setZ) - Q_PROPERTY(int width READ width WRITE setWidth NOTIFY widthChanged) - Q_PROPERTY(bool flipVertically READ flipVertically WRITE setFlipVertically) - Q_PROPERTY(bool flipHorizontally READ flipHorizontally WRITE setFlipHorizontally) - Q_PROPERTY(int height READ height WRITE setHeight NOTIFY heightChanged) - Q_PROPERTY(int baselineOffset READ baselineOffset WRITE setBaselineOffset NOTIFY baselineOffsetChanged) + Q_PROPERTY(qreal width READ width WRITE setWidth NOTIFY widthChanged) + Q_PROPERTY(qreal height READ height WRITE setHeight NOTIFY heightChanged) Q_PROPERTY(QFxAnchorLine left READ left) Q_PROPERTY(QFxAnchorLine right READ right) Q_PROPERTY(QFxAnchorLine horizontalCenter READ horizontalCenter) @@ -128,6 +124,9 @@ class Q_DECLARATIVE_EXPORT QFxItem : public QSimpleCanvasItem, public QmlParserS Q_PROPERTY(QFxAnchorLine bottom READ bottom) Q_PROPERTY(QFxAnchorLine verticalCenter READ verticalCenter) Q_PROPERTY(QFxAnchorLine baseline READ baseline) + Q_PROPERTY(qreal baselineOffset READ baselineOffset WRITE setBaselineOffset NOTIFY baselineOffsetChanged) + Q_PROPERTY(bool flipVertically READ flipVertically WRITE setFlipVertically) + Q_PROPERTY(bool flipHorizontally READ flipHorizontally WRITE setFlipHorizontally) Q_PROPERTY(qreal rotation READ rotation WRITE setRotation NOTIFY rotationChanged) Q_PROPERTY(qreal scale READ scale WRITE setScale NOTIFY scaleChanged) Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity NOTIFY opacityChanged) @@ -179,8 +178,8 @@ public: bool flipHorizontally() const; void setFlipHorizontally(bool); - int baselineOffset() const; - void setBaselineOffset(int); + qreal baselineOffset() const; + void setBaselineOffset(qreal); qreal rotation() const; void setRotation(qreal); @@ -213,10 +212,10 @@ public Q_SLOTS: void newChild(const QString &url); Q_SIGNALS: - void leftChanged(); + void xChanged(); + void yChanged(); void widthChanged(); void heightChanged(); - void topChanged(); void baselineOffsetChanged(); void stateChanged(const QString &); void focusChanged(); @@ -274,4 +273,5 @@ QML_DECLARE_TYPE(QSimpleCanvasFilter) QT_END_NAMESPACE QT_END_HEADER + #endif // QFXITEM_H diff --git a/src/declarative/fx/qfxitem_p.h b/src/declarative/fx/qfxitem_p.h index b38d877..32e8aef 100644 --- a/src/declarative/fx/qfxitem_p.h +++ b/src/declarative/fx/qfxitem_p.h @@ -138,7 +138,7 @@ public: QList<QUrl> _qmlnewloading; QList<QmlComponent*> _qmlnewcomp; - QmlNullableValue<int> _baselineOffset; + QmlNullableValue<qreal> _baselineOffset; float _rotation; bool _classComplete:1; diff --git a/src/declarative/fx/qfxlistview.cpp b/src/declarative/fx/qfxlistview.cpp index a8c0747..889cfdd 100644 --- a/src/declarative/fx/qfxlistview.cpp +++ b/src/declarative/fx/qfxlistview.cpp @@ -444,7 +444,7 @@ void QFxListViewPrivate::releaseItem(FxListItem *item) else QObject::disconnect(item->item, SIGNAL(widthChanged()), q, SLOT(itemResized())); if (trackedItem == item) { - const char *notifier1 = orient == Qt::Vertical ? SIGNAL(topChanged()) : SIGNAL(leftChanged()); + const char *notifier1 = orient == Qt::Vertical ? SIGNAL(yChanged()) : SIGNAL(xChanged()); const char *notifier2 = orient == Qt::Vertical ? SIGNAL(heightChanged()) : SIGNAL(widthChanged()); QObject::disconnect(trackedItem->item, notifier1, q, SLOT(trackedPositionChanged())); QObject::disconnect(trackedItem->item, notifier2, q, SLOT(trackedPositionChanged())); @@ -588,7 +588,7 @@ void QFxListViewPrivate::updateTrackedItem() if (highlight) item = highlight; - const char *notifier1 = orient == Qt::Vertical ? SIGNAL(topChanged()) : SIGNAL(leftChanged()); + const char *notifier1 = orient == Qt::Vertical ? SIGNAL(yChanged()) : SIGNAL(xChanged()); const char *notifier2 = orient == Qt::Vertical ? SIGNAL(heightChanged()) : SIGNAL(widthChanged()); if (trackedItem && item != trackedItem) { |