summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/graphicsitems')
-rw-r--r--src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp4
-rw-r--r--src/declarative/graphicsitems/qdeclarativeborderimage.cpp4
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflickable.cpp140
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflickable_p_p.h15
-rw-r--r--src/declarative/graphicsitems/qdeclarativegridview.cpp99
-rw-r--r--src/declarative/graphicsitems/qdeclarativeimage.cpp4
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitem.cpp2
-rw-r--r--src/declarative/graphicsitems/qdeclarativelistview.cpp135
-rw-r--r--src/declarative/graphicsitems/qdeclarativemousearea.cpp2
-rw-r--r--src/declarative/graphicsitems/qdeclarativepositioners.cpp6
-rw-r--r--src/declarative/graphicsitems/qdeclarativerepeater.cpp6
-rw-r--r--src/declarative/graphicsitems/qdeclarativetext.cpp8
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit.cpp10
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput.cpp8
14 files changed, 253 insertions, 190 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp b/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp
index 8787a5e..b1ebec8 100644
--- a/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp
@@ -114,7 +114,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmlproperty bool AnimatedImage::cache
- \since Quick 1.1
+ \since QtQuick 1.1
Specifies whether the image should be cached. The default value is
true. Setting \a cache to false is useful when dealing with large images,
@@ -123,7 +123,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmlproperty bool AnimatedImage::mirror
- \since Quick 1.1
+ \since QtQuick 1.1
This property holds whether the image should be horizontally inverted
(effectively displaying a mirrored image).
diff --git a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp
index 9c274e9..4b4efb6 100644
--- a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp
@@ -215,7 +215,7 @@ QDeclarativeBorderImage::~QDeclarativeBorderImage()
/*!
\qmlproperty bool BorderImage::cache
- \since Quick 1.1
+ \since QtQuick 1.1
Specifies whether the image should be cached. The default value is
true. Setting \a cache to false is useful when dealing with large images,
@@ -224,7 +224,7 @@ QDeclarativeBorderImage::~QDeclarativeBorderImage()
/*!
\qmlproperty bool BorderImage::mirror
- \since Quick 1.1
+ \since QtQuick 1.1
This property holds whether the image should be horizontally inverted
(effectively displaying a mirrored image).
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
index 13bb8ef..fd2dc45 100644
--- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
@@ -168,9 +168,7 @@ QDeclarativeFlickablePrivate::QDeclarativeFlickablePrivate()
: contentItem(new QDeclarativeItem)
, hData(this, &QDeclarativeFlickablePrivate::setRoundedViewportX)
, vData(this, &QDeclarativeFlickablePrivate::setRoundedViewportY)
- , flickingHorizontally(false), flickingVertically(false)
, hMoved(false), vMoved(false)
- , movingHorizontally(false), movingVertically(false)
, stealMouse(false), pressed(false), interactive(true), calcVelocity(false)
, deceleration(QML_FLICK_DEFAULTDECELERATION)
, maxVelocity(QML_FLICK_DEFAULTMAXVELOCITY), reportedVelocitySmoothing(100)
@@ -294,18 +292,18 @@ void QDeclarativeFlickablePrivate::flick(AxisData &data, qreal minExtent, qreal
else
timeline.accel(data.move, v, deceleration, maxDistance);
timeline.callback(QDeclarativeTimeLineCallback(&data.move, fixupCallback, this));
- if (!flickingHorizontally && q->xflick()) {
- flickingHorizontally = true;
+ if (!hData.flicking && q->xflick()) {
+ hData.flicking = true;
emit q->flickingChanged();
emit q->flickingHorizontallyChanged();
- if (!flickingVertically)
+ if (!vData.flicking)
emit q->flickStarted();
}
- if (!flickingVertically && q->yflick()) {
- flickingVertically = true;
+ if (!vData.flicking && q->yflick()) {
+ vData.flicking = true;
emit q->flickingChanged();
emit q->flickingVerticallyChanged();
- if (!flickingHorizontally)
+ if (!hData.flicking)
emit q->flickStarted();
}
} else {
@@ -614,11 +612,11 @@ void QDeclarativeFlickable::setInteractive(bool interactive)
Q_D(QDeclarativeFlickable);
if (interactive != d->interactive) {
d->interactive = interactive;
- if (!interactive && (d->flickingHorizontally || d->flickingVertically)) {
+ if (!interactive && (d->hData.flicking || d->vData.flicking)) {
d->timeline.clear();
d->vTime = d->timeline.time();
- d->flickingHorizontally = false;
- d->flickingVertically = false;
+ d->hData.flicking = false;
+ d->vData.flicking = false;
emit flickingChanged();
emit flickingHorizontallyChanged();
emit flickingVerticallyChanged();
@@ -771,8 +769,8 @@ void QDeclarativeFlickablePrivate::handleMousePressEvent(QGraphicsSceneMouseEven
pressPos = event->pos();
hData.pressPos = hData.move.value();
vData.pressPos = vData.move.value();
- flickingHorizontally = false;
- flickingVertically = false;
+ hData.flicking = false;
+ vData.flicking = false;
QDeclarativeItemPrivate::start(pressTime);
QDeclarativeItemPrivate::start(velocityTime);
}
@@ -897,31 +895,33 @@ void QDeclarativeFlickablePrivate::handleMouseReleaseEvent(QGraphicsSceneMouseEv
return;
// if we drag then pause before release we should not cause a flick.
- if (QDeclarativeItemPrivate::elapsed(lastPosTime) < 100) {
- vData.updateVelocity();
- hData.updateVelocity();
- } else {
- hData.velocity = 0.0;
- vData.velocity = 0.0;
- }
+ qint64 elapsed = QDeclarativeItemPrivate::elapsed(lastPosTime);
+ vData.updateVelocity();
+ hData.updateVelocity();
vTime = timeline.time();
- qreal velocity = vData.velocity;
+ qreal velocity = elapsed < 100 ? vData.velocity : 0;
if (vData.atBeginning || vData.atEnd)
velocity /= 2;
- if (qAbs(velocity) > MinimumFlickVelocity && qAbs(event->pos().y() - pressPos.y()) > FlickThreshold)
+ if (q->yflick() && qAbs(velocity) > MinimumFlickVelocity && qAbs(event->pos().y() - pressPos.y()) > FlickThreshold) {
+ velocityTimeline.reset(vData.smoothVelocity);
+ vData.smoothVelocity.setValue(-velocity);
flickY(velocity);
- else
+ } else {
fixupY();
+ }
- velocity = hData.velocity;
+ velocity = elapsed < 100 ? hData.velocity : 0;
if (hData.atBeginning || hData.atEnd)
velocity /= 2;
- if (qAbs(velocity) > MinimumFlickVelocity && qAbs(event->pos().x() - pressPos.x()) > FlickThreshold)
+ if (q->xflick() && qAbs(velocity) > MinimumFlickVelocity && qAbs(event->pos().x() - pressPos.x()) > FlickThreshold) {
+ velocityTimeline.reset(hData.smoothVelocity);
+ hData.smoothVelocity.setValue(-velocity);
flickX(velocity);
- else
+ } else {
fixupX();
+ }
if (!timeline.isActive())
q->movementEnding();
@@ -978,9 +978,9 @@ void QDeclarativeFlickable::wheelEvent(QGraphicsSceneWheelEvent *event)
valid = true;
}
if (valid) {
- d->flickingVertically = false;
+ d->vData.flicking = false;
d->flickY(d->vData.velocity);
- if (d->flickingVertically) {
+ if (d->vData.flicking) {
d->vMoved = true;
movementStarting();
}
@@ -996,9 +996,9 @@ void QDeclarativeFlickable::wheelEvent(QGraphicsSceneWheelEvent *event)
valid = true;
}
if (valid) {
- d->flickingHorizontally = false;
+ d->hData.flicking = false;
d->flickX(d->hData.velocity);
- if (d->flickingHorizontally) {
+ if (d->hData.flicking) {
d->hMoved = true;
movementStarting();
}
@@ -1121,19 +1121,25 @@ void QDeclarativeFlickable::viewportMoved()
qreal prevX = d->lastFlickablePosition.x();
qreal prevY = d->lastFlickablePosition.y();
- d->velocityTimeline.clear();
if (d->pressed || d->calcVelocity) {
int elapsed = QDeclarativeItemPrivate::restart(d->velocityTime);
if (elapsed > 0) {
qreal horizontalVelocity = (prevX - d->hData.move.value()) * 1000 / elapsed;
+ if (qAbs(horizontalVelocity) > 0) {
+ d->velocityTimeline.reset(d->hData.smoothVelocity);
+ d->velocityTimeline.move(d->hData.smoothVelocity, horizontalVelocity, d->reportedVelocitySmoothing);
+ d->velocityTimeline.move(d->hData.smoothVelocity, 0, d->reportedVelocitySmoothing);
+ }
qreal verticalVelocity = (prevY - d->vData.move.value()) * 1000 / elapsed;
- d->velocityTimeline.move(d->hData.smoothVelocity, horizontalVelocity, d->reportedVelocitySmoothing);
- d->velocityTimeline.move(d->hData.smoothVelocity, 0, d->reportedVelocitySmoothing);
- d->velocityTimeline.move(d->vData.smoothVelocity, verticalVelocity, d->reportedVelocitySmoothing);
- d->velocityTimeline.move(d->vData.smoothVelocity, 0, d->reportedVelocitySmoothing);
+ if (qAbs(verticalVelocity) > 0) {
+ d->velocityTimeline.reset(d->vData.smoothVelocity);
+ d->velocityTimeline.move(d->vData.smoothVelocity, verticalVelocity, d->reportedVelocitySmoothing);
+ d->velocityTimeline.move(d->vData.smoothVelocity, 0, d->reportedVelocitySmoothing);
+ }
}
} else {
if (d->timeline.time() > d->vTime) {
+ d->velocityTimeline.clear();
qreal horizontalVelocity = (prevX - d->hData.move.value()) * 1000 / (d->timeline.time() - d->vTime);
qreal verticalVelocity = (prevY - d->vData.move.value()) * 1000 / (d->timeline.time() - d->vTime);
d->hData.smoothVelocity.setValue(horizontalVelocity);
@@ -1141,7 +1147,7 @@ void QDeclarativeFlickable::viewportMoved()
}
}
- if (!d->vData.inOvershoot && !d->vData.fixingUp && d->flickingVertically
+ if (!d->vData.inOvershoot && !d->vData.fixingUp && d->vData.flicking
&& (d->vData.move.value() > minYExtent() || d->vData.move.value() < maxYExtent())
&& qAbs(d->vData.smoothVelocity.value()) > 100) {
// Increase deceleration if we've passed a bound
@@ -1151,7 +1157,7 @@ void QDeclarativeFlickable::viewportMoved()
d->timeline.accel(d->vData.move, -d->vData.smoothVelocity.value(), d->deceleration*QML_FLICK_OVERSHOOTFRICTION, maxDistance);
d->timeline.callback(QDeclarativeTimeLineCallback(&d->vData.move, d->fixupY_callback, d));
}
- if (!d->hData.inOvershoot && !d->hData.fixingUp && d->flickingHorizontally
+ if (!d->hData.inOvershoot && !d->hData.fixingUp && d->hData.flicking
&& (d->hData.move.value() > minXExtent() || d->hData.move.value() < maxXExtent())
&& qAbs(d->hData.smoothVelocity.value()) > 100) {
// Increase deceleration if we've passed a bound
@@ -1183,7 +1189,7 @@ void QDeclarativeFlickable::geometryChanged(const QRectF &newGeometry,
emit contentWidthChanged();
}
// Make sure that we're entirely in view.
- if (!d->pressed && !d->movingHorizontally && !d->movingVertically) {
+ if (!d->pressed && !d->hData.moving && !d->vData.moving) {
d->fixupMode = QDeclarativeFlickablePrivate::Immediate;
d->fixupX();
}
@@ -1196,7 +1202,7 @@ void QDeclarativeFlickable::geometryChanged(const QRectF &newGeometry,
emit contentHeightChanged();
}
// Make sure that we're entirely in view.
- if (!d->pressed && !d->movingHorizontally && !d->movingVertically) {
+ if (!d->pressed && !d->hData.moving && !d->vData.moving) {
d->fixupMode = QDeclarativeFlickablePrivate::Immediate;
d->fixupY();
}
@@ -1351,7 +1357,7 @@ void QDeclarativeFlickable::setContentWidth(qreal w)
else
d->contentItem->setWidth(w);
// Make sure that we're entirely in view.
- if (!d->pressed && !d->movingHorizontally && !d->movingVertically) {
+ if (!d->pressed && !d->hData.moving && !d->vData.moving) {
d->fixupMode = QDeclarativeFlickablePrivate::Immediate;
d->fixupX();
} else if (!d->pressed && d->hData.fixingUp) {
@@ -1379,7 +1385,7 @@ void QDeclarativeFlickable::setContentHeight(qreal h)
else
d->contentItem->setHeight(h);
// Make sure that we're entirely in view.
- if (!d->pressed && !d->movingHorizontally && !d->movingVertically) {
+ if (!d->pressed && !d->hData.moving && !d->vData.moving) {
d->fixupMode = QDeclarativeFlickablePrivate::Immediate;
d->fixupY();
} else if (!d->pressed && d->vData.fixingUp) {
@@ -1393,7 +1399,7 @@ void QDeclarativeFlickable::setContentHeight(qreal h)
/*!
\qmlmethod Flickable::resizeContent(real width, real height, QPointF center)
\preliminary
- \since Quick 1.1
+ \since QtQuick 1.1
Resizes the content to \a width x \a height about \a center.
@@ -1433,7 +1439,7 @@ void QDeclarativeFlickable::resizeContent(qreal w, qreal h, QPointF center)
/*!
\qmlmethod Flickable::returnToBounds()
\preliminary
- \since Quick 1.1
+ \since QtQuick 1.1
Ensures the content is within legal bounds.
@@ -1635,7 +1641,7 @@ void QDeclarativeFlickable::setFlickDeceleration(qreal deceleration)
bool QDeclarativeFlickable::isFlicking() const
{
Q_D(const QDeclarativeFlickable);
- return d->flickingHorizontally || d->flickingVertically;
+ return d->hData.flicking || d->vData.flicking;
}
/*!
@@ -1649,13 +1655,13 @@ bool QDeclarativeFlickable::isFlicking() const
bool QDeclarativeFlickable::isFlickingHorizontally() const
{
Q_D(const QDeclarativeFlickable);
- return d->flickingHorizontally;
+ return d->hData.flicking;
}
bool QDeclarativeFlickable::isFlickingVertically() const
{
Q_D(const QDeclarativeFlickable);
- return d->flickingVertically;
+ return d->vData.flicking;
}
/*!
@@ -1691,7 +1697,7 @@ void QDeclarativeFlickable::setPressDelay(int delay)
bool QDeclarativeFlickable::isMoving() const
{
Q_D(const QDeclarativeFlickable);
- return d->movingHorizontally || d->movingVertically;
+ return d->hData.moving || d->vData.moving;
}
/*!
@@ -1706,30 +1712,30 @@ bool QDeclarativeFlickable::isMoving() const
bool QDeclarativeFlickable::isMovingHorizontally() const
{
Q_D(const QDeclarativeFlickable);
- return d->movingHorizontally;
+ return d->hData.moving;
}
bool QDeclarativeFlickable::isMovingVertically() const
{
Q_D(const QDeclarativeFlickable);
- return d->movingVertically;
+ return d->vData.moving;
}
void QDeclarativeFlickable::movementStarting()
{
Q_D(QDeclarativeFlickable);
- if (d->hMoved && !d->movingHorizontally) {
- d->movingHorizontally = true;
+ if (d->hMoved && !d->hData.moving) {
+ d->hData.moving = true;
emit movingChanged();
emit movingHorizontallyChanged();
- if (!d->movingVertically)
+ if (!d->vData.moving)
emit movementStarted();
}
- else if (d->vMoved && !d->movingVertically) {
- d->movingVertically = true;
+ else if (d->vMoved && !d->vData.moving) {
+ d->vData.moving = true;
emit movingChanged();
emit movingVerticallyChanged();
- if (!d->movingHorizontally)
+ if (!d->hData.moving)
emit movementStarted();
}
}
@@ -1746,20 +1752,20 @@ void QDeclarativeFlickable::movementEnding()
void QDeclarativeFlickable::movementXEnding()
{
Q_D(QDeclarativeFlickable);
- if (d->flickingHorizontally) {
- d->flickingHorizontally = false;
+ if (d->hData.flicking) {
+ d->hData.flicking = false;
emit flickingChanged();
emit flickingHorizontallyChanged();
- if (!d->flickingVertically)
+ if (!d->vData.flicking)
emit flickEnded();
}
if (!d->pressed && !d->stealMouse) {
- if (d->movingHorizontally) {
- d->movingHorizontally = false;
+ if (d->hData.moving) {
+ d->hData.moving = false;
d->hMoved = false;
emit movingChanged();
emit movingHorizontallyChanged();
- if (!d->movingVertically)
+ if (!d->vData.moving)
emit movementEnded();
}
}
@@ -1769,20 +1775,20 @@ void QDeclarativeFlickable::movementXEnding()
void QDeclarativeFlickable::movementYEnding()
{
Q_D(QDeclarativeFlickable);
- if (d->flickingVertically) {
- d->flickingVertically = false;
+ if (d->vData.flicking) {
+ d->vData.flicking = false;
emit flickingChanged();
emit flickingVerticallyChanged();
- if (!d->flickingHorizontally)
+ if (!d->hData.flicking)
emit flickEnded();
}
if (!d->pressed && !d->stealMouse) {
- if (d->movingVertically) {
- d->movingVertically = false;
+ if (d->vData.moving) {
+ d->vData.moving = false;
d->vMoved = false;
emit movingChanged();
emit movingVerticallyChanged();
- if (!d->movingHorizontally)
+ if (!d->hData.moving)
emit movementEnded();
}
}
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable_p_p.h b/src/declarative/graphicsitems/qdeclarativeflickable_p_p.h
index 46b2104..d73a907 100644
--- a/src/declarative/graphicsitems/qdeclarativeflickable_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativeflickable_p_p.h
@@ -63,11 +63,16 @@
#include <qdeclarativeanimation_p_p.h>
#include <qdatetime.h>
+#include "qplatformdefs.h"
QT_BEGIN_NAMESPACE
// Really slow flicks can be annoying.
-const qreal MinimumFlickVelocity = 75.0;
+#ifndef QML_FLICK_MINVELOCITY
+#define QML_FLICK_MINVELOCITY 175
+#endif
+
+const qreal MinimumFlickVelocity = QML_FLICK_MINVELOCITY;
class QDeclarativeFlickableVisibleArea;
class QDeclarativeFlickablePrivate : public QDeclarativeItemPrivate, public QDeclarativeItemChangeListener
@@ -94,7 +99,7 @@ public:
struct AxisData {
AxisData(QDeclarativeFlickablePrivate *fp, void (QDeclarativeFlickablePrivate::*func)(qreal))
: move(fp, func), viewSize(-1), smoothVelocity(fp), atEnd(false), atBeginning(true)
- , fixingUp(false), inOvershoot(false)
+ , fixingUp(false), inOvershoot(false), moving(false), flicking(false)
{}
void reset() {
@@ -121,6 +126,8 @@ public:
bool atBeginning : 1;
bool fixingUp : 1;
bool inOvershoot : 1;
+ bool moving : 1;
+ bool flicking : 1;
};
void flickX(qreal velocity);
@@ -152,12 +159,8 @@ public:
AxisData vData;
QDeclarativeTimeLine timeline;
- bool flickingHorizontally : 1;
- bool flickingVertically : 1;
bool hMoved : 1;
bool vMoved : 1;
- bool movingHorizontally : 1;
- bool movingVertically : 1;
bool stealMouse : 1;
bool pressed : 1;
bool interactive : 1;
diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp
index a0264f7..e53472d 100644
--- a/src/declarative/graphicsitems/qdeclarativegridview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp
@@ -52,9 +52,13 @@
#include <qmath.h>
#include <math.h>
+#include "qplatformdefs.h"
QT_BEGIN_NAMESPACE
+#ifndef QML_FLICK_SNAPONETHRESHOLD
+#define QML_FLICK_SNAPONETHRESHOLD 30
+#endif
//----------------------------------------------------------------------------
@@ -344,9 +348,12 @@ public:
Q_Q(const QDeclarativeGridView);
qreal snapPos = 0;
if (!visibleItems.isEmpty()) {
+ qreal highlightStart = isRightToLeftTopToBottom() && highlightRangeStartValid ? size()-highlightRangeEnd : highlightRangeStart;
+ pos += highlightStart;
pos += rowSize()/2;
snapPos = visibleItems.first()->rowPos() - visibleIndex / columns * rowSize();
snapPos = pos - fmodf(pos - snapPos, qreal(rowSize()));
+ snapPos -= highlightStart;
qreal maxExtent;
qreal minExtent;
if (isRightToLeftTopToBottom()) {
@@ -874,7 +881,7 @@ void QDeclarativeGridViewPrivate::updateHighlight()
{
if ((!currentItem && highlight) || (currentItem && !highlight))
createHighlight();
- if (currentItem && autoHighlight && highlight && !movingHorizontally && !movingVertically) {
+ if (currentItem && autoHighlight && highlight && !hData.moving && !vData.moving) {
// auto-update highlight
highlightXAnimator->to = currentItem->item->x();
highlightYAnimator->to = currentItem->item->y();
@@ -1061,6 +1068,18 @@ void QDeclarativeGridViewPrivate::fixup(AxisData &data, qreal minExtent, qreal m
if (snapMode != QDeclarativeGridView::NoSnap) {
qreal tempPosition = isRightToLeftTopToBottom() ? -position()-size() : position();
+ if (snapMode == QDeclarativeGridView::SnapOneRow && moveReason == Mouse) {
+ // if we've been dragged < rowSize()/2 then bias towards the next row
+ qreal dist = data.move.value() - (data.pressPos - data.dragStartOffset);
+ qreal bias = 0;
+ if (data.velocity > 0 && dist > QML_FLICK_SNAPONETHRESHOLD && dist < rowSize()/2)
+ bias = rowSize()/2;
+ else if (data.velocity < 0 && dist < -QML_FLICK_SNAPONETHRESHOLD && dist > -rowSize()/2)
+ bias = -rowSize()/2;
+ if (isRightToLeftTopToBottom())
+ bias = -bias;
+ tempPosition -= bias;
+ }
FxGridItem *topItem = snapItemAt(tempPosition+highlightStart);
FxGridItem *bottomItem = snapItemAt(tempPosition+highlightEnd);
qreal pos;
@@ -1082,25 +1101,13 @@ void QDeclarativeGridViewPrivate::fixup(AxisData &data, qreal minExtent, qreal m
}
} else if (bottomItem) {
if (isRightToLeftTopToBottom())
- pos = qMax(qMin(-bottomItem->rowPos() + highlightStart - size(), -maxExtent), -minExtent);
+ pos = qMax(qMin(-bottomItem->rowPos() + highlightEnd - size(), -maxExtent), -minExtent);
else
- pos = qMax(qMin(bottomItem->rowPos() - highlightStart, -maxExtent), -minExtent);
+ pos = qMax(qMin(bottomItem->rowPos() - highlightEnd, -maxExtent), -minExtent);
} else {
QDeclarativeFlickablePrivate::fixup(data, minExtent, maxExtent);
return;
}
- if (currentItem && haveHighlightRange && highlightRange == QDeclarativeGridView::StrictlyEnforceRange) {
- updateHighlight();
- qreal currPos = currentItem->rowPos();
- if (isRightToLeftTopToBottom())
- pos = -pos-size(); // Transform Pos if required
- if (pos < currPos + rowSize() - highlightEnd)
- pos = currPos + rowSize() - highlightEnd;
- if (pos > currPos - highlightStart)
- pos = currPos - highlightStart;
- if (isRightToLeftTopToBottom())
- pos = -pos-size(); // Untransform
- }
qreal dist = qAbs(data.move + pos);
if (dist > 0) {
timeline.reset(data.move);
@@ -1157,9 +1164,14 @@ void QDeclarativeGridViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
if (velocity > 0) {
if (data.move.value() < minExtent) {
if (snapMode == QDeclarativeGridView::SnapOneRow) {
- if (FxGridItem *item = firstVisibleItem()) {
- maxDistance = qAbs(item->rowPos() + dataValue);
- }
+ // if we've been dragged < averageSize/2 then bias towards the next item
+ qreal dist = data.move.value() - (data.pressPos - data.dragStartOffset);
+ qreal bias = dist < rowSize()/2 ? rowSize()/2 : 0;
+ if (isRightToLeftTopToBottom())
+ bias = -bias;
+ data.flickTarget = -snapPosAt(-dataValue - bias);
+ maxDistance = qAbs(data.flickTarget - data.move.value());
+ velocity = maxVelocity;
} else {
maxDistance = qAbs(minExtent - data.move.value());
}
@@ -1169,8 +1181,14 @@ void QDeclarativeGridViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
} else {
if (data.move.value() > maxExtent) {
if (snapMode == QDeclarativeGridView::SnapOneRow) {
- qreal pos = snapPosAt(-dataValue) + (isRightToLeftTopToBottom() ? 0 : rowSize());
- maxDistance = qAbs(pos + dataValue);
+ // if we've been dragged < averageSize/2 then bias towards the next item
+ qreal dist = data.move.value() - (data.pressPos - data.dragStartOffset);
+ qreal bias = -dist < rowSize()/2 ? rowSize()/2 : 0;
+ if (isRightToLeftTopToBottom())
+ bias = -bias;
+ data.flickTarget = -snapPosAt(-dataValue + bias);
+ maxDistance = qAbs(data.flickTarget - data.move.value());
+ velocity = -maxVelocity;
} else {
maxDistance = qAbs(maxExtent - data.move.value());
}
@@ -1180,7 +1198,6 @@ void QDeclarativeGridViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
}
bool overShoot = boundsBehavior == QDeclarativeFlickable::DragAndOvershootBounds;
- qreal highlightStart = isRightToLeftTopToBottom() && highlightRangeStartValid ? size()-highlightRangeEnd : highlightRangeStart;
if (maxDistance > 0 || overShoot) {
// This mode requires the grid to stop exactly on a row boundary.
@@ -1200,9 +1217,20 @@ void QDeclarativeGridViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
dist = qMin(dist, maxDistance);
if (v > 0)
dist = -dist;
- qreal distTemp = isRightToLeftTopToBottom() ? -dist : dist;
- data.flickTarget = -snapPosAt(-(dataValue - highlightStart) + distTemp) + highlightStart;
+ if (snapMode != QDeclarativeGridView::SnapOneRow) {
+ qreal distTemp = isRightToLeftTopToBottom() ? -dist : dist;
+ data.flickTarget = -snapPosAt(-dataValue + distTemp);
+ }
data.flickTarget = isRightToLeftTopToBottom() ? -data.flickTarget+size() : data.flickTarget;
+ if (overShoot) {
+ if (data.flickTarget >= minExtent) {
+ overshootDist = overShootDistance(vSize);
+ data.flickTarget += overshootDist;
+ } else if (data.flickTarget <= maxExtent) {
+ overshootDist = overShootDistance(vSize);
+ data.flickTarget -= overshootDist;
+ }
+ }
qreal adjDist = -data.flickTarget + data.move.value();
if (qAbs(adjDist) > qAbs(dist)) {
// Prevent painfully slow flicking - adjust velocity to suit flickDeceleration
@@ -1223,14 +1251,14 @@ void QDeclarativeGridViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
timeline.reset(data.move);
timeline.accel(data.move, v, accel, maxDistance + overshootDist);
timeline.callback(QDeclarativeTimeLineCallback(&data.move, fixupCallback, this));
- if (!flickingHorizontally && q->xflick()) {
- flickingHorizontally = true;
+ if (!hData.flicking && q->xflick()) {
+ hData.flicking = true;
emit q->flickingChanged();
emit q->flickingHorizontallyChanged();
emit q->flickStarted();
}
- if (!flickingVertically && q->yflick()) {
- flickingVertically = true;
+ if (!vData.flicking && q->yflick()) {
+ vData.flicking = true;
emit q->flickingChanged();
emit q->flickingVerticallyChanged();
emit q->flickStarted();
@@ -1554,6 +1582,8 @@ void QDeclarativeGridView::setCurrentIndex(int index)
if (index == d->currentIndex)
return;
if (isComponentComplete() && d->isValid()) {
+ if (d->layoutScheduled)
+ d->layout();
d->moveReason = QDeclarativeGridViewPrivate::SetIndex;
d->updateCurrent(index);
} else {
@@ -2098,7 +2128,8 @@ bool QDeclarativeGridView::event(QEvent *event)
{
Q_D(QDeclarativeGridView);
if (event->type() == QEvent::User) {
- d->layout();
+ if (d->layoutScheduled)
+ d->layout();
return true;
}
@@ -2112,7 +2143,7 @@ void QDeclarativeGridView::viewportMoved()
if (!d->itemCount)
return;
d->lazyRelease = true;
- if (d->flickingHorizontally || d->flickingVertically) {
+ if (d->hData.flicking || d->vData.flicking) {
if (yflick()) {
if (d->vData.velocity > 0)
d->bufferMode = QDeclarativeGridViewPrivate::BufferBefore;
@@ -2128,7 +2159,7 @@ void QDeclarativeGridView::viewportMoved()
}
}
refill();
- if (d->flickingHorizontally || d->flickingVertically || d->movingHorizontally || d->movingVertically)
+ if (d->hData.flicking || d->vData.flicking || d->hData.moving || d->vData.moving)
d->moveReason = QDeclarativeGridViewPrivate::Mouse;
if (d->moveReason != QDeclarativeGridViewPrivate::SetIndex) {
if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange && d->highlight) {
@@ -2587,7 +2618,7 @@ void QDeclarativeGridView::positionViewAtIndex(int index, int mode)
/*!
\qmlmethod GridView::positionViewAtBeginning()
\qmlmethod GridView::positionViewAtEnd()
- \since Quick 1.1
+ \since QtQuick 1.1
Positions the view at the beginning or end, taking into account any header or footer.
@@ -2874,7 +2905,6 @@ void QDeclarativeGridView::itemsRemoved(int modelIndex, int count)
d->itemCount -= count;
bool currentRemoved = d->currentIndex >= modelIndex && d->currentIndex < modelIndex + count;
bool removedVisible = false;
-
// Remove the items from the visible list, skipping anything already marked for removal
QList<FxGridItem*>::Iterator it = d->visibleItems.begin();
while (it != d->visibleItems.end()) {
@@ -2908,6 +2938,11 @@ void QDeclarativeGridView::itemsRemoved(int modelIndex, int count)
}
}
+ // If we removed items before visible items a layout may be
+ // required to ensure item 0 is in the first column.
+ if (!removedVisible && modelIndex < d->visibleIndex)
+ d->scheduleLayout();
+
// fix current
if (d->currentIndex >= modelIndex + count) {
d->currentIndex -= count;
diff --git a/src/declarative/graphicsitems/qdeclarativeimage.cpp b/src/declarative/graphicsitems/qdeclarativeimage.cpp
index e6bb798..9b9d680 100644
--- a/src/declarative/graphicsitems/qdeclarativeimage.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeimage.cpp
@@ -473,7 +473,7 @@ QRectF QDeclarativeImage::boundingRect() const
/*!
\qmlproperty bool Image::cache
- \since Quick 1.1
+ \since QtQuick 1.1
Specifies whether the image should be cached. The default value is
true. Setting \a cache to false is useful when dealing with large images,
@@ -482,7 +482,7 @@ QRectF QDeclarativeImage::boundingRect() const
/*!
\qmlproperty bool Image::mirror
- \since Quick 1.1
+ \since QtQuick 1.1
This property holds whether the image should be horizontally inverted
(effectively displaying a mirrored image).
diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp
index 805ca4d..d36d163 100644
--- a/src/declarative/graphicsitems/qdeclarativeitem.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp
@@ -3480,7 +3480,7 @@ qreal QDeclarativeItem::implicitHeight() const
/*!
\qmlproperty real Item::implicitWidth
\qmlproperty real Item::implicitHeight
- \since Quick 1.1
+ \since QtQuick 1.1
Defines the natural width or height of the Item if no \l width or \l height is specified.
diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp
index 7a5e433..f0fc96b 100644
--- a/src/declarative/graphicsitems/qdeclarativelistview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp
@@ -53,9 +53,14 @@
#include <qlistmodelinterface_p.h>
#include <qmath.h>
#include <QKeyEvent>
+#include "qplatformdefs.h"
QT_BEGIN_NAMESPACE
+#ifndef QML_FLICK_SNAPONETHRESHOLD
+#define QML_FLICK_SNAPONETHRESHOLD 30
+#endif
+
void QDeclarativeViewSection::setProperty(const QString &property)
{
if (property != m_property) {
@@ -234,21 +239,6 @@ public:
return visibleItems.count() ? visibleItems.first() : 0;
}
- FxListItem *nextVisibleItem() const {
- const qreal pos = isRightToLeft() ? -position()-size() : position();
- bool foundFirst = false;
- for (int i = 0; i < visibleItems.count(); ++i) {
- FxListItem *item = visibleItems.at(i);
- if (item->index != -1) {
- if (foundFirst)
- return item;
- else if (item->position() < pos && item->endPosition() > pos)
- foundFirst = true;
- }
- }
- return 0;
- }
-
// Returns the item before modelIndex, if created.
// May return an item marked for removal.
FxListItem *itemBefore(int modelIndex) const {
@@ -1009,7 +999,7 @@ void QDeclarativeListViewPrivate::updateHighlight()
{
if ((!currentItem && highlight) || (currentItem && !highlight))
createHighlight();
- if (currentItem && autoHighlight && highlight && !movingHorizontally && !movingVertically) {
+ if (currentItem && autoHighlight && highlight && !hData.moving && !vData.moving) {
// auto-update highlight
highlightPosAnimator->to = isRightToLeft()
? -currentItem->itemPosition()-currentItem->itemSize()
@@ -1320,29 +1310,20 @@ void QDeclarativeListViewPrivate::fixup(AxisData &data, qreal minExtent, qreal m
highlightEnd = highlightRangeEnd;
}
- if (currentItem && haveHighlightRange && highlightRange == QDeclarativeListView::StrictlyEnforceRange
- && moveReason != QDeclarativeListViewPrivate::SetIndex) {
- updateHighlight();
- qreal pos = currentItem->itemPosition();
- if (viewPos < pos + currentItem->itemSize() - highlightEnd)
- viewPos = pos + currentItem->itemSize() - highlightEnd;
- if (viewPos > pos - highlightStart)
- viewPos = pos - highlightStart;
- if (isRightToLeft())
- viewPos = -viewPos-size();
-
- timeline.reset(data.move);
- if (viewPos != position()) {
- if (fixupMode != Immediate) {
- timeline.move(data.move, -viewPos, QEasingCurve(QEasingCurve::InOutQuad), fixupDuration/2);
- data.fixingUp = true;
- } else {
- timeline.set(data.move, -viewPos);
- }
- }
- vTime = timeline.time();
- } else if (snapMode != QDeclarativeListView::NoSnap && moveReason != QDeclarativeListViewPrivate::SetIndex) {
+ if (snapMode != QDeclarativeListView::NoSnap && moveReason != QDeclarativeListViewPrivate::SetIndex) {
qreal tempPosition = isRightToLeft() ? -position()-size() : position();
+ if (snapMode == QDeclarativeListView::SnapOneItem && moveReason == Mouse) {
+ // if we've been dragged < averageSize/2 then bias towards the next item
+ qreal dist = data.move.value() - (data.pressPos - data.dragStartOffset);
+ qreal bias = 0;
+ if (data.velocity > 0 && dist > QML_FLICK_SNAPONETHRESHOLD && dist < averageSize/2)
+ bias = averageSize/2;
+ else if (data.velocity < 0 && dist < -QML_FLICK_SNAPONETHRESHOLD && dist > -averageSize/2)
+ bias = -averageSize/2;
+ if (isRightToLeft())
+ bias = -bias;
+ tempPosition -= bias;
+ }
FxListItem *topItem = snapItemAt(tempPosition+highlightStart);
FxListItem *bottomItem = snapItemAt(tempPosition+highlightEnd);
qreal pos;
@@ -1358,9 +1339,9 @@ void QDeclarativeListViewPrivate::fixup(AxisData &data, qreal minExtent, qreal m
}
} else if (bottomItem && isInBounds) {
if (isRightToLeft())
- pos = qMax(qMin(-bottomItem->position() + highlightStart - size(), -maxExtent), -minExtent);
+ pos = qMax(qMin(-bottomItem->position() + highlightEnd - size(), -maxExtent), -minExtent);
else
- pos = qMax(qMin(bottomItem->position() - highlightStart, -maxExtent), -minExtent);
+ pos = qMax(qMin(bottomItem->position() - highlightEnd, -maxExtent), -minExtent);
} else {
QDeclarativeFlickablePrivate::fixup(data, minExtent, maxExtent);
return;
@@ -1377,6 +1358,27 @@ void QDeclarativeListViewPrivate::fixup(AxisData &data, qreal minExtent, qreal m
}
vTime = timeline.time();
}
+ } else if (currentItem && haveHighlightRange && highlightRange == QDeclarativeListView::StrictlyEnforceRange
+ && moveReason != QDeclarativeListViewPrivate::SetIndex) {
+ updateHighlight();
+ qreal pos = currentItem->itemPosition();
+ if (viewPos < pos + currentItem->itemSize() - highlightEnd)
+ viewPos = pos + currentItem->itemSize() - highlightEnd;
+ if (viewPos > pos - highlightStart)
+ viewPos = pos - highlightStart;
+ if (isRightToLeft())
+ viewPos = -viewPos-size();
+
+ timeline.reset(data.move);
+ if (viewPos != position()) {
+ if (fixupMode != Immediate) {
+ timeline.move(data.move, -viewPos, QEasingCurve(QEasingCurve::InOutQuad), fixupDuration/2);
+ data.fixingUp = true;
+ } else {
+ timeline.set(data.move, -viewPos);
+ }
+ }
+ vTime = timeline.time();
} else {
QDeclarativeFlickablePrivate::fixup(data, minExtent, maxExtent);
}
@@ -1398,12 +1400,19 @@ void QDeclarativeListViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
}
qreal maxDistance = 0;
qreal dataValue = isRightToLeft() ? -data.move.value()+size() : data.move.value();
+ qreal highlightStart = isRightToLeft() && highlightRangeStartValid ? size()-highlightRangeEnd : highlightRangeStart;
// -ve velocity means list is moving up/left
if (velocity > 0) {
if (data.move.value() < minExtent) {
- if (snapMode == QDeclarativeListView::SnapOneItem) {
- if (FxListItem *item = isRightToLeft() ? nextVisibleItem() : firstVisibleItem())
- maxDistance = qAbs(item->position() + dataValue);
+ if (snapMode == QDeclarativeListView::SnapOneItem && !hData.flicking && !vData.flicking) {
+ // if we've been dragged < averageSize/2 then bias towards the next item
+ qreal dist = data.move.value() - (data.pressPos - data.dragStartOffset);
+ qreal bias = dist < averageSize/2 ? averageSize/2 : 0;
+ if (isRightToLeft())
+ bias = -bias;
+ data.flickTarget = -snapPosAt(-(dataValue - highlightStart) - bias) + highlightStart;
+ maxDistance = qAbs(data.flickTarget - data.move.value());
+ velocity = maxVelocity;
} else {
maxDistance = qAbs(minExtent - data.move.value());
}
@@ -1412,9 +1421,15 @@ void QDeclarativeListViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
data.flickTarget = minExtent;
} else {
if (data.move.value() > maxExtent) {
- if (snapMode == QDeclarativeListView::SnapOneItem) {
- if (FxListItem *item = isRightToLeft() ? firstVisibleItem() : nextVisibleItem())
- maxDistance = qAbs(item->position() + dataValue);
+ if (snapMode == QDeclarativeListView::SnapOneItem && !hData.flicking && !vData.flicking) {
+ // if we've been dragged < averageSize/2 then bias towards the next item
+ qreal dist = data.move.value() - (data.pressPos - data.dragStartOffset);
+ qreal bias = -dist < averageSize/2 ? averageSize/2 : 0;
+ if (isRightToLeft())
+ bias = -bias;
+ data.flickTarget = -snapPosAt(-(dataValue - highlightStart) + bias) + highlightStart;
+ maxDistance = qAbs(data.flickTarget - data.move.value());
+ velocity = -maxVelocity;
} else {
maxDistance = qAbs(maxExtent - data.move.value());
}
@@ -1424,7 +1439,6 @@ void QDeclarativeListViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
}
bool overShoot = boundsBehavior == QDeclarativeFlickable::DragAndOvershootBounds;
- qreal highlightStart = isRightToLeft() && highlightRangeStartValid ? size()-highlightRangeEnd : highlightRangeStart;
if (maxDistance > 0 || overShoot) {
// These modes require the list to stop exactly on an item boundary.
@@ -1438,7 +1452,7 @@ void QDeclarativeListViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
else
v = maxVelocity;
}
- if (!flickingHorizontally && !flickingVertically) {
+ if (!hData.flicking && !vData.flicking) {
// the initial flick - estimate boundary
qreal accel = deceleration;
qreal v2 = v * v;
@@ -1450,8 +1464,10 @@ void QDeclarativeListViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
if (v > 0)
dist = -dist;
if ((maxDistance > 0.0 && v2 / (2.0f * maxDistance) < accel) || snapMode == QDeclarativeListView::SnapOneItem) {
- qreal distTemp = isRightToLeft() ? -dist : dist;
- data.flickTarget = -snapPosAt(-(dataValue - highlightStart) + distTemp) + highlightStart;
+ if (snapMode != QDeclarativeListView::SnapOneItem) {
+ qreal distTemp = isRightToLeft() ? -dist : dist;
+ data.flickTarget = -snapPosAt(-(dataValue - highlightStart) + distTemp) + highlightStart;
+ }
data.flickTarget = isRightToLeft() ? -data.flickTarget+size() : data.flickTarget;
if (overShoot) {
if (data.flickTarget >= minExtent) {
@@ -1489,14 +1505,14 @@ void QDeclarativeListViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
timeline.reset(data.move);
timeline.accel(data.move, v, accel, maxDistance + overshootDist);
timeline.callback(QDeclarativeTimeLineCallback(&data.move, fixupCallback, this));
- if (!flickingHorizontally && q->xflick()) {
- flickingHorizontally = true;
+ if (!hData.flicking && q->xflick()) {
+ hData.flicking = true;
emit q->flickingChanged();
emit q->flickingHorizontallyChanged();
emit q->flickStarted();
}
- if (!flickingVertically && q->yflick()) {
- flickingVertically = true;
+ if (!vData.flicking && q->yflick()) {
+ vData.flicking = true;
emit q->flickingChanged();
emit q->flickingVerticallyChanged();
emit q->flickStarted();
@@ -1872,6 +1888,8 @@ void QDeclarativeListView::setCurrentIndex(int index)
if (index == d->currentIndex)
return;
if (isComponentComplete() && d->isValid()) {
+ if (d->layoutScheduled)
+ d->layout();
d->moveReason = QDeclarativeListViewPrivate::SetIndex;
d->updateCurrent(index);
} else if (d->currentIndex != index) {
@@ -2557,7 +2575,8 @@ bool QDeclarativeListView::event(QEvent *event)
{
Q_D(QDeclarativeListView);
if (event->type() == QEvent::User) {
- d->layout();
+ if (d->layoutScheduled)
+ d->layout();
return true;
}
@@ -2576,7 +2595,7 @@ void QDeclarativeListView::viewportMoved()
d->inViewportMoved = true;
d->lazyRelease = true;
refill();
- if (d->flickingHorizontally || d->flickingVertically || d->movingHorizontally || d->movingVertically)
+ if (d->hData.flicking || d->vData.flicking || d->hData.moving || d->vData.moving)
d->moveReason = QDeclarativeListViewPrivate::Mouse;
if (d->moveReason != QDeclarativeListViewPrivate::SetIndex) {
if (d->haveHighlightRange && d->highlightRange == StrictlyEnforceRange && d->highlight) {
@@ -2610,7 +2629,7 @@ void QDeclarativeListView::viewportMoved()
}
}
- if ((d->flickingHorizontally || d->flickingVertically) && d->correctFlick && !d->inFlickCorrection) {
+ if ((d->hData.flicking || d->vData.flicking) && d->correctFlick && !d->inFlickCorrection) {
d->inFlickCorrection = true;
// Near an end and it seems that the extent has changed?
// Recalculate the flick so that we don't end up in an odd position.
@@ -3009,7 +3028,7 @@ void QDeclarativeListView::positionViewAtIndex(int index, int mode)
/*!
\qmlmethod ListView::positionViewAtBeginning()
\qmlmethod ListView::positionViewAtEnd()
- \since Quick 1.1
+ \since QtQuick 1.1
Positions the view at the beginning or end, taking into account any header or footer.
diff --git a/src/declarative/graphicsitems/qdeclarativemousearea.cpp b/src/declarative/graphicsitems/qdeclarativemousearea.cpp
index 18f008a..0e06a4c 100644
--- a/src/declarative/graphicsitems/qdeclarativemousearea.cpp
+++ b/src/declarative/graphicsitems/qdeclarativemousearea.cpp
@@ -419,7 +419,7 @@ void QDeclarativeMouseArea::setEnabled(bool a)
/*!
\qmlproperty bool MouseArea::preventStealing
- \since Quick 1.1
+ \since QtQuick 1.1
This property holds whether the mouse events may be stolen from this
MouseArea.
diff --git a/src/declarative/graphicsitems/qdeclarativepositioners.cpp b/src/declarative/graphicsitems/qdeclarativepositioners.cpp
index f3d1a68..483cad4 100644
--- a/src/declarative/graphicsitems/qdeclarativepositioners.cpp
+++ b/src/declarative/graphicsitems/qdeclarativepositioners.cpp
@@ -584,7 +584,7 @@ QDeclarativeRow::QDeclarativeRow(QDeclarativeItem *parent)
/*!
\qmlproperty enumeration Row::layoutDirection
- \since Quick 1.1
+ \since QtQuick 1.1
This property holds the layoutDirection of the row.
@@ -878,7 +878,7 @@ void QDeclarativeGrid::setFlow(Flow flow)
/*!
\qmlproperty enumeration Grid::layoutDirection
- \since Quick 1.1
+ \since QtQuick 1.1
This property holds the layout direction of the layout.
@@ -1236,7 +1236,7 @@ void QDeclarativeFlow::setFlow(Flow flow)
/*!
\qmlproperty enumeration Flow::layoutDirection
- \since Quick 1.1
+ \since QtQuick 1.1
This property holds the layout direction of the layout.
diff --git a/src/declarative/graphicsitems/qdeclarativerepeater.cpp b/src/declarative/graphicsitems/qdeclarativerepeater.cpp
index 813c255..e881b96 100644
--- a/src/declarative/graphicsitems/qdeclarativerepeater.cpp
+++ b/src/declarative/graphicsitems/qdeclarativerepeater.cpp
@@ -128,7 +128,7 @@ QDeclarativeRepeaterPrivate::~QDeclarativeRepeaterPrivate()
/*!
\qmlsignal Repeater::onItemAdded(int index, Item item)
- \since Quick 1.1
+ \since QtQuick 1.1
This handler is called when an item is added to the repeater. The \a index
parameter holds the index at which the item has been inserted within the
@@ -137,7 +137,7 @@ QDeclarativeRepeaterPrivate::~QDeclarativeRepeaterPrivate()
/*!
\qmlsignal Repeater::onItemRemoved(int index, Item item)
- \since Quick 1.1
+ \since QtQuick 1.1
This handler is called when an item is removed from the repeater. The \a index
parameter holds the index at which the item was removed from the repeater,
@@ -306,7 +306,7 @@ int QDeclarativeRepeater::count() const
/*!
\qmlmethod Item Repeater::itemAt(index)
- \since Quick 1.1
+ \since QtQuick 1.1
Returns the \l Item that has been created at the given \a index, or \c null
if no item exists at \a index.
diff --git a/src/declarative/graphicsitems/qdeclarativetext.cpp b/src/declarative/graphicsitems/qdeclarativetext.cpp
index 54ff406..20e4eef 100644
--- a/src/declarative/graphicsitems/qdeclarativetext.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetext.cpp
@@ -1190,7 +1190,7 @@ void QDeclarativeText::setWrapMode(WrapMode mode)
/*!
\qmlproperty int Text::lineCount
- \since Quick 1.1
+ \since QtQuick 1.1
Returns the number of lines visible in the text item.
@@ -1206,7 +1206,7 @@ int QDeclarativeText::lineCount() const
/*!
\qmlproperty bool Text::truncated
- \since Quick 1.1
+ \since QtQuick 1.1
Returns true if the text has been truncated due to \l maximumLineCount
or \l elide.
@@ -1223,7 +1223,7 @@ bool QDeclarativeText::truncated() const
/*!
\qmlproperty int Text::maximumLineCount
- \since Quick 1.1
+ \since QtQuick 1.1
Set this property to limit the number of lines that the text item will show.
If elide is set to Text.ElideRight, the text will be elided appropriately.
@@ -1457,7 +1457,7 @@ qreal QDeclarativeText::paintedHeight() const
/*!
\qmlproperty real Text::lineHeight
- \since Quick 1.1
+ \since QtQuick 1.1
Sets the line height for the text.
The value can be in pixels or a multiplier depending on lineHeightMode.
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
index 20b2e76..ca7e948 100644
--- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
@@ -107,7 +107,7 @@ TextEdit {
/*!
\qmlsignal TextEdit::onLinkActivated(string link)
- \since Quick 1.1
+ \since QtQuick 1.1
This handler is called when the user clicks on a link embedded in the text.
The link must be in rich text or HTML format and the
@@ -615,7 +615,7 @@ void QDeclarativeTextEdit::setWrapMode(WrapMode mode)
/*!
\qmlproperty int TextEdit::lineCount
- \since Quick 1.1
+ \since QtQuick 1.1
Returns the total number of lines in the textEdit item.
*/
@@ -709,7 +709,7 @@ void QDeclarativeTextEdit::moveCursorSelection(int pos)
/*!
\qmlmethod void TextEdit::moveCursorSelection(int position, SelectionMode mode = TextEdit.SelectCharacters)
- \since Quick 1.1
+ \since QtQuick 1.1
Moves the cursor to \a position and updates the selection according to the optional \a mode
parameter. (To only move the cursor, set the \l cursorPosition property.)
@@ -1074,7 +1074,7 @@ void QDeclarativeTextEdit::setSelectByMouse(bool on)
/*!
\qmlproperty enum TextEdit::mouseSelectionMode
- \since Quick 1.1
+ \since QtQuick 1.1
Specifies how text should be selected using a mouse.
@@ -1220,7 +1220,7 @@ void QDeclarativeTextEditPrivate::focusChanged(bool hasFocus)
/*!
\qmlmethod void TextEdit::deselect()
- \since Quick 1.1
+ \since QtQuick 1.1
Removes active text selection.
*/
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
index d2897eb..7014571 100644
--- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
@@ -1014,7 +1014,7 @@ int QDeclarativeTextInput::positionAt(int x) const
/*!
\qmlmethod int TextInput::positionAt(int x, CursorPosition position = CursorBetweenCharacters)
- \since Quick 1.1
+ \since QtQuick 1.1
This function returns the character position at
x pixels from the left of the textInput. Position 0 is before the
@@ -1402,7 +1402,7 @@ QVariant QDeclarativeTextInput::inputMethodQuery(Qt::InputMethodQuery property)
/*!
\qmlmethod void TextInput::deselect()
- \since Quick 1.1
+ \since QtQuick 1.1
Removes active text selection.
*/
@@ -1574,7 +1574,7 @@ void QDeclarativeTextInput::setSelectByMouse(bool on)
/*!
\qmlproperty enum TextInput::mouseSelectionMode
- \since Quick 1.1
+ \since QtQuick 1.1
Specifies how text should be selected using a mouse.
@@ -1622,7 +1622,7 @@ void QDeclarativeTextInput::moveCursorSelection(int position)
/*!
\qmlmethod void TextInput::moveCursorSelection(int position, SelectionMode mode = TextInput.SelectCharacters)
- \since Quick 1.1
+ \since QtQuick 1.1
Moves the cursor to \a position and updates the selection according to the optional \a mode
parameter. (To only move the cursor, set the \l cursorPosition property.)