summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-01-06 20:05:55 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-01-06 20:05:55 (GMT)
commit4dd54e88efc6899a0024ddb1412c4093d7d4aebb (patch)
treeb7ea7af33d75d27d104d736b77d08579635d1f95 /src
parent349a6ff44c8c6e6560d709975c1521964fd1fc27 (diff)
parent436ce764bada3e8fe3c9d4e7322f38f41e95324c (diff)
downloadQt-4dd54e88efc6899a0024ddb1412c4093d7d4aebb.zip
Qt-4dd54e88efc6899a0024ddb1412c4093d7d4aebb.tar.gz
Qt-4dd54e88efc6899a0024ddb1412c4093d7d4aebb.tar.bz2
Merge branch 'qt-master-from-4.7' of scm.dev.nokia.troll.no:qt/qt-integration into master-integration
* 'qt-master-from-4.7' of scm.dev.nokia.troll.no:qt/qt-integration: PathView crashed when the path is provided with undefined values. PathView: update modelCount before attempting to regenerate delegates. Update docs - calling overloaded functions from QML is now supported Doc fixes for introduction page and Item docs
Diffstat (limited to 'src')
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitem.cpp28
-rw-r--r--src/declarative/graphicsitems/qdeclarativepath.cpp8
-rw-r--r--src/declarative/graphicsitems/qdeclarativepathview.cpp4
3 files changed, 10 insertions, 30 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp
index 24d9b03..922fa8f 100644
--- a/src/declarative/graphicsitems/qdeclarativeitem.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp
@@ -1333,23 +1333,6 @@ QDeclarativeKeysAttached *QDeclarativeKeysAttached::qmlAttachedProperties(QObjec
}
\endqml
- \section1 Identity
-
- Each item has an "id" - the identifier of the Item.
-
- The identifier can be used in bindings and other expressions to
- refer to the item. For example:
-
- \qml
- Text { id: myText; ... }
- Text { text: myText.text }
- \endqml
-
- The identifier is available throughout to the \l {components}{component}
- where it is declared. The identifier must be unique in the component.
-
- The id should not be thought of as a "property" - it makes no sense
- to write \c myText.id, for example.
\section1 Key Handling
@@ -1376,17 +1359,6 @@ QDeclarativeKeysAttached *QDeclarativeKeysAttached::qmlAttachedProperties(QObjec
\endqml
See the \l {Keys}{Keys} attached property for detailed documentation.
-
- \section1 Property Change Signals
-
- Most properties on Item and Item derivatives have a signal
- emitted when they change. By convention, the signals are
- named <propertyName>Changed, e.g. xChanged will be emitted when an item's
- x property changes. Note that these also have signal handers e.g.
- the onXChanged signal handler will be called when an item's x property
- changes. For many properties in Item or Item derivatives this can be used
- to add a touch of imperative logic to your application (when absolutely
- necessary).
*/
/*!
diff --git a/src/declarative/graphicsitems/qdeclarativepath.cpp b/src/declarative/graphicsitems/qdeclarativepath.cpp
index 966c51b..e63a2c3 100644
--- a/src/declarative/graphicsitems/qdeclarativepath.cpp
+++ b/src/declarative/graphicsitems/qdeclarativepath.cpp
@@ -46,6 +46,8 @@
#include <QTime>
#include <private/qbezier_p.h>
+#include <QtCore/qmath.h>
+#include <QtCore/qnumeric.h>
QT_BEGIN_NAMESPACE
@@ -367,9 +369,11 @@ void QDeclarativePath::createPointCache() const
{
Q_D(const QDeclarativePath);
qreal pathLength = d->_path.length();
+ if (pathLength <= 0 || qIsNaN(pathLength))
+ return;
// more points means less jitter between items as they move along the
// path, but takes longer to generate
- const int points = int(pathLength*5);
+ const int points = qCeil(pathLength*5);
const int lastElement = d->_path.elementCount() - 1;
d->_pointCache.resize(points+1);
@@ -418,6 +422,8 @@ QPointF QDeclarativePath::pointAt(qreal p) const
Q_D(const QDeclarativePath);
if (d->_pointCache.isEmpty()) {
createPointCache();
+ if (d->_pointCache.isEmpty())
+ return QPointF();
}
int idx = qRound(p*d->_pointCache.size());
if (idx >= d->_pointCache.size())
diff --git a/src/declarative/graphicsitems/qdeclarativepathview.cpp b/src/declarative/graphicsitems/qdeclarativepathview.cpp
index e3987d0..74d3418 100644
--- a/src/declarative/graphicsitems/qdeclarativepathview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativepathview.cpp
@@ -1318,8 +1318,10 @@ void QDeclarativePathView::componentComplete()
// It is possible that a refill has already happended to to Path
// bindings being handled in the componentComplete(). If so
// don't do it again.
- if (d->items.count() == 0)
+ if (d->items.count() == 0 && d->model) {
+ d->modelCount = d->model->count();
d->regenerate();
+ }
d->updateHighlight();
}