diff options
author | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2018-09-14 10:03:27 +0200 |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2018-09-17 07:51:20 +0000 |
commit | f4e96bf319b14bc64d9c92551303991b4f303846 (patch) | |
tree | 8c893a6a22b97519ded0d62d1ab64cdc1d572bf6 /src/plugins | |
parent | 1dac47c1418b44cf4a56b42bfca2b277795fd213 (diff) |
QQuickTableView: build the table when the component is finalized
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>
Diffstat (limited to 'src/plugins')
0 files changed, 0 insertions, 0 deletions