diff options
author | Martin Jones <martin.jones@nokia.com> | 2009-11-17 00:19:23 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2009-11-17 00:19:23 (GMT) |
commit | 5b3cc2f64f15b48edaa6f2470c96e87ab98390c5 (patch) | |
tree | 4b75783396ca2d8a8a1a645adc0fe66cff8ca4a3 /tests/auto/declarative | |
parent | b06323a055b19164601d8f6a5d11eaa247310bb2 (diff) | |
download | Qt-5b3cc2f64f15b48edaa6f2470c96e87ab98390c5.zip Qt-5b3cc2f64f15b48edaa6f2470c96e87ab98390c5.tar.gz Qt-5b3cc2f64f15b48edaa6f2470c96e87ab98390c5.tar.bz2 |
Improve ListView cacheBuffer test.
Diffstat (limited to 'tests/auto/declarative')
-rw-r--r-- | tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp b/tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp index 5a557bf..c5dadab 100644 --- a/tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp +++ b/tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp @@ -97,10 +97,12 @@ class TestObject : public QObject Q_PROPERTY(bool error READ error WRITE setError NOTIFY changedError) Q_PROPERTY(bool animate READ animate NOTIFY changedAnim) Q_PROPERTY(bool invalidHighlight READ invalidHighlight NOTIFY changedHl) + Q_PROPERTY(int cacheBuffer READ cacheBuffer NOTIFY changedCacheBuffer) public: TestObject(QObject *parent = 0) - : QObject(parent), mError(true), mAnimate(false), mInvalidHighlight(false) {} + : QObject(parent), mError(true), mAnimate(false), mInvalidHighlight(false) + , mCacheBuffer(0) {} bool error() const { return mError; } void setError(bool err) { mError = err; emit changedError(); } @@ -111,15 +113,20 @@ public: bool invalidHighlight() const { return mInvalidHighlight; } void setInvalidHighlight(bool invalid) { mInvalidHighlight = invalid; emit changedHl(); } + int cacheBuffer() const { return mCacheBuffer; } + void setCacheBuffer(int buffer) { mCacheBuffer = buffer; emit changedCacheBuffer(); } + signals: void changedError(); void changedAnim(); void changedHl(); + void changedCacheBuffer(); public: bool mError; bool mAnimate; bool mInvalidHighlight; + int mCacheBuffer; }; class TestModel : public QListModelInterface @@ -1019,7 +1026,7 @@ void tst_QmlGraphicsListView::cacheBuffer() QVERIFY(item->y() == i*20); } - listview->setCacheBuffer(400); + testObject->setCacheBuffer(400); QVERIFY(listview->cacheBuffer() == 400); int newItemCount = findItems<QmlGraphicsItem>(viewport, "wrapper").count(); |