summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-02-26 02:01:05 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-02-26 02:01:05 (GMT)
commit5fb329228bd1cd1126428b045a41a4a9c1033dc5 (patch)
treef93828abe89818729d717d3e9cdae94929f6fb13 /src
parent3218d437a13ac82f65abcea0db099f54504c8875 (diff)
downloadQt-5fb329228bd1cd1126428b045a41a4a9c1033dc5.zip
Qt-5fb329228bd1cd1126428b045a41a4a9c1033dc5.tar.gz
Qt-5fb329228bd1cd1126428b045a41a4a9c1033dc5.tar.bz2
Renamed Flickable viewportXXX properties contentXXX
A viewport is the thing you look through, not what you look at.
Diffstat (limited to 'src')
-rw-r--r--src/declarative/QmlChanges.txt5
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflickable.cpp64
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflickable_p.h37
-rw-r--r--src/declarative/graphicsitems/qdeclarativegridview.cpp22
-rw-r--r--src/declarative/graphicsitems/qdeclarativelistview.cpp14
5 files changed, 62 insertions, 80 deletions
diff --git a/src/declarative/QmlChanges.txt b/src/declarative/QmlChanges.txt
index cf1080b..25e0088 100644
--- a/src/declarative/QmlChanges.txt
+++ b/src/declarative/QmlChanges.txt
@@ -1,6 +1,11 @@
=============================================================================
The changes below are pre Qt 4.7.0 alpha
+Flickable: renamed viewportWidth -> contentWidth
+Flickable: renamed viewportHeight -> contentHeight
+Flickable: renamed viewportX -> contentX
+Flickable: renamed viewportY -> contentY
+Removed Flickable.reportedVelocitySmoothing
Renamed MouseRegion -> MouseArea
QmlView
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
index 9f19f53..3e595f1 100644
--- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
@@ -142,8 +142,8 @@ void QDeclarativeFlickablePrivate::init()
QObject::connect(&timeline, SIGNAL(completed()), q, SLOT(movementEnding()));
q->setAcceptedMouseButtons(Qt::LeftButton);
q->setFiltersChildEvents(true);
- QObject::connect(viewport, SIGNAL(xChanged()), q, SIGNAL(positionXChanged()));
- QObject::connect(viewport, SIGNAL(yChanged()), q, SIGNAL(positionYChanged()));
+ QObject::connect(viewport, SIGNAL(xChanged()), q, SIGNAL(contentXChanged()));
+ QObject::connect(viewport, SIGNAL(yChanged()), q, SIGNAL(contentYChanged()));
QObject::connect(q, SIGNAL(heightChanged()), q, SLOT(heightChange()));
QObject::connect(q, SIGNAL(widthChanged()), q, SLOT(widthChange()));
}
@@ -343,7 +343,7 @@ void QDeclarativeFlickablePrivate::updateBeginningEnd()
\code
Flickable {
- width: 200; height: 200; viewportWidth: image.width; viewportHeight: image.height
+ width: 200; height: 200; contentWidth: image.width; contentHeight: image.height
Image { id: image; source: "bigimage.png" }
}
\endcode
@@ -429,20 +429,20 @@ QDeclarativeFlickable::~QDeclarativeFlickable()
}
/*!
- \qmlproperty int Flickable::viewportX
- \qmlproperty int Flickable::viewportY
+ \qmlproperty int Flickable::contentX
+ \qmlproperty int Flickable::contentY
These properties hold the surface coordinate currently at the top-left
corner of the Flickable. For example, if you flick an image up 100 pixels,
- \c yPosition will be 100.
+ \c contentY will be 100.
*/
-qreal QDeclarativeFlickable::viewportX() const
+qreal QDeclarativeFlickable::contentX() const
{
Q_D(const QDeclarativeFlickable);
return -d->_moveX.value();
}
-void QDeclarativeFlickable::setViewportX(qreal pos)
+void QDeclarativeFlickable::setContentX(qreal pos)
{
Q_D(QDeclarativeFlickable);
pos = qRound(pos);
@@ -454,13 +454,13 @@ void QDeclarativeFlickable::setViewportX(qreal pos)
}
}
-qreal QDeclarativeFlickable::viewportY() const
+qreal QDeclarativeFlickable::contentY() const
{
Q_D(const QDeclarativeFlickable);
return -d->_moveY.value();
}
-void QDeclarativeFlickable::setViewportY(qreal pos)
+void QDeclarativeFlickable::setContentY(qreal pos)
{
Q_D(QDeclarativeFlickable);
pos = qRound(pos);
@@ -506,12 +506,10 @@ void QDeclarativeFlickable::setInteractive(bool interactive)
/*!
\qmlproperty real Flickable::horizontalVelocity
\qmlproperty real Flickable::verticalVelocity
- \qmlproperty real Flickable::reportedVelocitySmoothing
The instantaneous velocity of movement along the x and y axes, in pixels/sec.
The reported velocity is smoothed to avoid erratic output.
- reportedVelocitySmoothing determines how much smoothing is applied.
*/
qreal QDeclarativeFlickable::horizontalVelocity() const
{
@@ -584,8 +582,8 @@ QDeclarativeFlickableVisibleArea *QDeclarativeFlickable::visibleArea()
\list
\o AutoFlickDirection (default) - allows flicking vertically if the
- \e viewportHeight is not equal to the \e height of the Flickable.
- Allows flicking horizontally if the \e viewportWidth is not equal
+ \e contentHeight is not equal to the \e height of the Flickable.
+ Allows flicking horizontally if the \e contentWidth is not equal
to the \e width of the Flickable.
\o HorizontalFlick - allows flicking horizontally.
\o VerticalFlick - allows flicking vertically.
@@ -992,26 +990,26 @@ void QDeclarativeFlickable::setOverShoot(bool o)
}
/*!
- \qmlproperty int Flickable::viewportWidth
- \qmlproperty int Flickable::viewportHeight
+ \qmlproperty int Flickable::contentWidth
+ \qmlproperty int Flickable::contentHeight
The dimensions of the viewport (the surface controlled by Flickable). Typically this
should be set to the combined size of the items placed in the Flickable.
\code
Flickable {
- width: 320; height: 480; viewportWidth: image.width; viewportHeight: image.height
+ width: 320; height: 480; contentWidth: image.width; contentHeight: image.height
Image { id: image; source: "bigimage.png" }
}
\endcode
*/
-qreal QDeclarativeFlickable::viewportWidth() const
+qreal QDeclarativeFlickable::contentWidth() const
{
Q_D(const QDeclarativeFlickable);
return d->vWidth;
}
-void QDeclarativeFlickable::setViewportWidth(qreal w)
+void QDeclarativeFlickable::setContentWidth(qreal w)
{
Q_D(QDeclarativeFlickable);
if (d->vWidth == w)
@@ -1024,7 +1022,7 @@ void QDeclarativeFlickable::setViewportWidth(qreal w)
// Make sure that we're entirely in view.
if (!d->pressed)
d->fixupX();
- emit viewportWidthChanged();
+ emit contentWidthChanged();
d->updateBeginningEnd();
}
@@ -1033,7 +1031,7 @@ void QDeclarativeFlickable::widthChange()
Q_D(QDeclarativeFlickable);
if (d->vWidth < 0) {
d->viewport->setWidth(width());
- emit viewportWidthChanged();
+ emit contentWidthChanged();
}
d->updateBeginningEnd();
}
@@ -1043,18 +1041,18 @@ void QDeclarativeFlickable::heightChange()
Q_D(QDeclarativeFlickable);
if (d->vHeight < 0) {
d->viewport->setHeight(height());
- emit viewportHeightChanged();
+ emit contentHeightChanged();
}
d->updateBeginningEnd();
}
-qreal QDeclarativeFlickable::viewportHeight() const
+qreal QDeclarativeFlickable::contentHeight() const
{
Q_D(const QDeclarativeFlickable);
return d->vHeight;
}
-void QDeclarativeFlickable::setViewportHeight(qreal h)
+void QDeclarativeFlickable::setContentHeight(qreal h)
{
Q_D(QDeclarativeFlickable);
if (d->vHeight == h)
@@ -1067,7 +1065,7 @@ void QDeclarativeFlickable::setViewportHeight(qreal h)
// Make sure that we're entirely in view.
if (!d->pressed)
d->fixupY();
- emit viewportHeightChanged();
+ emit contentHeightChanged();
d->updateBeginningEnd();
}
@@ -1259,22 +1257,6 @@ void QDeclarativeFlickable::setPressDelay(int delay)
emit pressDelayChanged();
}
-qreal QDeclarativeFlickable::reportedVelocitySmoothing() const
-{
- Q_D(const QDeclarativeFlickable);
- return d->reportedVelocitySmoothing;
-}
-
-void QDeclarativeFlickable::setReportedVelocitySmoothing(qreal reportedVelocitySmoothing)
-{
- Q_D(QDeclarativeFlickable);
- Q_ASSERT(reportedVelocitySmoothing >= 0);
- if (reportedVelocitySmoothing == d->reportedVelocitySmoothing)
- return;
- d->reportedVelocitySmoothing = reportedVelocitySmoothing;
- emit reportedVelocitySmoothingChanged(reportedVelocitySmoothing);
-}
-
/*!
\qmlproperty bool Flickable::moving
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable_p.h b/src/declarative/graphicsitems/qdeclarativeflickable_p.h
index 19fb2a9..4617688 100644
--- a/src/declarative/graphicsitems/qdeclarativeflickable_p.h
+++ b/src/declarative/graphicsitems/qdeclarativeflickable_p.h
@@ -56,14 +56,13 @@ class Q_DECLARATIVE_EXPORT QDeclarativeFlickable : public QDeclarativeItem
{
Q_OBJECT
- Q_PROPERTY(qreal viewportWidth READ viewportWidth WRITE setViewportWidth NOTIFY viewportWidthChanged)
- Q_PROPERTY(qreal viewportHeight READ viewportHeight WRITE setViewportHeight NOTIFY viewportHeightChanged)
- Q_PROPERTY(qreal viewportX READ viewportX WRITE setViewportX NOTIFY positionXChanged)
- Q_PROPERTY(qreal viewportY READ viewportY WRITE setViewportY NOTIFY positionYChanged)
+ Q_PROPERTY(qreal contentWidth READ contentWidth WRITE setContentWidth NOTIFY contentWidthChanged)
+ Q_PROPERTY(qreal contentHeight READ contentHeight WRITE setContentHeight NOTIFY contentHeightChanged)
+ Q_PROPERTY(qreal contentX READ contentX WRITE setContentX NOTIFY contentXChanged)
+ Q_PROPERTY(qreal contentY READ contentY WRITE setContentY NOTIFY contentYChanged)
Q_PROPERTY(qreal horizontalVelocity READ horizontalVelocity NOTIFY horizontalVelocityChanged)
Q_PROPERTY(qreal verticalVelocity READ verticalVelocity NOTIFY verticalVelocityChanged)
- Q_PROPERTY(qreal reportedVelocitySmoothing READ reportedVelocitySmoothing WRITE setReportedVelocitySmoothing NOTIFY reportedVelocitySmoothingChanged)
Q_PROPERTY(bool overShoot READ overShoot WRITE setOverShoot NOTIFY overShootChanged)
Q_PROPERTY(qreal maximumFlickVelocity READ maximumFlickVelocity WRITE setMaximumFlickVelocity NOTIFY maximumFlickVelocityChanged)
@@ -98,17 +97,17 @@ public:
bool overShoot() const;
void setOverShoot(bool);
- qreal viewportWidth() const;
- void setViewportWidth(qreal);
+ qreal contentWidth() const;
+ void setContentWidth(qreal);
- qreal viewportHeight() const;
- void setViewportHeight(qreal);
+ qreal contentHeight() const;
+ void setContentHeight(qreal);
- qreal viewportX() const;
- void setViewportX(qreal pos);
+ qreal contentX() const;
+ void setContentX(qreal pos);
- qreal viewportY() const;
- void setViewportY(qreal pos);
+ qreal contentY() const;
+ void setContentY(qreal pos);
bool isMoving() const;
bool isFlicking() const;
@@ -116,9 +115,6 @@ public:
int pressDelay() const;
void setPressDelay(int delay);
- qreal reportedVelocitySmoothing() const;
- void setReportedVelocitySmoothing(qreal);
-
qreal maximumFlickVelocity() const;
void setMaximumFlickVelocity(qreal);
@@ -143,17 +139,16 @@ public:
void setFlickDirection(FlickDirection);
Q_SIGNALS:
- void viewportWidthChanged();
- void viewportHeightChanged();
- void positionXChanged();
- void positionYChanged();
+ void contentWidthChanged();
+ void contentHeightChanged();
+ void contentXChanged();
+ void contentYChanged();
void movingChanged();
void flickingChanged();
void movementStarted();
void movementEnded();
void flickStarted();
void flickEnded();
- void reportedVelocitySmoothingChanged(int);
void horizontalVelocityChanged();
void verticalVelocityChanged();
void isAtBoundaryChanged();
diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp
index ab5022b..0a103f3 100644
--- a/src/declarative/graphicsitems/qdeclarativegridview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp
@@ -133,14 +133,14 @@ public:
qreal position() const {
Q_Q(const QDeclarativeGridView);
- return flow == QDeclarativeGridView::LeftToRight ? q->viewportY() : q->viewportX();
+ return flow == QDeclarativeGridView::LeftToRight ? q->contentY() : q->contentX();
}
void setPosition(qreal pos) {
Q_Q(QDeclarativeGridView);
if (flow == QDeclarativeGridView::LeftToRight)
- q->setViewportY(pos);
+ q->setContentY(pos);
else
- q->setViewportX(pos);
+ q->setContentX(pos);
}
int size() const {
Q_Q(const QDeclarativeGridView);
@@ -458,9 +458,9 @@ void QDeclarativeGridViewPrivate::refill(qreal from, qreal to, bool doBuffer)
}
if (changed) {
if (flow == QDeclarativeGridView::LeftToRight)
- q->setViewportHeight(endPosition() - startPosition());
+ q->setContentHeight(endPosition() - startPosition());
else
- q->setViewportWidth(endPosition() - startPosition());
+ q->setContentWidth(endPosition() - startPosition());
} else if (!doBuffer && buffer && bufferMode != NoBuffer) {
refill(from, to, true);
}
@@ -473,9 +473,9 @@ void QDeclarativeGridViewPrivate::updateGrid()
columns = (int)qMax((flow == QDeclarativeGridView::LeftToRight ? q->width() : q->height()) / colSize(), qreal(1.));
if (isValid()) {
if (flow == QDeclarativeGridView::LeftToRight)
- q->setViewportHeight(endPosition() - startPosition());
+ q->setContentHeight(endPosition() - startPosition());
else
- q->setViewportWidth(endPosition() - startPosition());
+ q->setContentWidth(endPosition() - startPosition());
}
}
@@ -516,10 +516,10 @@ void QDeclarativeGridViewPrivate::layout(bool removed)
updateHighlight();
moveReason = Other;
if (flow == QDeclarativeGridView::LeftToRight) {
- q->setViewportHeight(endPosition() - startPosition());
+ q->setContentHeight(endPosition() - startPosition());
fixupY();
} else {
- q->setViewportWidth(endPosition() - startPosition());
+ q->setContentWidth(endPosition() - startPosition());
fixupX();
}
updateUnrequestedPositions();
@@ -1028,10 +1028,10 @@ void QDeclarativeGridView::setFlow(Flow flow)
if (d->flow != flow) {
d->flow = flow;
if (d->flow == LeftToRight) {
- setViewportWidth(-1);
+ setContentWidth(-1);
setFlickDirection(QDeclarativeFlickable::VerticalFlick);
} else {
- setViewportHeight(-1);
+ setContentHeight(-1);
setFlickDirection(QDeclarativeFlickable::HorizontalFlick);
}
d->clear();
diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp
index e6b6f2a..6421018 100644
--- a/src/declarative/graphicsitems/qdeclarativelistview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp
@@ -203,14 +203,14 @@ public:
qreal position() const {
Q_Q(const QDeclarativeListView);
- return orient == QDeclarativeListView::Vertical ? q->viewportY() : q->viewportX();
+ return orient == QDeclarativeListView::Vertical ? q->contentY() : q->contentX();
}
void setPosition(qreal pos) {
Q_Q(QDeclarativeListView);
if (orient == QDeclarativeListView::Vertical)
- q->setViewportY(pos);
+ q->setContentY(pos);
else
- q->setViewportX(pos);
+ q->setContentX(pos);
}
qreal size() const {
Q_Q(const QDeclarativeListView);
@@ -382,9 +382,9 @@ public:
void updateViewport() {
Q_Q(QDeclarativeListView);
if (orient == QDeclarativeListView::Vertical) {
- q->setViewportHeight(endPosition() - startPosition() + 1);
+ q->setContentHeight(endPosition() - startPosition() + 1);
} else {
- q->setViewportWidth(endPosition() - startPosition() + 1);
+ q->setContentWidth(endPosition() - startPosition() + 1);
}
}
@@ -1819,10 +1819,10 @@ void QDeclarativeListView::setOrientation(QDeclarativeListView::Orientation orie
if (d->orient != orientation) {
d->orient = orientation;
if (d->orient == QDeclarativeListView::Vertical) {
- setViewportWidth(-1);
+ setContentWidth(-1);
setFlickDirection(VerticalFlick);
} else {
- setViewportHeight(-1);
+ setContentHeight(-1);
setFlickDirection(HorizontalFlick);
}
d->clear();