| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This brings it in line with the existing convention in this and other
modules, where virtual handlers are named "nounChange"; e.g.
itemChange. Signals are named "nounChanged".
This also allows adding a geometryChanged signal, which would enable
users to listen to one signal for all changes to x/y/width/height.
[ChangeLog][QQuickItem] Renamed geometryChanged to geometryChange
in order to follow existing naming conventions and have consistency
with existing API, such as itemChange.
Task-number: QTBUG-82994
Change-Id: I0547358c796a0047982ccfbf2c38bab952e7a634
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This API can be used to query and iterate the currently loaded
rows and columns inside the view.
[ChangeLog][QtQuick][TableView] Added the properties leftColumn,
rightColumn, topRow, and bottomRow, which can be used to query
which part of the model is currently visible inside the view.
Change-Id: I06f99cc1e8da1004dc8614977f149192e1880ba4
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
|
|
|
| |
[ChangeLog][QtQuick][TableView] cellAtPos(x, y) has been added to
query which cell is under the given position.
Change-Id: I69523868158b589ea3bb9facba815000d2a058d7
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a function to the API to let the application get
the item loaded for a specific cell.
[ChangeLog][TableView] A function 'itemAtCell()' has now
been added to let the application get the delegate
item loaded for a specific cell.
Change-Id: Ie84ef44ea2a0a901487812c4d611b98d4c86ee22
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add functions to let the application scroll the table to a
specific row or column using a specific mode. This API
partially mirrors the API found in ListView.
[ChangeLog][QtQuick][TableView] positionViewAtCell(), positionViewAtRow(), and
positionViewAtColumn() have been added to enable the application to position
the contents to show a specific cell.
Fixes: QTBUG-83215
Change-Id: I321588041977f9ded40f84fc0499ea1c5f6ac801
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
| |
Change-Id: Id72fbe10c16de61bd847773d0055d83cfe03f63c
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
virtual
For usage in HeaderView, moving getters/setters/sych-ers in private implementation
virtual, keep public APIs clean and also make private implementations overridable.
Change-Id: I4ad04665b7268354a49dc9711944ee0c6fd2738f
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
|
|\
| |
| |
| | |
Change-Id: Ib381f350ada365747ce20b989bfdc368d75f2219
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
mostly add const &, a few std::move and in particular case, remove const
so the std::move being done over the variable actually has effect
Change-Id: Id611cd31bc012f219d7a17d4626b1c2a5fbddd66
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Using this technique we can automatically register all necessary
revisions and minor versions of a type, using the metaobject system.
This greatly reduces the potential for mistakes and resulting
incompatibilities between versions of imports.
We assume that for each type we need to register all revisions of its
super types and its attached type, and that the revisions match. That
is, if you import version X of type A, you will also get version X of
its attached type and of any super types. As we previously didn't take
these dependencies into account when manually registering the types, a
number of extra revisions are now registered for some types.
Potentially, we can now generate the qmltypes files at compile time,
using moc.
Change-Id: I7abb8a5c39f5e63ad1a0cb41a783f2c91909491b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We set the size of the content view to be the size of the complete
table. The problem is that the exact size will always be just
a prediction, since we would otherwise need to iterate over all rows
and column up front, to be able calculate the exact size.
This is not acceptable when using non-trival table models.
A side effect of this, is that is will be possible to flick the
viewport further out than the actual end of the table, if the
content view turns out to be larger than the table itself. From
before we used to just move the whole table back into the viewport
when that happened, which could be seen as a sudden jump of the
table to a new position.
This change will improve this logic so that we can avoid most
visual jumps. Instead of moving the table around, QQuickFlickable
supports moving the origin instead. So when we see that the
table is not in sync with the content view, we simple move the
origin to the edge of the table. The effect is that any flicking
or ongoing momentum animation in QQuickFlickable will continue as
if nothing happened. This is also the same logic used by QQuickListView.
Change-Id: I6060b7e84b9489c8fa569e6ff41b958e3871f8e7
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This property can be set to point to another TableView.
If set, this TableView will be synchronized to the
other table with respect to flicking, column width, row
heights, spacing, etc. This logic is needed as a foundation
for the upcoming HeaderView.
Upcoming patches will implement this logic (together with
autotests) gradually.
Change-Id: Ic7dea8e1d1aa46bbb3ea6e795953a65c96c25cc6
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|\
| |
| |
| | |
Change-Id: I69c3e6610ff590d9c18f386fc17ed2e429b58d26
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The auto test didn't catch this, since there we use the
setter functions directly from c++, instead of accessing
the properties.
Change-Id: I2101e4cfab11d1c0e037f6ca134b6804d328e162
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Make destructors explicitly override and virtual.
Make QQuickTableView's setModel/model virtual, so that can be
overridden for derived classes.
Change-Id: Ieabc9add74a4725653a84b39f7e4c00c18a89f1d
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
|
|/
|
|
|
|
|
| |
add constructor QQuickTableView::QQuickTableView(QQuickTableViewPrivate &dd, QQuickItem *parent)
Change-Id: I60de6d907d3c28d5857e81c0f362a093e683046c
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
componentComplete() is called on us after all static values
have been assigned, but before bindings to any ancestors
have been evaluated. Especially this means that if our size
is bound to the parents size, it will not be ready at that point.
Since we cannot build the table without knowing our own size, we
waited for the updatePolish() call before we started to build
the table.
The problem with that strategy, is that any asynchronous loaders that
TableView might be inside would already be finished by the time
we received the updatePolish() call. The result would be that we
ended up loading all the delegate items synchronously instead of
asynchronously. (As soon as a loader has finished loading the initial
item, async loading will no longer be used).
This patch will therefore add a componentFinalized function that gets
called after all bindings have been evaluated, but before the loader
has finished. When receiving this call, we load the delegate items (and
build the table).
A nice side effect is that the table will also be ready
by the time Component.onCompeted is emitted to the QML
app. This means that e.g contentWidth/Height has valid values.
Change-Id: Ief92d2fecfaea54f6191da116ed4ba79cc673b01
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Doing (silly) things in the delegate, like:
Component.onCompleted: TableView.view.delegate = null
will lead to a crash. The same if you change the model.
The reason is that you end up changing the model
while e.g a row is half-way loaded. Information needed for
building the row, like model size, will then be invalid.
To protect against this, we insert a "sync" phase to the
code that takes any such changes into effect at a time
when we know it's safe to do so.
Change-Id: I85a992dfc0e04ec6635b10c9768a8ddc140e09da
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Overriding contentWidth/Height was done to be able to force build the
table early if the app needed to know the size of the table already at
Component.onCompleted (to e.g center the viewport on the center of
the table). But now that we have a forceLayout() function, it's better
to require that that function should be called before querying
contentWidth/Height at this stage.
By not building the table on the fly, we allow the application to
bind expressions directly to contentWidth/Height, without being concerned
about potential binding loops that can occur as a result of us
rebuilding the whole table behind his back. The benefit of this overshadows
the need to call forceLayout() explicit for some corner cases.
Note that we still redefine the contentWidth/Height properties in TableView
so that we can catch if the application sets an explicit contentWidth/Height
(which is tested by checkExplicitContentWidthAndHeight()).
Change-Id: Ic4499b3939af1cb3a543e4c006023d0d6f12fd3b
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Flickable has a margins API with the exact same naming as
the margins API in TableView. This means that overriding those
properties in TableView was an oversight, and a mistake.
This patch will therefore remove the margins API from
TableView. However, since the API already exists is in
Flickable, the resulting API remains unchanged. But it
will ease the TableView implementation a bit, since we
can then remove code that takes margins into account (since
Flickable does this automatically for us).
The only real difference that will take effect from this
change, is that any overlay or underlay items inside the
flickable will need to have negative coordinates if you
want to position them on top of the margins (e.g to create
a header on top of the table).
Change-Id: I43af66e49f5ddff90739a1c789aacb77ed18b4ce
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
ListView calls the same attached property for 'view'. So
do the same for TableView.
Change-Id: I99034869813750e2fab56fe6ffcc4b4a6a4d9c52
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This function needs to be called from the application whenever it
needs to change column widths (or row heights) for the currently
visible columns.
Changing column widths is done by changing what values the
columnWidthProvider returns. But TableView doesn't know that the
assigned function has new values to return for the current columns.
Calling 'forceLayout()' will inform about this, and trigger
a re-layout.
Change-Id: I3cf15bbfb522baf93c7e01a34841e54455a098b9
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: J-P Nurmi <jpnurmi@gmail.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
TableView uses contentWidth/height to report the size of the table
(this will e.g make scrollbars written for Flickable work out of the
box). This value is continuously calculated, and will change/improve
as more columns are loaded into view. At the same time, we want to
open up for the possibility that the application can set the content
width explicitly, in case it knows what the exact width should be from
the start. We therefore override the contentWidth/height properties from
QQuickFlickable, to be able to implement this combined behavior. This
also lets us lazy build the table if the application needs to know the
content size early on. The latter will also fix problems related to
querying the content size from Component.onCompleted.
Change-Id: Ife7ef551dc46cf15d6940e3c6dff78545a3e4330
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch will make use of the recent changes in QQmlTableInstanceModel
to support reusing delegate items.
The API in TableView to enable this will mainly be a new property
"reuseItems". This property is true by default. By setting it to
false, reusing items will never happen.
When an item is reused, the signal "TableView.reused" is
emitted after the fact, in case the delegate item needs to
execute some extra code during the process. Likewise, a signal
"TableView.pooled" is emitted when the item is pooled.
From an implementation point of view, TableView only need to
do two things to enable reusing of items. First, whenever it releases
items, it provides a second argument to release(), informing
QQmlTableInstanceModel if the item can be reused. Second, it
needs to call drainReusePool() at appropriate times to ensure
that no item will be kept alive in the pool for too long.
Change-Id: I830e2eace776302ac58946733566208aa8954159
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
Task-number: QTBUG-51710
Change-Id: I8827a9c80bfa1ed3b9116c7625b74e3c5b12bfce
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|