Commit Graph

19 Commits

Author SHA1 Message Date
Richard Moe Gustavsen 1841a9e41d QQuickListView: implement support for reusing items
This patch will implement delegate item recycling in
ListView. The API will be the same as used in TableView, except
that it will be off by default since the behavior of a delegate
that is reused is not compatible with legacy applications
which were not written with this in mind.

Most importantly:

- Component.onCompleted will only be called on a delegate the
first time it's created, and never when it's reused.

- Any user-declared properties in the delegate (that is, not
model roles, index, etc) will not be cleared or updated when an
item is reused. The application must do this manually upon
receiving the pooled or reused signal in the item.

[ChangeLog][ListView] ListView now has support for reusing delegate
items. This can be switched on by setting the reuseItems property of
ListView to true.

Task-number: QTBUG-80507
Change-Id: I68cc8300b050e4a1f89feebb1d31a2fd9189c793
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-12-04 01:35:02 +01:00
Ulf Hermann 325e6305b4 Move model types into their own library
The model types are not part of the core QML runtime and should only be
loaded if you explicitly import them. We cannot enforce that in Qt5 as
some of them are available from the QtQml import, but we can change it
in Qt6.

Change-Id: I1e49e84d748e352537ec2d4af901c034c91d038f
Reviewed-by: Erik Verbruggen <erik.verbruggen@me.com>
2019-05-02 09:26:04 +00:00
Paolo Angelelli 6536076b1f Add itemAtIndex to quick views
This patch adds itemAtIndex method to ItemView-derived views and
to PathView.

[ChangeLog][QtQuick][QQuickItemView] Added itemAtIndex() to
GridView, ListView and PathView to fetch a visible delegate by index.

Change-Id: Id8475d06c1481036984fe5109bb52cf2729b1c21
Fixes: QTBUG-72961
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-01-17 14:53:31 +00:00
Mitch Curtis 78436d5231 tst_qquicklistview: use new QQuickTest::qWaitForItemPolished() function
This is a public function that encapsulates the behavior of the old
checks without requiring use of private API.

Change-Id: I5aed0140519ca21570f4917e950428e28fcfd726
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-10-31 08:54:10 +00:00
Friedemann Kleint 06f11da5e1 Tests: Remove QT_DISABLE_DEPRECATED_BEFORE=0 for simple cases.
Fix usage of API that is marked deprecated.

Change-Id: Ia887437f99b9ce207891ca19bc49294acb7d629d
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
2015-09-02 04:19:22 +00:00
Dan Vrátil 47ffb30a69 Fix QQmlDelegateModel getting out of sync
Fixes a regression introduced by a0aefe1, which caused that the
source data model and adaptorModel could sometimes get out of
sync.

Change-Id: Ia6b5fc380cc6cf6549ae857e6da54e088a5dadb5
Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
2014-07-30 13:17:35 +02:00
Shawn Rutledge 0a74379a57 OSX: fix QQuickListView test
outsideViewportChangeNotAffectingView was failing on OSX.
Make the window larger; flick a longer distance in the same time to
ensure that the flick takes the list to the end.

Task-number: QTBUG-37828
Task-number: QTBUG-27740
Change-Id: Iefa44942a8f8318861781db820e830b459114a83
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2014-04-07 15:50:23 +02:00
Albert Astals Cid 9bbb073592 Reset on model layout changed
Otherwise the next dataChanged from the model may not be received

Change-Id: I16b859d92fdb1823c4a56c297d4451abe438fbb1
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-10-21 09:09:15 +02:00
Simon Hausmann 891f702945 Fix compilation with built-in v4vm JS engine
Change-Id: Ieda9267e296acf6392a5461f4cfb9233a7a409a0
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-04-15 13:03:20 +02:00
Sergio Ahumada 3bb6811535 test: Mark `tst_qquicklistview', `tst_qquicktext', and `tst_qquicktextedit' as insignificant
Task-number: QTBUG-27740
Change-Id: I20b15ae35f736f1c43a85e9a37ec3fda19896b07
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
2012-10-29 12:15:52 +01:00
Thiago Macieira 8dabc28e4e Set the Qt API level to compatibility mode in all tests.
Qt 5.0 beta requires changing the default to the 5.0 API, disabling
the deprecated code. However, tests should test (and often do) the
compatibility API too, so turn it back on.

Task-number: QTBUG-25053
Change-Id: I6988c2360e9d88916311374a0c910bfc5b607439
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-08-01 23:33:39 +02:00
Andrew den Exter a8a44e0381 Fix crash in tst_qquicklistview.
Destroy the shared canvas before QGuiApplication is destroyed.

Task-number: QTBUG-26244
Change-Id: I9aa59bae5314f51c84a61821af2fb3c7a1c77941
Reviewed-by: Bea Lam <bea.lam@nokia.com>
2012-06-26 06:14:53 +02:00
Friedemann Kleint 201173242e Mark tst_qquicklistview insignificant for Mac.
Task-number: QTBUG-26244

Change-Id: I314fa5293ffaa72dafa843d1a950d0abed5a4516
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-06-20 17:21:08 +02:00
Kent Hansen eba101e497 tst_qquicklistview: further increase test timeout
This test has timed out on a recent test run, but appeared to be
making progress. Increase the timeout, and remove the
insignificant_test flag.

Change-Id: Ic3d5f0dbf43e5d0a284ae87c9fd21552b759cbad
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-06-13 00:09:19 +02:00
Kent Hansen e1cebcd3be Mark qquicklistview autotest as insignificant
Flaky on macx-clang developer-build OSX 10.7.

Change-Id: I4e8b7604dff9dd64efd6110e2cbde461d82b94d3
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
2012-06-12 12:05:54 +02:00
Rohan McGovern 3c7ac8bd3a Set explicit testcase.timeout for slow tests
We'd like to decrease the default timeout for tests in the Qt Project CI
so that we waste less time waiting for hanging tests.

Tests which genuinely take a long time to run, such as these, should
have their timeout explicitly set in their .pro file.

Change-Id: I24c91494a5cc30af1d8929c995886253ab34fe86
Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
2012-05-29 10:54:05 +02:00
Lars Knoll 16e29f30e3 Remove unneeded dependencies to QtWidgets and QtOpenGL
Change-Id: I43bb54524f5786a838073df8812107dda7b0d56e
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
2012-03-12 17:04:36 +01:00
Kurt Korbatits 72f4ccecf4 Changed quick tests to work from install directory
- Changed tests to use TESTDATA
- added check for cross_compile option to skip when sources not available

Change-Id: I1f382794ff982bbc07fc20438a4e4a8c8b8d565f
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-03-07 06:24:24 +01:00
Matthew Vogt b855240b78 Rename QDeclarative symbols to QQuick and QQml
Symbols beginning with QDeclarative are already exported
by the quick1 module.

Users can apply the bin/rename-qtdeclarative-symbols.sh
script to modify client code using the previous names of the
renamed symbols.

Task-number: QTBUG-23737
Change-Id: Ifaa482663767634931e8711a8e9bf6e404859e66
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-02-24 04:51:31 +01:00