<feed xmlns='http://www.w3.org/2005/Atom'>
<title>qt/qtdeclarative.git/src/qmlmodels/qqmltableinstancemodel.cpp, branch wip/nativemenus</title>
<subtitle>Qt Declarative (Quick 2)
</subtitle>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/'/>
<entry>
<title>TableInstanceModel: handle roleName invalidation</title>
<updated>2023-04-18T16:50:02+00:00</updated>
<author>
<name>Richard Moe Gustavsen</name>
<email>richard.gustavsen@qt.io</email>
</author>
<published>2023-04-17T08:21:25+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=fd489252a7c904c70afa299528b164d17e628dd8'/>
<id>fd489252a7c904c70afa299528b164d17e628dd8</id>
<content type='text'>
roleNames are generally guaranteed to be stable (given that QAIM has no
change signal for them), except that resetting the model is allowed to
invalidate them. TableInstanceModel did so far not take this into account.

Handle this case correctly by snapshotting the current roleNames before
the model is reset. Afterwards, if we detect that roleNames has changed,
we throw the current model set up away and rebuild everything from
scratch – it is unlikely that a more efficient implementation would be
worth it.

Fixes: QTBUG-111987
Pick-to: 6.5 6.2
Change-Id: Id1e3b8e4f983c0f00fc7b30bd4897f1f7fcc3792
Reviewed-by: Fabian Kosmale &lt;fabian.kosmale@qt.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
roleNames are generally guaranteed to be stable (given that QAIM has no
change signal for them), except that resetting the model is allowed to
invalidate them. TableInstanceModel did so far not take this into account.

Handle this case correctly by snapshotting the current roleNames before
the model is reset. Afterwards, if we detect that roleNames has changed,
we throw the current model set up away and rebuild everything from
scratch – it is unlikely that a more efficient implementation would be
worth it.

Fixes: QTBUG-111987
Pick-to: 6.5 6.2
Change-Id: Id1e3b8e4f983c0f00fc7b30bd4897f1f7fcc3792
Reviewed-by: Fabian Kosmale &lt;fabian.kosmale@qt.io&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Required properties: Use pointers instead of references</title>
<updated>2022-11-10T14:00:11+00:00</updated>
<author>
<name>Fabian Kosmale</name>
<email>fabian.kosmale@qt.io</email>
</author>
<published>2022-10-31T13:51:13+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=7b67d4061974de01eb5387199fe18e67a400545f'/>
<id>7b67d4061974de01eb5387199fe18e67a400545f</id>
<content type='text'>
This allows for a more natural handling of the case where there are no
required properties, and will enable further refactoring of
ConstructionState.
Unfortunately, we lack a way to mark pointers as always non-null in Qt,
else we could mark all required property pointers originating from
QQmlObjectCreatorSharedState as such.

Change-Id: Icaccb27654130fb57daf924bb44a70a5cf114fed
Reviewed-by: Ulf Hermann &lt;ulf.hermann@qt.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This allows for a more natural handling of the case where there are no
required properties, and will enable further refactoring of
ConstructionState.
Unfortunately, we lack a way to mark pointers as always non-null in Qt,
else we could mark all required property pointers originating from
QQmlObjectCreatorSharedState as such.

Change-Id: Icaccb27654130fb57daf924bb44a70a5cf114fed
Reviewed-by: Ulf Hermann &lt;ulf.hermann@qt.io&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>QQmlTableInstanceModel: add some extra asserts</title>
<updated>2022-11-03T00:35:10+00:00</updated>
<author>
<name>Richard Moe Gustavsen</name>
<email>richard.gustavsen@qt.io</email>
</author>
<published>2022-11-02T13:07:28+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=a92920b97a8c9e1ca816a6b9167e4c41c2e0b603'/>
<id>a92920b97a8c9e1ca816a6b9167e4c41c2e0b603</id>
<content type='text'>
Now that QQuickTableView will start to use more than one
QQmlTableInstanceModel (to implement editDelegate), add
some extra asserts to ensure that we don't mix up which
delegate items were created from which instance model.

Change-Id: I0d556542ca5409a963ea05c63b3e33b643192bbd
Reviewed-by: Doris Verria &lt;doris.verria@qt.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now that QQuickTableView will start to use more than one
QQmlTableInstanceModel (to implement editDelegate), add
some extra asserts to ensure that we don't mix up which
delegate items were created from which instance model.

Change-Id: I0d556542ca5409a963ea05c63b3e33b643192bbd
Reviewed-by: Doris Verria &lt;doris.verria@qt.io&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Port from container::count() and length() to size()</title>
<updated>2022-10-07T21:38:48+00:00</updated>
<author>
<name>Marc Mutz</name>
<email>marc.mutz@qt.io</email>
</author>
<published>2022-10-05T05:29:16+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=958cd3ee1094a068b6d0ff27c73a4b3caff088ad'/>
<id>958cd3ee1094a068b6d0ff27c73a4b3caff088ad</id>
<content type='text'>
This is a semantic patch using ClangTidyTransformator as in
qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8:

  auto QtContainerClass = anyOf(
      expr(hasType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes))))).bind(o),
      expr(hasType(namedDecl(hasAnyName(&lt;classes&gt;)))).bind(o));
  makeRule(cxxMemberCallExpr(on(QtContainerClass),
                             callee(cxxMethodDecl(hasAnyName({"count", "length"),
                                                  parameterCountIs(0))))),
           changeTo(cat(access(o, cat("size"), "()"))),
           cat("use 'size()' instead of 'count()/length()'"))

a.k.a qt-port-to-std-compatible-api with config Scope: 'Container',
with the extended set of container classes recognized.

Change-Id: Idb1f75dfe2323bd1d9e8b4d58d54f1b4b80c7ed7
Reviewed-by: Fabian Kosmale &lt;fabian.kosmale@qt.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a semantic patch using ClangTidyTransformator as in
qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8:

  auto QtContainerClass = anyOf(
      expr(hasType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes))))).bind(o),
      expr(hasType(namedDecl(hasAnyName(&lt;classes&gt;)))).bind(o));
  makeRule(cxxMemberCallExpr(on(QtContainerClass),
                             callee(cxxMethodDecl(hasAnyName({"count", "length"),
                                                  parameterCountIs(0))))),
           changeTo(cat(access(o, cat("size"), "()"))),
           cat("use 'size()' instead of 'count()/length()'"))

a.k.a qt-port-to-std-compatible-api with config Scope: 'Container',
with the extended set of container classes recognized.

Change-Id: Idb1f75dfe2323bd1d9e8b4d58d54f1b4b80c7ed7
Reviewed-by: Fabian Kosmale &lt;fabian.kosmale@qt.io&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>QmlModels: Fix context and extra object handling</title>
<updated>2022-07-21T11:19:04+00:00</updated>
<author>
<name>Ulf Hermann</name>
<email>ulf.hermann@qt.io</email>
</author>
<published>2022-07-12T06:47:11+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=e4f4e7341f5fbfbb246c7fc4ee99fed5cce42fca'/>
<id>e4f4e7341f5fbfbb246c7fc4ee99fed5cce42fca</id>
<content type='text'>
If we have a bound context, we still need to record the information that
the object's context belongs to a delegate. For this purpose we have
the extra object. Even when we create the object in the component's
creation context, the object creator still produces a private internal
context for each object. We unconditionally attach the extra object to
that one, and check the whole context hierarchy for extra objects.

As we now record the creation context for model items incubated from
bound components, we need to make sure not to (re)set its context object
and not to forcibly invalidate it. We have QQmlRefPointer::reset() for
that anyway.

As a drive-by we also assert that the object ref count doesn't overflow,
as that has happened during testing.

Pick-to: 6.4
Fixes: QTBUG-104884
Change-Id: I836916c63656124a0f9d7b04902debba59b9f3a3
Reviewed-by: Fabian Kosmale &lt;fabian.kosmale@qt.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If we have a bound context, we still need to record the information that
the object's context belongs to a delegate. For this purpose we have
the extra object. Even when we create the object in the component's
creation context, the object creator still produces a private internal
context for each object. We unconditionally attach the extra object to
that one, and check the whole context hierarchy for extra objects.

As we now record the creation context for model items incubated from
bound components, we need to make sure not to (re)set its context object
and not to forcibly invalidate it. We have QQmlRefPointer::reset() for
that anyway.

As a drive-by we also assert that the object ref count doesn't overflow,
as that has happened during testing.

Pick-to: 6.4
Fixes: QTBUG-104884
Change-Id: I836916c63656124a0f9d7b04902debba59b9f3a3
Reviewed-by: Fabian Kosmale &lt;fabian.kosmale@qt.io&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Use SPDX license identifiers</title>
<updated>2022-06-11T06:05:15+00:00</updated>
<author>
<name>Lucie Gérard</name>
<email>lucie.gerard@qt.io</email>
</author>
<published>2022-05-13T13:12:05+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=0dc4fd240a2897c5c443a0ef6d84c416843e4938'/>
<id>0dc4fd240a2897c5c443a0ef6d84c416843e4938</id>
<content type='text'>
Replace the current license disclaimer in files by
a SPDX-License-Identifier.
Files that have to be modified by hand are modified.
License files are organized under LICENSES directory.

Pick-to: 6.4
Task-number: QTBUG-67283
Change-Id: I63563bbeb6f60f89d2c99660400dca7fab78a294
Reviewed-by: Shawn Rutledge &lt;shawn.rutledge@qt.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Replace the current license disclaimer in files by
a SPDX-License-Identifier.
Files that have to be modified by hand are modified.
License files are organized under LICENSES directory.

Pick-to: 6.4
Task-number: QTBUG-67283
Change-Id: I63563bbeb6f60f89d2c99660400dca7fab78a294
Reviewed-by: Shawn Rutledge &lt;shawn.rutledge@qt.io&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>QQmlAdaptorModel::setModel: clean up signature</title>
<updated>2022-02-02T23:52:49+00:00</updated>
<author>
<name>Fabian Kosmale</name>
<email>fabian.kosmale@qt.io</email>
</author>
<published>2022-02-01T15:17:37+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=1edfdbe00f9a2178b874fa558e3a653350a6c82f'/>
<id>1edfdbe00f9a2178b874fa558e3a653350a6c82f</id>
<content type='text'>
We no longer need the parent parameter.

Change-Id: I2687f051d51269abc0a74c4aafe77230ae9223c1
Reviewed-by: Ulf Hermann &lt;ulf.hermann@qt.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We no longer need the parent parameter.

Change-Id: I2687f051d51269abc0a74c4aafe77230ae9223c1
Reviewed-by: Ulf Hermann &lt;ulf.hermann@qt.io&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Improve type conversions from/to QJSValue</title>
<updated>2021-10-20T13:51:23+00:00</updated>
<author>
<name>Ulf Hermann</name>
<email>ulf.hermann@qt.io</email>
</author>
<published>2021-10-19T13:22:25+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=bf115a446c1a633a11577306eff8a78028a7f5b5'/>
<id>bf115a446c1a633a11577306eff8a78028a7f5b5</id>
<content type='text'>
We can convert everything into a QJSValue if we have an engine and we
can save a binding function in a QVariant by wrapping it into QJSValue.

Change-Id: I48e7c13f3f744f1c50bf673b427fe9331250f313
Reviewed-by: Andrei Golubev &lt;andrei.golubev@qt.io&gt;
Reviewed-by: Fabian Kosmale &lt;fabian.kosmale@qt.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We can convert everything into a QJSValue if we have an engine and we
can save a binding function in a QVariant by wrapping it into QJSValue.

Change-Id: I48e7c13f3f744f1c50bf673b427fe9331250f313
Reviewed-by: Andrei Golubev &lt;andrei.golubev@qt.io&gt;
Reviewed-by: Fabian Kosmale &lt;fabian.kosmale@qt.io&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>qqmltableinstancemodel: add setRequiredProperty()</title>
<updated>2021-04-30T13:20:48+00:00</updated>
<author>
<name>Richard Moe Gustavsen</name>
<email>richard.gustavsen@qt.io</email>
</author>
<published>2021-04-30T10:16:38+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=499fcb5d399321c3d887ead8f5a5b8696841a7f9'/>
<id>499fcb5d399321c3d887ead8f5a5b8696841a7f9</id>
<content type='text'>
Add a virtual function setRequiredProperty() to
QQmlInstanceModel that we override in
QQmlTableInstanceModel. This function can be called
from QQuickTableView, upon getting the initItem signal,
to assign initial values to any required properties
that the view makes use of.

This patch is added as a preparation for adding selection
support to QQuickTableView (which will make use of
"required property isSelected" on the delegate)

Change-Id: I55885bafa14da1d432c120bef807e73165f1466c
Reviewed-by: Fabian Kosmale &lt;fabian.kosmale@qt.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a virtual function setRequiredProperty() to
QQmlInstanceModel that we override in
QQmlTableInstanceModel. This function can be called
from QQuickTableView, upon getting the initItem signal,
to assign initial values to any required properties
that the view makes use of.

This patch is added as a preparation for adding selection
support to QQuickTableView (which will make use of
"required property isSelected" on the delegate)

Change-Id: I55885bafa14da1d432c120bef807e73165f1466c
Reviewed-by: Fabian Kosmale &lt;fabian.kosmale@qt.io&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove QQmlEnginePrivate::isQObject</title>
<updated>2021-03-05T14:54:53+00:00</updated>
<author>
<name>Fabian Kosmale</name>
<email>fabian.kosmale@qt.io</email>
</author>
<published>2021-03-05T10:30:18+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=483d09779c2719415c5ac421074a1af3bd66ca29'/>
<id>483d09779c2719415c5ac421074a1af3bd66ca29</id>
<content type='text'>
The only caller has a QMetaType available and can query that one. This
leads to subsequent cleanups in QQmlListAccessor::setList and
QQmlAdaptorModel::setModel which now no longer have a need to pass the
QQmlEngine along.

Task-number: QTBUG-82931
Change-Id: I6f38892a3a5098f07bc21f4eebcca82cf52a6838
Reviewed-by: Ulf Hermann &lt;ulf.hermann@qt.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The only caller has a QMetaType available and can query that one. This
leads to subsequent cleanups in QQmlListAccessor::setList and
QQmlAdaptorModel::setModel which now no longer have a need to pass the
QQmlEngine along.

Task-number: QTBUG-82931
Change-Id: I6f38892a3a5098f07bc21f4eebcca82cf52a6838
Reviewed-by: Ulf Hermann &lt;ulf.hermann@qt.io&gt;
</pre>
</div>
</content>
</entry>
</feed>
