Turn on anti-aliasing, and update screenshot.
The example is still not great and under-documented, but at least it
doesn't look horrible anymore.
Task-number: QTBUG-120291
Change-Id: Ie709cb51d64c535d7cd0aa1451b3c5bb901324cb
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 2b9d021ba5487f7f5f67b958a17160c4cf468561)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit d8b113f46f11dd6d7229df0cb58f56dccfc70eb5)
Simplify the "responsive layout" implementation. Just use a QBoxLayout
with changing direction instead of repopulating a QGridLayout, and
change the orientation of one set of sliders instead of creating two
sets in a stacked layout.
Simplify the resizeEvent() implementation accordingly.
Update the documentation snippet text to match the code, and document
the resizeEvent() override.
Fixes: QTBUG-119977
Change-Id: I73a1bb215c956fa283291ebf0ea45ff9a975c727
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit f3fb89ba298e1741320d8bfac9cbd0d503373bff)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 2d3ee8ac34bdf30ffc14054a8aeb64ba292bb96e)
On macOS, we don't deliver a press event for the first press on the
track pad (Qt::WA_TouchPadAcceptSingleTouchEvents is not set by default,
so Qt doesn't deliver a single-press on the track pad as a touch event -
that makes some sense or at least maintains compatibility). Because of
that, point 0 is never added to the finger-mapping hash.
When point 0 is then released, we didn't check if we found a valid
iterator for that point ID, and the example crashed.
Fix this by checking that we have a valid iterator before dereferencing,
and by handling Stationary events in the same way as pressed (add the
point to the mapping if it's not already there).
Pick-to: 6.5
Fixes: QTBUG-110266
Change-Id: I32337b801aaabf9b821a97ddc15ad78747b5e6a2
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
(cherry picked from commit 9d8473cdf63537dee65e9c235249b4e4901baa1a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 7378c709f527749493bc15e66a566e1bdfc09fd3)
The example has a lot of code and documentation, but in essence shows
how to use float-based QPainter APIs and how to set a render hint. That
is two lines of code, which we can show as snippets.
Update the screenshot of the example with a higher-resolution version.
Fixes: QTBUG-119983
Change-Id: Iafcb813dff6ab8c269176f7994c95947ebf5e559
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 33254fb41f29b510d3d74dbaab60f0a67ef56d46)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 6c726979f744e85dc1284374ef1663a85647365e)
Add a test running QAbstractItemModelTester on the model.
Change-Id: I40c141c7e754ca05234da611534bd65e456be2fb
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 283cdcd3d5fad368c9df1bcae69cbfbf9ade623f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
- Use QStringView.
- Use a list of a pair-like struct to represent the state instead of
2 lists.
- Use qsizetype.
- Use constLast() to avoid detaching.
Change-Id: I5ff8a17a4d583a7d2a0a11a52c29b9117280382c
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 5134b3ad54743e3a997ff27af112df79821e5ce1)
Add a test running QAbstractItemModelTester on the model.
Change-Id: I6ea5d34308357409b9a13eb0271392c8d171addd
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit d9c71b834ccd815b85e9589f21eba1f51c48614a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
- Use unique_ptr instead of manual memory management
- Improve consistenty in variable name with the simpletreemodel
childrenNumber -> row, m_ prefix for member variables
Change-Id: Iface30c2224c2b1db7c623a9e6fcbb449c556f3e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 604b2feca751c5eb43b20e180c175acc2a87099e)
Reviewed-by: <carl@carlschwan.eu>
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
- Use QStringView.
- Use a list of a pair-like struct to represent the state instead
of 2 lists.
- Use qsizetype.
- Use constLast() to avoid detaching.
Change-Id: Icc3586451f081f6166fece52675d5379160f51da
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 1c06f86d255d3d92201b1092794a4c1ea403c24d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The shaped clock example has the appearance of the analog clock, which
was refurbished with 619ec1a6406a8be7bfa9d96b9e693e7a3323d8dc. This
change applies the refurbished design to the shaped clock.
Task: QTBUG-118871
Change-Id: Ibcfc8e9fb239a1c6f7ea685f6cab1e50b2060a53
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit f6e7fdd4ad868e5d17ffa7502ed934985df938a6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Use std::unique_ptr to manage items tree memory allocations. This also
use the new string literals operator.
Change-Id: Iab002b5dc612b75cef0be10862e263c6c6c013c1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 25027444a9b53d61a6257dc5f5ce0ffdb3b06f98)
The important bits from the example are ~10 lines of code, no need
for building a poor-man's version of a graphics or item view.
Change-Id: I7874c66765c5b46230c92846ee3de1ee83f47e45
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
(cherry picked from commit ae39b1634556f82fe5d7505ed9b6ebb883d6f813)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When adding custom buttons to a QMessageBox the return value of exec()
as well as result() is not a StandardButton value, but instead an opaque
value, and the documentation says to use clickedButton() to determine
which button was clicked.
Pick-to: 6.5
Change-Id: Ib47a218989b4dcb5d51f648bc55bc02399bae602
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
(cherry picked from commit 1fd1ffd03d6889273f574c698e07c611bd311fd9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QItemDelegate was superseded since Qt4 by QStyledItemDelegate but it
took until Qt6.7 to remove the last occurrences in qtbase.
- remove unused includes / replace with qabstractitemdelegate.h
- replace references in the documentation with QStyledItemDelegate
- adjust the examples and tests to use QStyledItemDelegate
Pick-to: 6.5
Change-Id: I246755004ce2d01192a726ca0972106c237df0cc
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 4e8b54eb811f8c6064fd2e937711efe68543087c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It's Thomas Porter and Tom Duff, not Xavier and Yoann.
Change-Id: I2e9345c06c299e9c0475831e21c3b9b85c58a32f
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit 631cb589bf53223648376c72d588a7914e463924)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Added example categories and fixed some minor typos as well.
Task-number: QTBUG-116359
Change-Id: I2e270a1919003f4cea233666b64437e4c2b77121
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 7ef93cbf6883af053b1bdf042975b11a39f0312b)
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
The example keeps around image file names only and append
them to the selected dir path, that works fine for file
scheme files, but for Android with content scheme files,
that doesn't work as good because usually the paths are
returned by a provider and managing them manually like
appending a file name to a directory (tree) path might not
work.
This patch retrieves QFileInfo objects and use the absolute
file paths to open any image.
Fixes: QTBUG-116181
Change-Id: I9911a181d92ba0452500398cbe052b9583bd79a0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 381612f7944b202c8b1428f0cc9d1af72f5f7647)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
A few examples seem to have copied and pasted a help action "About
&Qt" that triggered QCoreApplication::quit. This does not look like
best practice. Use QApplication::aboutQt instead.
Task-number: QTBUG-111228
Change-Id: I1887a3c999d752a24c7c4d3cabc4a5d63b29b966
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 3ccf2f8308ba33cab575c22ad2e246b987a3dc0c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Example source code should be LicenseRef-Qt-Commercial OR BSD-3-Clause
Change-Id: Ia9cf6f4783fde0e25f72a31bbe6d809118fd4240
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 3040eadd832b8dadaae04660047fdcd42519b0a2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Removing dangling references to the example due to its move to
manual tests.
Change-Id: I13f5fad93763d1ef70ddd8b3dcf430b5df8e28f9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit d2db1d511ddbc4d676bcd93881e17e42edd37b84)