Commit Graph

15 Commits

Author SHA1 Message Date
hjk
31fecb0820 TreeModel: Add more item functions
canFetchMore/fetchMore, and insertChild (at given position). Make
prepend/appendChild use the latter.

Change-Id: I4162fe6e64f37d26de209aa81894c9730957694b
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-01-26 22:09:11 +01:00
hjk
ec187241e5 TreeModel: (Partially) separate header data from root item
Full separation does not seem possible as QTreeView assumes
all items to have equal column count.

Change-Id: Ia260924fe13ea62789923af8484f9838295355b6
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-01-21 08:42:52 +01:00
hjk
7e522c8a37 TreeModel: Add model pointer to TreeItem
... and use the items themselves as main entry point for
item related operations.

With non-uniform tree items it's easier to have item specific
functionality directly in the item implementation instead of
the model.

Change-Id: I4e9b7db98d16b91ddef81917417691129bb83621
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-01-15 16:06:38 +01:00
hjk
036f4f00eb TreeModel: Add a TreeItem::setData function
Change-Id: Id59c35068cd5a2ba22ccfddd45a0826dd68e9905
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-01-13 16:14:07 +01:00
hjk
2f17b74753 Debugger: Take advantage of new tree iterator in option page
Change-Id: I1a8e065cfaa57b49c852a3a1d67149447d4d87b2
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-01-12 13:18:24 +01:00
hjk
6ebdc18f98 TreeModel: Simplify indexFromItem()
Change-Id: Ief7f120ef27eb43746826da7c771b5f9a3f7ce8f
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-01-12 10:29:42 +01:00
hjk
39c7472862 TreeModel: Add good old ModelTest's code
Currently #if'd out, but takes only a one line change to enable
quick testing. Tests pass with the included change to flags().

Change-Id: I6dca376f162ad26e8ce6de65241e56497ff7267e
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-01-12 08:49:05 +01:00
hjk
3d0537fa8a TreeModel: Add function to remove all children of an item
Just convenience.

Change-Id: Ieff2291ca63584cfa113a24cc2930adc3e764d08
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-01-09 16:52:24 +01:00
hjk
82c2f51a29 TreeModel: Make debug help code less intrusive
Has not been needed for a while.

Change-Id: I141725d77343c4afa9907fde6af8e283f2744c88
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-01-09 13:49:00 +01:00
hjk
94b8a21fbf Utils: Add TreeModel iteration facility
Change-Id: Iaf115377de0e5fc0b004d5ea8ddc5c6eb31b5b6f
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-01-09 13:48:03 +01:00
hjk
115acfe127 TreeModel: Add some convenience functions
Add functions to remove a single item, to access the last child
of an item and a simple way to construct items that only display
static data.

Change-Id: I89347fbb6bbbac6b77fcfb23fa0b780a13643d6f
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-01-05 08:57:38 +01:00
hjk
a8ece5e9b0 TreeModel: Make root item configurable
This is mainly used to communicate the number of columns and
header contents.

Change-Id: Ic3163265338d71f1fa8250e4765bb764e5784197
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2014-12-17 14:18:01 +01:00
hjk
e30e34f464 TreeModel: Rows are not columns.
Change-Id: I33a6d017f14ee9703b374f645c279cc26e3cb3e5
Reviewed-by: hjk <hjk121@nokiamail.com>
2014-10-17 16:45:21 +02:00
Eike Ziller
9c7019f0b2 License update.
Change-Id: I0acde2c3b995693de682679471f03af85bdd0a61
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2014-10-15 15:19:55 +02:00
hjk
88e4daa82b Utils: Add a base for tree like models
That kind of boiler plate comes up often enough to justify a wrapper.

Change-Id: I94aa5b1ccbe5a98f091a47087654e59e9e122c1d
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2014-10-14 18:24:08 +02:00