aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/shared
diff options
context:
space:
mode:
authorAndrew den Exter <andrew.den-exter@nokia.com>2012-05-25 11:41:17 +1000
committerQt by Nokia <qt-info@nokia.com>2012-05-28 05:30:34 +0200
commit2533a40cf26ded5b777aae6b3c49813a044ab735 (patch)
treedc58ecb893b0049dba16b4926bc211fb8874ae5f /tests/auto/quick/shared
parentd4dad3a0b83c921ed4d746eb9694be8b008bcc1a (diff)
Fix PathView not updating after all items are removed from the model.
Always clear the layoutScheduled flag on a refill even if there are no items to create, otherwise future layouts won't be scheduled because it appears one is already pending. Fixes an issue in the dragselection example where items that should have moved to the PathView instead disappeared. Change-Id: I4302b5b43184c697a78f5c09dc3811326e2271ca Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'tests/auto/quick/shared')
-rw-r--r--tests/auto/quick/shared/util.pri2
-rw-r--r--tests/auto/quick/shared/viewtestutil.h3
-rw-r--r--tests/auto/quick/shared/visualtestutil.h6
3 files changed, 9 insertions, 2 deletions
diff --git a/tests/auto/quick/shared/util.pri b/tests/auto/quick/shared/util.pri
index aa79c7ca98..28036f109c 100644
--- a/tests/auto/quick/shared/util.pri
+++ b/tests/auto/quick/shared/util.pri
@@ -1,4 +1,6 @@
+QT += core-private gui-private v8-private qml-private quick-private
+
HEADERS += $$PWD/visualtestutil.h \
$$PWD/viewtestutil.h
SOURCES += $$PWD/visualtestutil.cpp \
diff --git a/tests/auto/quick/shared/viewtestutil.h b/tests/auto/quick/shared/viewtestutil.h
index 06efd9c28e..10ecd6a2ce 100644
--- a/tests/auto/quick/shared/viewtestutil.h
+++ b/tests/auto/quick/shared/viewtestutil.h
@@ -60,7 +60,7 @@ namespace QQuickViewTestUtil
QList<int> adjustIndexesForRemoveDisplaced(const QList<int> &indexes, int index, int count);
struct ListChange {
- enum { Inserted, Removed, Moved, SetCurrent, SetContentY } type;
+ enum { Inserted, Removed, Moved, SetCurrent, SetContentY, Polish } type;
int index;
int count;
int to; // Move
@@ -71,6 +71,7 @@ namespace QQuickViewTestUtil
static ListChange move(int index, int to, int count) { ListChange c = { Moved, index, count, to, 0.0 }; return c; }
static ListChange setCurrent(int index) { ListChange c = { SetCurrent, index, -1, -1, 0.0 }; return c; }
static ListChange setContentY(qreal pos) { ListChange c = { SetContentY, -1, -1, -1, pos }; return c; }
+ static ListChange polish() { ListChange c = { Polish, -1, -1, -1, 0.0 }; return c; }
};
class QmlListModel : public QListModelInterface
diff --git a/tests/auto/quick/shared/visualtestutil.h b/tests/auto/quick/shared/visualtestutil.h
index 9407ff8e8f..c2fc9cc01f 100644
--- a/tests/auto/quick/shared/visualtestutil.h
+++ b/tests/auto/quick/shared/visualtestutil.h
@@ -45,6 +45,8 @@
#include <QtQuick/QQuickItem>
#include <QtQml/QQmlExpression>
+#include <QtQuick/private/qquickitem_p.h>
+
namespace QQuickVisualTestUtil
{
QQuickItem *findVisibleChild(QQuickItem *parent, const QString &objectName);
@@ -106,7 +108,9 @@ namespace QQuickVisualTestUtil
items << qobject_cast<QQuickItem*>(findItem<T>(parent, objectName, indexes[i]));
return items;
}
-
}
+#define QQUICK_VERIFY_POLISH(item) \
+ QTRY_COMPARE(QQuickItemPrivate::get(item)->polishScheduled, false)
+
#endif // QQUICKVISUALTESTUTIL_H