aboutsummaryrefslogtreecommitdiffstats
path: root/tests/manual/tableview
Commit message (Collapse)AuthorAgeFilesLines
* CMake: Regenerate projects to use new qt_internal_ APIAlexandru Croitor2020-10-065-10/+10
| | | | | | | | Modify special case locations to use the new API as well. Task-number: QTBUG-86815 Change-Id: I3b964e3baf0cc7040830156dac30358ea1152801 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Remove use of deprecated High-DPI application attributesTor Arne Vestbø2020-09-025-5/+0
| | | | | Change-Id: Ibfb50fdcbb51ba93d6e5d11f9e8ce0e7b3bfde79 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Merge remote-tracking branch 'origin/dev' into wip/cmakeAlexandru Croitor2020-03-124-0/+90
|\ | | | | | | | | | | | | | | Conflicts: dependencies.yaml src/qml/qml/qqmlengine.cpp Change-Id: I6a73fd1064286f4a2232de85c2ce7f80452d4641
| * Add Image.sourceClipRect propertyShawn Rutledge2020-01-304-0/+90
| | | | | | | | | | | | | | | | | | | | | | | | Since we set sourceSize, we expect to use that coordinate system in sourceClipRect too. Therefore we use QImageReader::setScaledClipRect(), not setClipRect(). [ChangeLog][QtQuick][Image] Image now has a sourceClipRect property to render a clipped image from a region of the sourceSize. Change-Id: If08277df772c2ab1063dd88572e49de41b97bca4 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* | Merge remote-tracking branch 'origin/dev' into wip/cmakeLeander Beernaert2020-01-161-10/+4
|\| | | | | | | Change-Id: I0c5b939c70bdb91ccdf7068784308416dcaa5736
| * manual test, tableview: Ensure we modify the right modelRichard Moe Gustavsen2019-11-211-10/+4
| | | | | | | | | | | | | | | | | | | | An old, unused, model was just lying around in the code. And the buttons in the test was modifying it. But after introducing the syncView concept in 5.14, all the TableViews in the test got their own separate model. So fix up the test to work as it should with the new setup. Change-Id: Ic3e6e3013186ef1c2998566b84b3b94e809296e8 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Regenerate all projects with new CMake API versionAlexandru Croitor2019-11-155-10/+10
| | | | | | | | | | | | Change-Id: Ie0db35f674137c229eaf049616f38f8e818f7092 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Regenerate remaining tests to be in syncAlexandru Croitor2019-11-155-13/+33
| | | | | | | | | | | | Change-Id: I200c8f58ad13bc1bc78409a3ce49348584ba5b51 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Add QtDeclarative Test CoverageLeander Beernaert2019-08-147-0/+207
|/ | | | | | | | | | | | | | | | | | | | | | All tests compile and run on a developer build. These tests are failing: tst_qqmlsqldatabase Fails due to missing sql driver tst_qqmlsqldatabase Fails in wip/qt6 tst_ququicklayouts Fails in wip/qt6 tst_flickableinterop Fails in wip/qt6 tst_qquickpinchandler Fails in wip/qt6 tst_qquickflickable Fails in wip/qt6 tst_qquickgridview Fails in wip/qt6 tst_qquickimage Fails due to missing jpeg plugin tst_qquicklistview Fails in wip/qt6 tst_qquicktext Fails in wip/qt6 tst_qquickcanvasitem Fails in wip/qt6 tst_scenegraph Fails due to missing jpeg plugin tst_TestFiltering Fails in wip/qt6 Change-Id: I4b9d69c118e23c095cb72ad5a67653fc30943bb1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Manual test, TableView: improve test with syncView functionalityRichard Moe Gustavsen2019-05-232-26/+132
| | | | | | | | Add some more TableViews and buttons that can be used to test the new syncView functionality. Change-Id: I0ad649598ef2ff08487c9a0b450861c27535c62c Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* add "json" manual TableModel testMitch Curtis2019-04-294-0/+366
| | | | | | | This covers the use case of fetching and showing data from a web API. Change-Id: I9e9cd6a17f409383ba71bc32f0f9d63a45213784 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Add TableModelColumnMitch Curtis2019-04-082-51/+45
| | | | | | | | | | | | | | | | | | | | This allows us to support simple object rows by default, which we expect to be the most common use case for TableModel. Complex rows are supported, but with a limited subset of functionality. Things that could be improved: - Would be nice if we could get arbitrary/dynamic properties like ListModel has, without the complex code that comes with it. That way we could get rid of all of the role properties and users could have their own custom roles. The limitation of only having built-in roles becomes too restrictive very quickly. Change-Id: Icbdb6b39665851c55c69c0b79e0aa523c5d46dfe Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Fix calls to TableModel functions in manual testMitch Curtis2019-02-131-5/+5
| | | | | | | The functions were renamed. Change-Id: I0fc77bc537412d99f2605aac15ea999f5e92d114 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Rename tablemodel manual test to "form", move into tablemodel subdirMitch Curtis2019-02-135-10/+12
| | | | | | | | In preparation for adding more TableModel-related manual tests. We need these to ensure that we support different use cases. Change-Id: Ib771b513a3dd62a372335beb1e97a8c946708ec2 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Add TableModelMitch Curtis2019-02-084-0/+460
| | | | | | | | | | | | | | | | | | | | | This is a QML type that can be used as a model for the new TableView. The model data is set by assigning a JavaScript array to the rows property (or by calling appendRow()). After data has been assigned for the first time, the available columns and roles are fixed for the lifetime of the model, as opposed to ListModel where the dynamicRoles property could be used. This is done intentionally to simplify the code. The API is designed to be familiar to users of ListModel: - To add new rows, use appendRow() and insertRow(). - To modify existing rows, use setRow(), moveRow(), removeRow(), and clear(). [ChangeLog][Qt Labs QML Models] Added the TableModel QML type, a JavaScript-based model for the new TableView. Fixes: QTBUG-70334 Change-Id: I55387a08b122227c5624f78af3d450b7695d974a Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* StorageModel manual test: use DelegateChoices to show data graphicallyShawn Rutledge2019-01-153-32/+149
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This demonstrates that DelegateChooser and DelegateChoice are working with TableView. In this use case, DelegateChooser uses a role from the model to decide which delegate type to instantiate. So we need the model to provide a type role that it can switch on. Conveniently, by using the Q_ENUM registration of the Type enum, it automatically becomes possible to match against the stringified versions of those enum values in the DelegateChoice.roleValue property. To demonstrate a set of roles which would work for almost any kind of numeric data, we choose to have a Value role for the current value, corresponding to the width of the bar or the numerator of the ratio; and ValueMax for the maximum possible value, corresponding to the total width of the bar graph, or the denominator of the ratio. ValueDisplay and ValueMaxDisplay are roles which provide string-formatted versions of those for labeling purposes. Maybe in the future we could consider adding those (plus ValueMin and ValueMinDisplay) to the ItemDataRole enum; because almost any kind of data model could need to provide numeric data, but for some reason we have only made it easy to provide strings (DisplayRole) and booleans (CheckStateRole). Likewise some sort of type role could be standardized at the same time. Free / used space is graphically shown as a bar graph. QStorageInfo provides bytesFree() but not bytesUsed(), but it's more conventional to show a bar which grows wider as more space is used, so we reverse it visually by showing a red background with the bytesFree bar anchored to the right. Thus the width of the red part showing through is proportional to bytes used. The three flags isReady, isReadOnly and isValid are shown with simulated checkboxes. This manual test is now on its way to becoming an example of how to use row, column and role effectively together. It's not enough to say that TableView is only for spreadsheet-like views, displaying only text in each cell. To display more than text, we can do the same thing that we have done in the past with models designed for display with ListView: use the role, so that data(index, role) gets called multiple times for each cell, to get the values that each delegate type needs to use to render itself. Change-Id: I1060eacc2b7d25f420411828258e7d94ee0bdd0b Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Manual test, TableView, abstracttablemodel: add more logic to the testRichard Moe Gustavsen2018-09-274-18/+238
| | | | | | | Add buttons for adding and removing rows and columns Change-Id: I8d391db4f61ff4ec4273adc7134bd30ffc73fa3c Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickTableView: move TableView from Qt.labs to QtQuickRichard Moe Gustavsen2018-08-223-3/+0
| | | | | | | | | | | TableView is now ready for Qt-5.12. The only thing missing is documentation, which is currently being written, and on the way. So remove the temporary labs plugin that used to register TableView, and register it together with the other QtQuick items. Change-Id: I7f360eac3934d228904a4133363e336afe0c451a Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* test, abstractitemmodel: improve manual testRichard Moe Gustavsen2018-08-152-11/+54
| | | | | | | | Improve the test so that you can click on the cells to change their color. Change-Id: Ia74620894f2885242f587c4c863bcf3544b13488 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* StorageModel manual test: use enum class for Column enumShawn Rutledge2018-08-112-48/+48
| | | | | | | | We should set a good example by using enum classes more: internally, in examples, and in manual tests which might become examples eventually. Change-Id: Ife6f3b8eaf2f534d474c35e34370361d026f2c47 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QQuickTableView: remove cacheBuffer from the public APIRichard Moe Gustavsen2018-08-101-1/+0
| | | | | | | | | | | | | | | | | | As discussed during API review, remove cacheBuffer from the public API. The cache buffer was a feature inherited from ListView to avoid loading a lot of items (and affect performance) when the user started to flick. But now that TableView has support for reusing items, the point of the cache buffer is more or less gone. At least we choose to remove it from the public API until we have better understanding if this is really needed. Note that the cacheBuffer still plays a small role internally, so we don't remove it from the implementation. We want to preload an extra row and column for reuse at start-up, since you often cannot reuse the first row and column during the first flick (they will still be visible on the screen). Change-Id: Ie62835a04ac29a84c9a76151b73fe2f75d9ae844 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickTableView: remove TableView.cellWidth/HeightRichard Moe Gustavsen2018-07-183-6/+6
| | | | | | | | | | | | | The attached properties TableView.cellWidth/Height were added for corner cases where you couldn't set/override implicit size for a delegate item. But now that we have added rowHeightProvider and columnWidthProvider (and we know that we're going to offer a broader API to set row/column size from a HeaderView), you have a way out for those cases as well. So lets remove the attached properties until we know for sure if they will be needed. Change-Id: I7d20fb02c36aebd3f24964630ccb68d4c813e93e Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* TableView: remove row and column from attached objectRichard Moe Gustavsen2018-07-102-3/+3
| | | | | | | | | | | | | | | | | | | TableView.row and TableView.column is no different from the row and column properties that are injected into the context from the model classes. So just remove them to not bloat the API. This attached properties where added at an early stage where we thought that it should be possible to set a different row and column count on the view than compared to the model (to e.g to "fake" a table layout when just assigning an integer as a model). Also, we consider supporting right-to-left etc, where we might end up with cells that have a different row/column in the view compared to where the cell is in the model. If we decide to do this later (not for the first release), we can consider adding the attached properties back again at that point. Change-Id: I588a45913b968db789978339bc9a63cd2ccfad49 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* TableView: switch to use TableView.cellWidth/cellHeightRichard Moe Gustavsen2018-05-283-6/+6
| | | | | | | | | | | | | | This is logically more correct since TableView will override width / height anyway to make the delegates fit into the table if they are not as wide/tall as the widest column/row. And it gets even more problematic when we recycle delegates, since in that case we need to keep the original width binding of the delegate to calulate the size of new columns. And this all fits better by using attached properties instead. Change-Id: Ia5f2acd2bfc45f3fb160c3782191ad8da9f780e6 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Tests: add new manual tests for TableViewRichard Moe Gustavsen2018-04-1212-0/+814
This patch will add three new manual tests for testing TableView. The first uses a standard ListModel; the second uses a custom QAbstractTableModel. The third is a port of the storageview example in widgets. Change-Id: Ic8ac1aaf9951d0e2982f512b570caa059a212a17 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>