| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The current solution of storing column widths as the user flicks around
turns out to not scale so well for huge data models. We basically don't
want to take on the responsibility of storing column widths and row
heights for e.g 100 000 rows/columns. Instead, we now choose to ask the
application for the sizes, whenever we need them. This way, the application
developer can optimize how to store/calculate/determine/persist row and
column sizes locally.
To implement this functionality, we add two new properties:
rowHeightProvider and columnWidthProvider. They both accept a javascript
function that takes one argument (row or column), and returns the
corresponing row height or column width.
If no function is assigned to the properties, TableView will calculate
the row height / column width based on the currently visible items, as
before.
Change-Id: I6e5552599f63c896531cf3963e8745658ba4d45a
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
|
|
| |
Signals like rowsInserted() were already accounted for in
QQuickTableViewPrivate::connectToModel(), but modelReset() was not.
Change-Id: I6b8248d745d507d4ea846e9bee717182915792b3
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Swap out QQmlDelegateModel in favor of the new QQmlTableInstanceModel.
QQmlTableInstanceModel skips using QQmlChangeSets all together, and lets
us subscribe to model changes directly from the underlying QAIM instead.
This will make it much easier to handle model changes more
gracefully later.
Change-Id: I0315e91f39671744fb48d1869e4b73b1becbb929
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
Using a QList to store all loaded delegate items was a legacy solution
inherited from QQuickItemView. But we look-up items in the list based
on index all the time, so switching to use QHash instead should be more
optimal.
Change-Id: I1aa8d23b3ac208a9424982491faaa5dd42775280
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Change 8c33c70 injected row and column (alongside index) into
the QML context of a delegate when the view had a
QAbstractItemModel as model.
Rather than only inject those properties when using QAIM, this patch
will move the code to the base class. This way, if a view uses e.g
a javascript list as model, row and column is still be available. This
is useful, since then the delegate can bind to both row and column
regardless of what kind of model the view uses. In the case of a
list model, the column property will always be 0.
Change-Id: I1d9f11c0b7d7a5beb83198184ba12cc1e48cd100
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
|
|
|
| |
This patch fixes a small typo originated from an earlier
copy/paste. QQuickTableViewPrivate::rowHeight() should use
cellHeight, not cellWidth.
Change-Id: I85cb3730dfd0daf0a9bb16dbb0771c31a453fa13
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Rather than forcing users to set TableView.cellWidth/cellHeight (and
therefore also force them to create an attached object for every
cell), we now also accept setting implict size as a fall back.
Change-Id: I4c4c4d23fe7fc193581728d3878cf2c7e40c0745
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
If you assign a non-empty model, the model can still return a count
of zero if something else is amiss, like the delegate being null.
So we need to do en extra check for this before we load the first
top-left item, otherwise we'll hit an assert later in the loading process.
Change-Id: I747868faf7955b8784b2957505ae03e5b1aa0b45
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Normally when you flick the table around, a column (row) will
be flicked out of view on one side, while another column
will be flicked in and loaded on the opposite side. But if you
flick really fast, you sometimes manage to flick in and out
several columns in one go before tableview gets an updatePolish
call to catch up. In the latter case, we would then first unload
all flicked-out columns, and then afterwards continue loading all
flicked-in columns.
This approach is currently not a big problem, but it will be once
we start recycling delegate items. Because then we should take
care to not overflow the pool with unloaded column items, since
the pool will most likely have a maximum size. So we therefore change
the algorithm a bit so that we always alternate between unloading
and loading one column at a time, rather than unload several columns
in one go before we start loading new ones.
Change-Id: Ia0f1968a4b3579e4445e1f7b6e68a28a1d2b360b
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
If we cannot determine the size of a row or column, we need
to fall back to some size other than 0 while layouting. The
reason for this is that we fill up with as many rows and
columns that fits inside the viewport. But if e.g the width
of column is zero, we will never make any progress, and
therefore just keep loading and loading columns.
Change-Id: I96ea410dc5a75831e44c2924172254634598b680
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
Flickable will change the viewport recursively while we're
loading/unloading rows/columns. This will confuse TableView
and might cause it to freeze. The correct time to update
the internal viewport rect is from inside updatePolish(), where
we have better control over the current state.
Change-Id: I94f964b8b0f6920ffe31cedd7a461f3853998be3
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The floatingPointMargin was added at an early stage to avoid
that we ended up in a locked situation where we loaded
and unloaded the same edge continuously without being able to
exit the loading loop. This was done wrongly because we didn't
take spacing into account in QQuickTableViewPrivate::canLoadTableEdge
(spacing was usually one pixel, coincidentally the same as the
floatingPointMargin). This has now been fixed in a previous patch, so
we can remove the faulty floatingPointMargin as well.
Change-Id: I3caa7808298a1954a3c02f609bad98c3c2c2426a
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
|
|
|
| |
As it stood, we forgot to take spacing into account when determining
if an edge should be loaded. This meant that we sometimes would
load more edges than necessary when spacing was set to a large value.
Change-Id: I9a2ab96a838d00116aa282b6a40d58a19849936f
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Instead of always drawing the table at 0,0 in the content
view of the flickable, add support for setting margins.
The margins will let the developer add some extra space
around the table to e.g make space for custom headers etc.
Change-Id: I4a69b2cf3594bd72255d21372b5bf0d3220676dc
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
|
|
|
| |
The current implementation would sometimes just crash because we
didn't check if the returned iterators were pointing to something
valid. This patch will fix this.
Change-Id: Ia45a8e3b701fb9067bf9116f39d7753b88f4f734
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
|
| |
created
Change-Id: I96bc282a6678954d73cf5a15241ac30f43964dcb
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
|
|
|
| |
This reverts commit 1cfd61f63609c4930db6130d2f63f678c420762d.
The commit came in during a time where tests aren't run, and fails
at least on some of our linux platforms.
Change-Id: Idd5c68b0fdec06ca93a9bab9604ad64974ee00e3
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
| |
Change-Id: I1794a46b697467af152a6346fa7d7b5d0ce31807
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
Change-Id: I4d68e033074442c402df11f779b6875e80ec6412
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|