<feed xmlns='http://www.w3.org/2005/Atom'>
<title>qt/qtdeclarative.git/src/quick/items/qquickpositioners_p_p.h, branch dev</title>
<subtitle>Qt Declarative (Quick 2)
</subtitle>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/'/>
<entry>
<title>Set explicit default security level of all files with default security</title>
<updated>2025-09-17T13:31:14+00:00</updated>
<author>
<name>Jan Arve Sæther</name>
<email>jan-arve.saether@qt.io</email>
</author>
<published>2025-09-16T13:35:55+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=01cd43d30e3ca2c4dd94a4a4711604adb9417517'/>
<id>01cd43d30e3ca2c4dd94a4a4711604adb9417517</id>
<content type='text'>
The files (folders) already processed are listed in each issue in epic
QTBUG-134547

These files were processed half a year ago. In order to make it clear
that all of these files are already processed, mark them with an
explicit default security header.

For the record, this was generated with this script:

find -E . -regex ".*\.(cpp|h|hpp|mm|qml|js)$" | xargs python3 ~/bin/add-cra-header.py

in the folders listed in each subtask of QTBUG-134547

(add-cra-header.py only exist at my desktop, but it simply adds the
default security header if it doesn't already have any existing security
header)

QUIP: 23
Fixes: QTBUG-134547
Pick-to: 6.10 6.9 6.8
Change-Id: Ieb8c78ea6561fdbdd27c7b13185ece853eedf80f
Reviewed-by: Oliver Eftevaag &lt;oliver.eftevaag@qt.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The files (folders) already processed are listed in each issue in epic
QTBUG-134547

These files were processed half a year ago. In order to make it clear
that all of these files are already processed, mark them with an
explicit default security header.

For the record, this was generated with this script:

find -E . -regex ".*\.(cpp|h|hpp|mm|qml|js)$" | xargs python3 ~/bin/add-cra-header.py

in the folders listed in each subtask of QTBUG-134547

(add-cra-header.py only exist at my desktop, but it simply adds the
default security header if it doesn't already have any existing security
header)

QUIP: 23
Fixes: QTBUG-134547
Pick-to: 6.10 6.9 6.8
Change-Id: Ieb8c78ea6561fdbdd27c7b13185ece853eedf80f
Reviewed-by: Oliver Eftevaag &lt;oliver.eftevaag@qt.io&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>QQuickPositioner: re-engineer PositionedItem</title>
<updated>2025-01-23T19:54:03+00:00</updated>
<author>
<name>Giuseppe D'Angelo</name>
<email>giuseppe.dangelo@kdab.com</email>
</author>
<published>2025-01-21T09:28:28+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=3aa435957fdfd42d29cab41b2d3e6e335bf81f0b'/>
<id>3aa435957fdfd42d29cab41b2d3e6e335bf81f0b</id>
<content type='text'>
The class violated the rule of 5, had insufficient encapsulation, and
triggered undefined behavior.

It was designed to be stored in a QPODVector, but when using
transitions, it owns a pointer (transitionableItem). However the class
didn't disengage copies (!), and was actively being copied around in
code (thankfully, holding a null pointer, otherwise this would
double-delete).

Since QPODVector doesn't run destructors when deleting elements
("POD", but PositionedItem isn't POD, and thus not running the
destructor is language UB), another couple of methods were needed when
removing elements from the vector, to make sure to delete the pointer.

Make PositionedItem hold a unique_ptr instead, for clear ownership
semantics. Since QPODVector won't work any more, store it in a
std::vector. There is no longer need of external code to manage
ownership, so remove it.

The rest of the changes are mostly mechanical: turn index-based
iterations into range-based for loops, and calls to index-based
QPODVector::find to iterator-based std::find. To ease the search,
add an overload of operator== that takes a QQuickItem (with similar
semantics to the existing operator==).

Change-Id: I5eed1a9aada4db2417a586f2113c6892c058fbb0
Reviewed-by: Shawn Rutledge &lt;shawn.rutledge@qt.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The class violated the rule of 5, had insufficient encapsulation, and
triggered undefined behavior.

It was designed to be stored in a QPODVector, but when using
transitions, it owns a pointer (transitionableItem). However the class
didn't disengage copies (!), and was actively being copied around in
code (thankfully, holding a null pointer, otherwise this would
double-delete).

Since QPODVector doesn't run destructors when deleting elements
("POD", but PositionedItem isn't POD, and thus not running the
destructor is language UB), another couple of methods were needed when
removing elements from the vector, to make sure to delete the pointer.

Make PositionedItem hold a unique_ptr instead, for clear ownership
semantics. Since QPODVector won't work any more, store it in a
std::vector. There is no longer need of external code to manage
ownership, so remove it.

The rest of the changes are mostly mechanical: turn index-based
iterations into range-based for loops, and calls to index-based
QPODVector::find to iterator-based std::find. To ease the search,
add an overload of operator== that takes a QQuickItem (with similar
semantics to the existing operator==).

Change-Id: I5eed1a9aada4db2417a586f2113c6892c058fbb0
Reviewed-by: Shawn Rutledge &lt;shawn.rutledge@qt.io&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Alert when we are notifying semi-dead change listeners</title>
<updated>2024-12-01T17:41:22+00:00</updated>
<author>
<name>Volker Hilsheimer</name>
<email>volker.hilsheimer@qt.io</email>
</author>
<published>2023-04-16T13:47:14+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=a6c8de2780b6dface7504b5423e064e026a6e564'/>
<id>a6c8de2780b6dface7504b5423e064e026a6e564</id>
<content type='text'>
Add virtual methods "baseDeleted" and "debugName" to
QQuickItemChangeListener that let us report whether the object that
implements QQuickItemChangeListener is already being destroyed. Add a
"safe" version of QQuickItemChangeListener that overrides that virtual
method using CRTP: if the derived class that it is instantiated with has
a member "inDestructor" (e.g. a QQuickItemPrivate) or "wasDeleted" (e.g.
a QObjectPrivate), then return the value of that variable. If the
derived type is a QObject or QQuickItem, access the member via
QQmlData::wasDeleted.

Ignore calls on listeners that are the same object as the caller.

Use that new type in those classes where it isn't immediately obvious
that they clean up after themselves: classes that don't implement a
destructor are a red flag.

In addition, add a list to safe listener version to add/remove each
item it's listening on.

Issue runtime warnings in developer-builds when listeners are called
for which baseDestroyed() returns true, and when listeners are
destroyed while they still have items on their list.

Task-number: QTBUG-98790
Change-Id: I15ed66a36556caa0e6acf5b768dec2ae92b01d64
Reviewed-by: Fabian Kosmale &lt;fabian.kosmale@qt.io&gt;
Reviewed-by: Mitch Curtis &lt;mitch.curtis@qt.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add virtual methods "baseDeleted" and "debugName" to
QQuickItemChangeListener that let us report whether the object that
implements QQuickItemChangeListener is already being destroyed. Add a
"safe" version of QQuickItemChangeListener that overrides that virtual
method using CRTP: if the derived class that it is instantiated with has
a member "inDestructor" (e.g. a QQuickItemPrivate) or "wasDeleted" (e.g.
a QObjectPrivate), then return the value of that variable. If the
derived type is a QObject or QQuickItem, access the member via
QQmlData::wasDeleted.

Ignore calls on listeners that are the same object as the caller.

Use that new type in those classes where it isn't immediately obvious
that they clean up after themselves: classes that don't implement a
destructor are a red flag.

In addition, add a list to safe listener version to add/remove each
item it's listening on.

Issue runtime warnings in developer-builds when listeners are called
for which baseDestroyed() returns true, and when listeners are
destroyed while they still have items on their list.

Task-number: QTBUG-98790
Change-Id: I15ed66a36556caa0e6acf5b768dec2ae92b01d64
Reviewed-by: Fabian Kosmale &lt;fabian.kosmale@qt.io&gt;
Reviewed-by: Mitch Curtis &lt;mitch.curtis@qt.io&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix build with -no-feature-quick-viewtransitions</title>
<updated>2023-03-07T09:24:50+00:00</updated>
<author>
<name>Tasuku Suzuki</name>
<email>tasuku.suzuki@signal-slot.co.jp</email>
</author>
<published>2023-03-05T08:11:08+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=562a1a46a0917be3f9bb8c24b81aa7ad5a46f010'/>
<id>562a1a46a0917be3f9bb8c24b81aa7ad5a46f010</id>
<content type='text'>
Pick-to: 6.5
Change-Id: I609a843bddbd0776452d289b144dab803503a483
Reviewed-by: Volker Hilsheimer &lt;volker.hilsheimer@qt.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pick-to: 6.5
Change-Id: I609a843bddbd0776452d289b144dab803503a483
Reviewed-by: Volker Hilsheimer &lt;volker.hilsheimer@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>Replace Q_DECL_OVERRIDE with override</title>
<updated>2017-09-25T08:27:35+00:00</updated>
<author>
<name>Kevin Funk</name>
<email>kevin.funk@kdab.com</email>
</author>
<published>2017-09-20T18:57:39+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=681f93c74d7d60dc1998d3124e1f59ddc0f476ee'/>
<id>681f93c74d7d60dc1998d3124e1f59ddc0f476ee</id>
<content type='text'>
Change-Id: I176f91a8c51e81a2df3fe91733118261491223ee
Reviewed-by: Lars Knoll &lt;lars.knoll@qt.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change-Id: I176f91a8c51e81a2df3fe91733118261491223ee
Reviewed-by: Lars Knoll &lt;lars.knoll@qt.io&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "Positioners: allow distinguishing between implicit/explicit child size"</title>
<updated>2017-04-05T09:25:22+00:00</updated>
<author>
<name>Mitch Curtis</name>
<email>mitch.curtis@qt.io</email>
</author>
<published>2017-03-29T11:11:08+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=315f3689866adea143b064ade6a77d6e21bcc2e3'/>
<id>315f3689866adea143b064ade6a77d6e21bcc2e3</id>
<content type='text'>
This reverts commit 2556bfdab42dc0aefb34bb7cf304063c7db0ff00.

This is no longer necessary, as there are now no users of this
functionality in other modules.

Change-Id: If92bbdb3e5e95b4103610d68d22e929cf30c4e5e
Reviewed-by: J-P Nurmi &lt;jpnurmi@qt.io&gt;
Reviewed-by: Robin Burchell &lt;robin.burchell@crimson.no&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 2556bfdab42dc0aefb34bb7cf304063c7db0ff00.

This is no longer necessary, as there are now no users of this
functionality in other modules.

Change-Id: If92bbdb3e5e95b4103610d68d22e929cf30c4e5e
Reviewed-by: J-P Nurmi &lt;jpnurmi@qt.io&gt;
Reviewed-by: Robin Burchell &lt;robin.burchell@crimson.no&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Positioners: allow distinguishing between implicit/explicit child size</title>
<updated>2017-02-23T13:45:52+00:00</updated>
<author>
<name>Mitch Curtis</name>
<email>mitch.curtis@qt.io</email>
</author>
<published>2017-02-07T12:54:29+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=2556bfdab42dc0aefb34bb7cf304063c7db0ff00'/>
<id>2556bfdab42dc0aefb34bb7cf304063c7db0ff00</id>
<content type='text'>
In Qt Quick Controls 2, we plan on using positioners to layout an icon
next to text in a button, for example.

Consider the following example:

    AbstractButton {
       id: button
       text: "Button"
       contentItem: Row {
           Text {
               text: button.text
               width: parent.width
           }
       }
       background: Rectangle {
           radius: 5
           color: "lightsteelblue"
           opacity: button.pressed ? 1.0 : 0.8
       }
    }

In Qt Quick Controls 2, implicit size propagates "up" from the
delegates/building blocks to the control, whereas explicit size
propagates "down" from the control to the delegates/building blocks.
Providing a reasonable implicit size is important to make controls
behave well in layouts, etc., and the internal building blocks must
follow the size of the control to retain sensible looks when a control
is resized.

In the example above, contentItem needs to have a "natural" (implicit)
size representing the ideal fit of the content, but it needs to respect
the explicitly provided size from the control too.

With the current behavior, as the explicit width of the Row is 0, the
Text item (via the width binding) sets explicit width to 0, and Row
uses that explicit width rather than the implicit width, thus, Row here
will have an implicit width of 0, which is not what the control wants.

This patch:

- Allows subclasses of positioners to set
  QQuickBasePositionerPrivate::useImplicitSize to true in order to tell
  positioners to use implicit size rather than explicit size. This is
  not exposed as public API, as this behavior is typically not
  something desirable in the positioners themselves. For example,
  Row { Rectangle { width: 100; height: 100 } } would have an implicit
  size of 0, as Rectangle has no implicit size.
- Adds QQuickImplicitRow and QQuickImplicitGrid, which are private
  subclasses of their respective positioners that simply set
  useImplicitSize to true in their constructors.
- Exports the wrappers privately so that they can be registered by
  other modules as QML types.

Change-Id: Ie68aabd7fbf6c76375badf6e338f2f238f3fc392
Reviewed-by: J-P Nurmi &lt;jpnurmi@qt.io&gt;
Reviewed-by: Robin Burchell &lt;robin.burchell@crimson.no&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In Qt Quick Controls 2, we plan on using positioners to layout an icon
next to text in a button, for example.

Consider the following example:

    AbstractButton {
       id: button
       text: "Button"
       contentItem: Row {
           Text {
               text: button.text
               width: parent.width
           }
       }
       background: Rectangle {
           radius: 5
           color: "lightsteelblue"
           opacity: button.pressed ? 1.0 : 0.8
       }
    }

In Qt Quick Controls 2, implicit size propagates "up" from the
delegates/building blocks to the control, whereas explicit size
propagates "down" from the control to the delegates/building blocks.
Providing a reasonable implicit size is important to make controls
behave well in layouts, etc., and the internal building blocks must
follow the size of the control to retain sensible looks when a control
is resized.

In the example above, contentItem needs to have a "natural" (implicit)
size representing the ideal fit of the content, but it needs to respect
the explicitly provided size from the control too.

With the current behavior, as the explicit width of the Row is 0, the
Text item (via the width binding) sets explicit width to 0, and Row
uses that explicit width rather than the implicit width, thus, Row here
will have an implicit width of 0, which is not what the control wants.

This patch:

- Allows subclasses of positioners to set
  QQuickBasePositionerPrivate::useImplicitSize to true in order to tell
  positioners to use implicit size rather than explicit size. This is
  not exposed as public API, as this behavior is typically not
  something desirable in the positioners themselves. For example,
  Row { Rectangle { width: 100; height: 100 } } would have an implicit
  size of 0, as Rectangle has no implicit size.
- Adds QQuickImplicitRow and QQuickImplicitGrid, which are private
  subclasses of their respective positioners that simply set
  useImplicitSize to true in their constructors.
- Exports the wrappers privately so that they can be registered by
  other modules as QML types.

Change-Id: Ie68aabd7fbf6c76375badf6e338f2f238f3fc392
Reviewed-by: J-P Nurmi &lt;jpnurmi@qt.io&gt;
Reviewed-by: Robin Burchell &lt;robin.burchell@crimson.no&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Positioners: remove unused header includes</title>
<updated>2017-02-23T13:45:30+00:00</updated>
<author>
<name>Mitch Curtis</name>
<email>mitch.curtis@qt.io</email>
</author>
<published>2017-02-23T11:59:05+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=3681514f80a2f6a568b0508a58b5e486cee00b0f'/>
<id>3681514f80a2f6a568b0508a58b5e486cee00b0f</id>
<content type='text'>
Change-Id: I1d2a57d5a5392986460e2427b4ee2a1b2b17dbaa
Reviewed-by: J-P Nurmi &lt;jpnurmi@qt.io&gt;
Reviewed-by: Robin Burchell &lt;robin.burchell@crimson.no&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change-Id: I1d2a57d5a5392986460e2427b4ee2a1b2b17dbaa
Reviewed-by: J-P Nurmi &lt;jpnurmi@qt.io&gt;
Reviewed-by: Robin Burchell &lt;robin.burchell@crimson.no&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Make itemviews and positioners configurable</title>
<updated>2016-10-10T14:12:11+00:00</updated>
<author>
<name>Lars Knoll</name>
<email>lars.knoll@qt.io</email>
</author>
<published>2016-08-17T12:12:06+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=b9447812542a4315718cd0fad9a9fb10a25e114a'/>
<id>b9447812542a4315718cd0fad9a9fb10a25e114a</id>
<content type='text'>
Change-Id: Ia26cbbdb2b2a0ed74398bfad7689db7289ad8c6a
Reviewed-by: Oswald Buddenhagen &lt;oswald.buddenhagen@theqtcompany.com&gt;
Reviewed-by: Simon Hausmann &lt;simon.hausmann@qt.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change-Id: Ia26cbbdb2b2a0ed74398bfad7689db7289ad8c6a
Reviewed-by: Oswald Buddenhagen &lt;oswald.buddenhagen@theqtcompany.com&gt;
Reviewed-by: Simon Hausmann &lt;simon.hausmann@qt.io&gt;
</pre>
</div>
</content>
</entry>
</feed>
