Commit Graph

2085 Commits

Author SHA1 Message Date
Edward Welbourne
40b07ee887 Minor tidies in example's XML converter
Make a local variable more local, set a variable only once its new
value is known to be valid.

Pick-to: 6.6 6.5
Task-number: QTBUG-111228
Change-Id: Ib6aa16e8c834f89c6ccc0715f20b0e5f0a7f3b6d
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
2023-09-05 22:41:35 +02:00
Edward Welbourne
d631f88804 Exploit C++17 init-statements in if to simplify a loop
The serialization converter example's text converter's loadFile() can
be made tidier by making the conditions within its loop into a chain.

Pick-to: 6.6 6.5
Task-number: QTBUG-111228
Change-Id: Ic82355eab7380a0c671b3805ca140958bb1c5af5
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
2023-09-05 22:41:35 +02:00
Edward Welbourne
833ed75b65 Update datastream converter to use Qt_6_0 instead of Qt_5_0
It was added in 5.12 and we've had a few upates since then.

Pick-to: 6.6 6.5
Task-number: QTBUG-111228
Change-Id: Iacb5368d4baa7d25f981bb0b8bd8d68b5461e17d
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-09-05 16:50:53 +02:00
Edward Welbourne
670f66eed3 Core serialization examples: spacing-only clang-format changes
Marc disagreed with clang-format on some, which are thus excluded.

Pick-to: 6.6 6.5
Task-number: QTBUG-111228
Change-Id: I1402274635dba866a8160a68211874cb11dcfa61
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-09-05 16:40:47 +02:00
Jaishree Vyas
ce47799de6 Doc: Add example categories for qtopengl
Task-number: QTBUG-116069
Pick-to: 6.5 6.6
Change-Id: If675124e538c197d3b446f09da0620718b7b7118
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2023-09-05 12:28:42 +02:00
Mats Honkamaa
7ef93cbf68 Doc: Add example categories to Qt Widget examples
Added example categories and fixed some minor typos as well.

Task-number: QTBUG-116359
Pick-to: 6.5 6.6
Change-Id: I2e270a1919003f4cea233666b64437e4c2b77121
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-09-05 07:47:49 +03:00
Assam Boudjelthia
381612f794 Image Gestures Example: use QFileInfo for images file names
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.

Pick-to: 6.6 6.5 6.2
Fixes: QTBUG-116181
Change-Id: I9911a181d92ba0452500398cbe052b9583bd79a0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2023-08-31 22:11:51 +00:00
Laszlo Agocs
80520c2f52 Enable QWidget::grab() with QRhiWidget in the widget tree
This involves reimplementing QWidgetPrivate::grabFramebuffer().
Widgets call this function whenever a texture-based widget is
encountered.

This implies however that we rename QRhiWidget's own, lightweight
grab function, grab(), because it kind of shadows QWidget's grab().
Switch back to grabFramebuffer() which is what QQuickWidget and
QOpenGLWidget both use.

Supporting QWidget::grab() is particularly important when grabbing
an ancestor of the QRhiWidget, because that has no alternative.
Right now, due to not reimplementing the QWidgetPrivate function,
the place of the QRhiWidget is left empty.

In addition, grabFramebuffer() is now const. This is consistent
with QQuickWidget, but not with QOpenGLWidget and QOpenGLWindow.

Change-Id: I646bd920dab7ba50415dd7ee6b63a209f5673e8f
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2023-08-28 21:14:28 +02:00
Elias Hautala
39a5ed4bdd Exclude some examples from Android build
Excludes  dnslookup, waitconditions, semaphores, cbordump, savegame,
convert, pingpong and complexpingpong examples from Android build
because of missing Qui and Quick dependenies.

Task-number: QTBUG-111933
Pick-to: 6.5 6.6
Change-Id: Ied01f62ee61a9220dcb44c13fda46f6a5e158293
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2023-08-28 16:00:45 +03:00
Safiyyah Moosa
3b187f14a1 Doc: Add \examplecategory to qtgui
Task-number: QTBUG-116068
Pick-to: 6.5 6.6
Change-Id: Ia0bdc2122434adac51b37ba2207a2b0b993cf19b
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2023-08-28 13:49:36 +02:00
Ahmad Samir
0b3390f33d examples/: fix compiler (GCC) warnings -Wsign-compare
Change-Id: Ie4965e3ce3113e9c7a5d5d5eba4cab143ef1c806
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-08-18 23:35:52 +03:00
Ahmad Samir
ad6fd04609 examples/: fix compiler warnings -Wdeprecated-enum-float-conversion
This is with GCC.

Change-Id: I52dcb6881f36c740129b699db7db9241a4e75da1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-08-18 23:35:52 +03:00
Ahmad Samir
339323b999 examples/: implicit capture of this via [=] is deprecated in C++20
Change-Id: I43b04517e9e3a30468c8ce702c9a49968c0ddc4d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-08-18 23:35:52 +03:00
Mårten Nordheim
5be45ff6a6 Multi-stream* example: add simple docs
To make it show up in the documentation.
It's also our only example showing SCTP.

Change-Id: Ib80ab869d9a6cbd370aa1a0c74772639e4393b37
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-08-17 13:15:00 +00:00
Mats Honkamaa
4e009da7ef Doc: Add example categories for Qt Network examples
Task-number: QTBUG-116001
Pick-to: 6.5 6.6
Change-Id: I0c32df7752347f7c38996b3815d270dbd4c90707
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2023-08-16 15:56:50 +03:00
Laszlo Agocs
d48831612a examples: Add new subdirectory to examples/widgets CMakeLists
Already there in the .pro.

Change-Id: I2f4312310b80ad3403f242ba387218e8ec86bcb4
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2023-08-15 01:11:03 +02:00
Laszlo Agocs
72a453c6a8 Add QRhiWidget
Task-number: QTBUG-113331
Change-Id: I8baa697b4997b05f52acdee0e08d3c368fde5bc2
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2023-08-14 17:05:36 +02:00
Mats Honkamaa
b1c062d078 Doc: Add example categories for Qt D-bus examples
Task-number: QTBUG-116030
Pick-to: 6.5 6.6
Change-Id: I6ad7ddb69fc952d3bba7477ab804455d46d77866
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2023-08-14 17:08:33 +03:00
Edward Welbourne
fd7fbaf887 XBEL stream reader: rework documentation
Document previously-undocumented methods. Document in terms of what
each thing achieves, not how it does it. The U+00B7 is not the period,
it is the centred dot. Fix various anachronisms; the existing docs
were out of date with the actual code.

Pick-to: 6.6 6.5
Task-number: QTBUG-111228
Change-Id: I17da880e0afd7260aa6f3b7bdddb430c437f4562
Reviewed-by: Jaishree Vyas <jaishree.vyas@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2023-08-03 19:16:27 +02:00
Jani Korteniemi
b3127806a7 Update Android notifier example to match example guideline
Replaced add_subdirectory() with qt_internal_add_example().
Added tags.

Task-number: QTBUG-114638
Change-Id: I397c2974a51f0bea391099d1d1abfea39bd29cbe
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2023-08-02 15:47:15 +03:00
Amir Masoud Abdol
95ed8d1fd9 Fix the project name
Fixes: QTBUG-115327
Pick-to: 6.2 6.5 6.6
Change-Id: I77fc3a98d1658609caa9618430f6e6823b8e1bb5
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-07-31 12:38:40 +02:00
Edward Welbourne
63de44f1d3 Add missing \l to DOM bookmarks example
It tried to reference the QXmlStream equivalent example, putting its
title in {...}, but neglected the \l prefix to that.

Change-Id: Iedc556ecd65103057d0dea65debe628b50d1190e
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
2023-07-25 12:31:04 +02:00
Mårten Nordheim
0b10808fb5 Network-chat example: update the screenshot
Change-Id: Ibdb9e242295766304c1c7a551d831fb796518496
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-07-17 18:49:16 +02:00
Mårten Nordheim
2a80adc2f6 Network-chat example: Use QHash for peers
We don't key it on IP address anymore so we can drop
the use of QMultiHash.
This also requires moving the connections for error and disconnected
to readyForUse so we don't remove an active connection when a second
connection attempt happens from the same peer process.
But since we still need to deallocate those connection attempts
if they error out or simply disconnect, we connect their signals to the
QObject::deleteLater slot. In some cases we might call deleteLater twice
but that's fine.

Change-Id: I48c27de1e51a52ef61cfb941a7a81b358ae9ce3f
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
2023-07-17 18:49:16 +02:00
Mårten Nordheim
226d06402b Network-chat: Fix remote peer making multiple connections
The system was just treating IP (and optionally port) as a unique
identifier, so if a peer had multiple possible paths to a client they
would connect multiple times.

This fixes that by generating using QUuid in each client.
We then use this during broadcast, replacing the username we
sent before (which was not used), and as part of the greeting.
The greeting now is more complex, since we need to send both
username and the ID.

Change-Id: I6c6c2ffd5198406aad48445a68dd6aab36de69c0
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-07-17 16:49:16 +00:00
Edward Welbourne
5651be517a XBEL stream example: use constructor initialization
The treeWidget member of MainWindow could be initialized before the
body of the constructor, enabling it to be a *const variable.

Pick-to: 6.6 6.5
Task-number: QTBUG-111228
Change-Id: If4a3b04729bc7fa5859ca88183eec376f6992455
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-07-17 14:50:51 +02:00
Paul Olav Tvete
631cb589bf Doc fix: Use correct initials for Porter and Duff
It's Thomas Porter and Tom Duff, not Xavier and Yoann.

Pick-to: 6.6 6.5
Change-Id: I2e9345c06c299e9c0475831e21c3b9b85c58a32f
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2023-07-14 14:56:42 +02:00
Kai Köhne
c07a3f10ef Doc: Add remaining SQL examples to Data Processing & I/O category
Task-number: QTBUG-115174
Pick-to: 6.5 6.6
Change-Id: Idd8ba8504efb17f0e4a11b3c36b991739251f2ef
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2023-07-13 16:19:05 +02:00
Mårten Nordheim
9777fd0257 broadcast{receiver,sender}: update meta info
Change-Id: I864de05a766fa4e5b9b7fdec7c2b95ac2b576c26
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-07-12 11:29:55 +02:00
Mårten Nordheim
bec7c39950 DnsLookup: add some documentation
Just to make it show up in the docs.

Change-Id: I22e9a1eb7dd040e76ee68f3f63053b030733b33d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-07-12 11:29:54 +02:00
Mårten Nordheim
d3526c166c securesocketclient: Update meta info
Change-Id: I34b11cd73c80dc3033de8731bd8edc0db3ed4a12
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-07-12 11:29:28 +02:00
Mårten Nordheim
f89bf4f25d securesocketclient: Replace the screenshot
Change-Id: I73658fef13ac4fdc046011f6aa68b6f97555546a
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-07-12 11:29:25 +02:00
Mårten Nordheim
d34952a3d1 securesocketclient: Replace QLatin1Char with char16_t literal
Change-Id: I3efebe12e3a46c35e6c1775226e9ba424811cc30
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
2023-07-12 11:29:22 +02:00
Edward Welbourne
e8a68b556c XBEL streaming example: renumber xbelreader.cpp's snippet fragments
I'll be adding docs for parts currently lacking them; fix up the
numbering first, to disentangle from "real" changes to docs.

Pick-to: 6.6 6.5
Task-number: QTBUG-111228
Change-Id: Ia10f212626bf5ca9fab2b6ba6cf02dbd560a2f02
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
2023-07-10 12:57:21 +02:00
Edward Welbourne
98765cab97 XBEL streaming: shuffle mainwindow parts into more pedagogic order
Renumber the code fragments to match their order, while adding a
number for the previously undocumented custom method. Add a brief
description of it. Move the createMenus() part up to after it, combine
the createActions() with its (as createActions() is long gone, fused
into it and sharing its snippet number).

Pick-to: 6.6 6.5
Task-number: QTBUG-111228
Change-Id: If0fbcadfa058fc12cbd74ba1897646113bd016b0
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
2023-07-10 12:57:20 +02:00
Edward Welbourne
bb69def7d1 XBEL stream example: move createMenus() earlier
This will make the description of the type flow more naturally.

Pick-to: 6.6 6.5
Task-number: QTBUG-111228
Change-Id: I751bdaf420be7afc9cb4925af4f2a94367840605
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Mate Barany <mate.barany@qt.io>
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
2023-07-10 12:57:20 +02:00
Edward Welbourne
acb950c129 XBEL DOM example: update the screenshot
The old one showed an old XBEL file's content, with trolltech URLs.
Update to match the new XBEL file's content.

Pick-to: 6.6 6.5
Task-number: QTBUG-111228
Change-Id: I2b3bb7d67c6f96b04208fe4b1f9af10055dc0496
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Kimmo Leppälä <kimmo.leppala@qt.io>
2023-07-10 12:57:20 +02:00
Edward Welbourne
a028e53fa4 XBEL streaming: replace images with up-to-date version
The old screenshot showed an old XBEL file's content, with trolltech
URLs. Update to match the new XBEL file's content.

Pick-to: 6.6 6.5
Task-number: QTBUG-111228
Change-Id: Idacc31b7786b1e6ed1425857470b1d37227096cd
Reviewed-by: Kimmo Leppälä <kimmo.leppala@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-07-10 12:57:20 +02:00
Edward Welbourne
4731cdc09d Update XBEL examples' sample data file
Most links are now https, several have relocated, one entirely
rebranded. Same example in both QXmlStream and DOM forms.

Pick-to: 6.6 6.5
Task-number: QTBUG-111228
Change-Id: Ifbc58dadc834cf51113adb1c82de971a8768ee58
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2023-07-10 12:57:20 +02:00
Edward Welbourne
54f65187ec Update Qt Documentation link title in XBEL examples
doc.qt.io was described as Qt 5 documentation; no need to version-limit it.

Pick-to: 6.6 6.5
Task-number: QTBUG-111228
Change-Id: I1c5abe3d805c2b845a74b9fe454c494fa1eff4c7
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-07-10 12:57:19 +02:00
Kai Köhne
60f706063a Doc: Update example category names
Pick-to: 6.5 6.6
Change-Id: If4a50c403ed0fb299ac0d9a66f1f606151c55930
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2023-07-10 11:34:40 +02:00
Axel Spoerl
d2db1d511d Remove references to Application Example
Removing dangling references to the example due to its move to
manual tests.

Pick-to: 6.6 6.5
Change-Id: I13f5fad93763d1ef70ddd8b3dcf430b5df8e28f9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-07-06 21:42:38 +02:00
Safiyyah Moosa
efc6b9946b Docs: Add link to OPenGL examples to OpenGL index
Task-number: QTBUG-112824
Pick-to: 6.5 6.6
Change-Id: Ib507e8c32518442fd211f3486c4317b4907ea414
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2023-06-30 18:46:55 +02:00
Kai Köhne
3040eadd83 Doc: Fix license of foreignwindows example
Example source code should be LicenseRef-Qt-Commercial OR BSD-3-Clause

Pick-to: 6.5 6.6
Change-Id: Ia9cf6f4783fde0e25f72a31bbe6d809118fd4240
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-06-30 18:46:54 +02:00
Amanda Hamblin-Trué
15a7e108aa Contiguous cache example: minor cleanup
Modernised contiguous cache example.

Change-Id: I88d67b03ed95a61484873149da16f0d814b26cd8
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-06-30 12:55:01 +02:00
Tor Arne Vestbø
72a153a7f5 Move simple widget mapper example to manual test
Pick-to: 6.5 6.6
Change-Id: I703843b5ee935794c2e2fd0407f9a1508b088ab6
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-30 08:51:06 +02:00
Tor Arne Vestbø
8937169c19 Move simple dom model example to manual test
Pick-to: 6.5 6.6
Change-Id: I33120e3f6217ea52bdfdebea8b5faa79d9d3fd68
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-30 08:51:02 +02:00
Tor Arne Vestbø
9c71b92430 Move plug and paint example to manual test
Pick-to: 6.5 6.6
Change-Id: Ibfd870f2f879d6ae68cd6806b0c1ab02da0a3441
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-30 08:50:59 +02:00
Tor Arne Vestbø
921337f98c Move pixelator example to manual test
Pick-to: 6.5 6.6
Change-Id: I3ce2bc269a9f77bce3dd41f0127d01091c1408f6
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-30 08:50:55 +02:00
Liang Qi
ed1fbc7a88 Examples: Revamp sql/books
* use nullptr
* use member init
* set ExpandingFieldsGrow fieldGrowthPolicy for QFormLayout, which
makes it behaviors similar on macOS as other platforms
* select first row to make up/down keys works by default

Pick-to: 6.5 6.6
Change-Id: I25d9869d2ca1c7274c2b750aada8270734787546
Reviewed-by: Liang Qi <liang.qi@qt.io>
2023-06-29 16:06:33 +00:00
Tor Arne Vestbø
5654fbffd5 Move dials example to manual test
Pick-to: 6.5 6.6
Change-Id: Ib99a3890b814c2089db62485f0a10cf308ff9b66
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-29 14:49:14 +02:00
Tor Arne Vestbø
81db1766dd Move textedit example to manual test
Pick-to: 6.5 6.6
Change-Id: Ic3189044598be8e121c1f065e68e04a3547a87d0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-29 14:49:13 +02:00
Tor Arne Vestbø
40dbee13eb Move tetrix example to manual test
Pick-to: 6.5 6.6
Change-Id: Ie73d9e35df8513d05d55ffbad1f02584359e3bd0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-29 14:49:13 +02:00
Tor Arne Vestbø
89b463ac2f Move styles example to manual test
Pick-to: 6.5 6.6
Change-Id: I5738932c0c498ce2075a399274e3b80a04ad9211
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-29 14:49:13 +02:00
Tor Arne Vestbø
1e954f9be8 Move stylesheets example to manual test
Pick-to: 6.5 6.6
Change-Id: If0206e63546bf948af4cfb65773e2662c53a5e79
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-29 14:49:13 +02:00
Tor Arne Vestbø
c5ee7c8b8f Move main window example to manual test
Pick-to: 6.5 6.6
Change-Id: I7d9281f173ce9fb24c0f565797b6fbcfba10459f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-29 14:49:13 +02:00
Tor Arne Vestbø
4b79834e1a Move MDI example to manual test
Pick-to: 6.5 6.6
Change-Id: Ide698a171a4600cb4bac6574b6be74c17f779051
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-29 14:49:13 +02:00
Tor Arne Vestbø
cd7995de57 Move windowcontainer example to manual test
Pick-to: 6.5 6.6
Change-Id: I68b866bcc2659b90aad2c10dc06240674bf4a826
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2023-06-29 03:13:10 +02:00
Carl Schwan
604b2feca7 Modernize EditableTreeModel
- 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>
2023-06-28 23:54:11 +00:00
Carl Schwan
25027444a9 Modernize SimpleTreeModel example
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>
2023-06-28 19:26:45 +00:00
Amanda Hamblin-Trué
0644f8e63a Revamp bindable subscription example
Silence a bogus warning.

Pick-to: 6.6 6.5
Task-number: QTBUG-114689
Change-Id: I7267b752e780b0c48cc57a513d12ad504e4c7a30
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-06-28 15:19:45 +02:00
Tor Arne Vestbø
ec01f6ae8b Move movie example to manual test
Pick-to: 6.5 6.6
Change-Id: Ie185a3c88eced7b8b0fe324b9ef62ab86d38d521
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-28 14:05:41 +02:00
Tor Arne Vestbø
c7702638f3 Move pinch zoom example to manual test
Pick-to: 6.5 6.6
Change-Id: I0632a839ef069e13a8b859a22f47be2e7423ffb0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-28 14:05:41 +02:00
Tor Arne Vestbø
e00d8aa6a8 Move validators example to manual test
Pick-to: 6.5 6.6
Change-Id: Ic91bc89422fb23e3782db69bab2953e7cf8ddf69
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-28 14:05:41 +02:00
Tor Arne Vestbø
a18c55e738 Move item views puzzle example to manual test
Pick-to: 6.5 6.6
Change-Id: Idbb4222861be86275a86f731e75127b8496a08a7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-28 12:05:41 +00:00
Tor Arne Vestbø
645e011d7d Move interview example to manual test
Pick-to: 6.5 6.6
Change-Id: I06c77672c3ca08dfd3e50af25ed3e1669462259a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-28 14:05:40 +02:00
Tor Arne Vestbø
b8f588bea7 Move image viewer example to manual test
Pick-to: 6.5 6.6
Change-Id: I4b64033f1a075681ce5b918fdf2e018ad05a7869
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-28 14:05:40 +02:00
Amanda Hamblin-Trué
19b0800555 QBindable example: Replace SpinBox connection with QBindable
Made this change because there was no example of the interaction
between QBindable and non-bindable properties.

Pick-to: 6.6 6.5
Task-number: QTBUG-114689
Change-Id: Ief7662f8af5e6fab32491418fa35f0daa937819d
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-06-28 11:13:16 +00:00
Tor Arne Vestbø
c3fd8e911e Move icons example to manual test
Pick-to: 6.5 6.6
Change-Id: I08f44448f96a61f780c21d628954879c7b28dce3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-28 09:56:40 +02:00
Tor Arne Vestbø
95595d68be Move graphis view flow layout example to manual test
Pick-to: 6.5 6.6
Change-Id: I713816114b87def9eab79b893d13554f1c37c6a5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-28 09:56:40 +02:00
Tor Arne Vestbø
532e1c9bf6 Move fridge magnets example to manual test
Pick-to: 6.5 6.6
Change-Id: I6e40aff63f24dc98ab6b84450d288159f036142b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-28 09:56:40 +02:00
Tor Arne Vestbø
917282ea53 Move font sampler example to manual test
Pick-to: 6.5 6.6
Change-Id: I696d9be26edfaadd40579884930b2f061d308a06
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-28 09:56:39 +02:00
Tor Arne Vestbø
0b6f5ae131 Move finger paint example to manual test
Pick-to: 6.5 6.6
Change-Id: I26eec035eaa78eac2aa96de72ae38093bc08fd23
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-28 09:56:39 +02:00
Tor Arne Vestbø
9a320b037c Move fade effect example to manual test
Pick-to: 6.5 6.6
Change-Id: I7f4e1d9b57be2d0ef22eb56d5d1f7abc5074ebae
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-28 00:09:59 +02:00
Tor Arne Vestbø
7b4b5c839b Move embedded dialogs example to manual test
Pick-to: 6.5 6.6
Change-Id: I86213aa47def7ebacaa9465a0200cef10871706e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-28 00:09:59 +02:00
Tor Arne Vestbø
76ba4a0422 Move dynamic layouts example to manual test
Pick-to: 6.5 6.6
Change-Id: I34288b2b22cbbfb3b77870f0c71778bcf3d552fb
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-28 00:09:58 +02:00
Tor Arne Vestbø
cefb1c9ca9 Move drag and drop puzzle example to manual test
Pick-to: 6.5 6.6
Change-Id: I859cdb2cf74cd6272c29924c77dab26b4f4c0b6c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-28 00:09:58 +02:00
Tor Arne Vestbø
35063254fd Fix missing references to 'Qt Widgets - Application Example'
Amends eda71105ff

Pick-to: 6.5 6.6
Change-Id: I44fa9acef37667d635d5770ce5d50fc52d92aa88
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2023-06-27 17:39:23 +02:00
Tor Arne Vestbø
71f156fff0 Fix qdoc link warnings after moving a few examples to manual tests
Pick-to: 6.5 6.6
Change-Id: I81a6e9d52e858c3f733d4c527c70408772813b56
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-27 17:39:23 +02:00
Tor Arne Vestbø
2a65849e10 Move dock widgets example to manual test
Pick-to: 6.5 6.6
Change-Id: I23ca3f2450df8f6c71509235ccec655d88d0d6d7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-26 23:15:02 +02:00
Tor Arne Vestbø
fc0e82f58a Move dirview example to manual test
Pick-to: 6.5 6.6
Change-Id: I9057d5efb1cdf3e425e879f8cc96a544c1892e77
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-26 23:15:02 +02:00
Tor Arne Vestbø
65e7303ec9 Move digital clock example to manual test
Pick-to: 6.5 6.6
Change-Id: I043c0060a71d9de2f3e74aab0759d07a20880c3a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-26 23:15:02 +02:00
Tor Arne Vestbø
e46fb69a87 Move chart example to manual test
Pick-to: 6.5 6.6
Change-Id: I95a40834853a0157d8fa6137431bfd86ce855b2f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-26 23:15:02 +02:00
Tor Arne Vestbø
3a8265a429 Move character map example to manual test
Pick-to: 6.5 6.6
Change-Id: Ie27fe436fc7ae7774beaa78f8a27f6009027753a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-26 23:15:01 +02:00
Tor Arne Vestbø
288c7ef557 Move calendar example to manual test
Pick-to: 6.5 6.6
Change-Id: Ie2215ae0feeb322888619aed632e20db9b69e20b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-26 23:15:01 +02:00
Tor Arne Vestbø
42b58f8cb4 Move border layout example to manual test
Pick-to: 6.5 6.6
Change-Id: I3f45043a64275f8678288e1d9839271eafa1fd2b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-26 20:47:45 +02:00
Tor Arne Vestbø
6c96218b43 Move qpa examples to manual tests
Pick-to: 6.6 6.5
Change-Id: I7b25b1c8100f04eec3d9a571f59a1babef55b1d5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-26 20:47:45 +02:00
Tor Arne Vestbø
f4a80552c2 Move permissions example to manual test
Pick-to: 6.5 6.6
Change-Id: If7482ff20079d91ddba26a1abcb06b3054cc72ad
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-06-26 18:45:25 +02:00
Amanda Hamblin-Trué
ce39beea0c Revamp Bindable Properties Example
The use of Q_ASSERT(false) is bogus as we don't need to test here, but
want to signal unreachability.
Q_UNREACHABLE_RETURN allows us to tell the compiler that the point
can't be reached while also getting rid of the no return error.

Task-number: QTBUG-114689
Pick-to: 6.6 6.5
Change-Id: I007cd243055237bcc21772a4130a6c1a44fd882d
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-06-26 12:16:25 +02:00
Mårten Nordheim
1a9ba8ee7d Network-chat example: Remove unused constant
Change-Id: I29768a38136af026c8613a47adea390f11ff46a9
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-06-22 16:04:42 +02:00
Mårten Nordheim
0471df7987 Network-chat example: Only disconnect if still connected
If we are already disconnected we end up printing warnings about how it's
illegal to call waitForBytesWritten on an unconnected socket

Change-Id: I8c864d105d5372edfee84affb362cca3021b8ea0
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-06-22 16:04:42 +02:00
Laszlo Agocs
204c91c971 rhiwindow example: Make -g option (OpenGL) work on macOS
Of course we managed to rely on a GLSL feature that is only
in GLSL 130 and newer, not 120 which is what the default 2.1 OpenGL
contexts support on macOS.

Change-Id: Ib75e750ea15d59e51b2207669068fba7719a48b1
Pick-to: 6.6
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2023-06-21 15:09:03 +02:00
Mikolaj Boc
7022d0e223 Replace QDialog::exec() with open() in text edit example
On WASM, the shortcut triggering the dialog in textedit example
seemingly lets the event invoke the default action. What really happens
is that the dialog's exec() does not return and WASM does not have a
chance to set preventDefault() on the keyboard event it receives. This
masks other problems with keyboards shortcuts.

Uses of exec() on message boxes were replaced, too. Closing operation
is now performed in two steps, first the event is ignored and maybeSave
is called to query for potential changes of the text document.
If there are no changes or the file is discarded, the close continues
with a second event, now accepted.

PrintDialog::exec(), QPrintPreviewDialog::exec(), QFileDialog::exec()
were also eliminated in favor of open().

Finally, indirect calls to exec() via QColorDialog::getColor were
removed.

Task-number: QTBUG-76587
Change-Id: Ia90fad46ec3f94244723512be3ec93b64df9d9ef
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
2023-06-20 07:28:42 +01:00
Tor Arne Vestbø
14f31bf16e Add missing QApplication include in streambookmarks example
Amends 3ccf2f8308.

Pick-to: 6.5 6.6
Change-Id: Ib51777ef9af44aff7fbb813b58eb0fbb74761373
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-17 14:02:04 +02:00
Edward Welbourne
3ccf2f8308 Examples: "About &Qt" should show info about Qt, not quit
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.

Pick-to: 6.6 6.5
Task-number: QTBUG-111228
Change-Id: I1887a3c999d752a24c7c4d3cabc4a5d63b29b966
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2023-06-16 21:37:11 +02:00
Edward Welbourne
59d2869765 Core examples: consistent #include order
Pick-to: 6.6 6.5
Task-number: QTBUG-111228
Change-Id: I014a895a8abeccc9d17b68fb67c00cea22957fed
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2023-06-16 21:37:11 +02:00
Friedemann Kleint
408fbd3f2d QMessageBox: Remove include of qdebug.h
Move the implementation qRequireVersion() to prevent having
to include qdebug.h which pulls in many other headers.

Amends b5d874e36f.

Fix missing include introduced by
3a553507a1.

Pick-to: 6.6
Task-number: QTBUG-114214
Task-number: QTBUG-97601
Change-Id: Iba68ffca95061666d9458ffa5700d07c7669da5b
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-06-16 19:42:12 +02:00
Topi Reinio
ebc371de0d Doc: RSS listing example: Fix file quoting
The example was moved to qtnetwork but its documentation
still referred to old paths under /examples/corelib.

Add documentation dependency to qtwidgets as RSS listing
example's docs link to a number of widget classes.

Pick-to: 6.6 6.5
Change-Id: Ief1c9dc2ca38ba3da1fe3039500292147ec4cc7d
Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
2023-06-15 11:34:17 +00:00
Edward Welbourne
e54a7c5667 Move RSS listing example to networking
It's really showing how to request a resource and act on its becoming
available. The use of XML to do so is incidental; the use of
networking is central.

Pick-to: 6.6 6.5
Task-number: QTBUG-111228
Change-Id: Ibcf438c7ef3b2464ddfa8b96a79fb15523e4a468
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-06-14 11:57:31 +02:00
Edward Welbourne
4b6986db32 Do XBEL example's last !QT_NO_... -> QT_CONFIG()
Amends commit 723e331f0a

Pick-to: 6.6 6.5
Task-number: QTBUG-111228
Change-Id: Ib9a094ab432a80b8b2dbbbecb497dca13d23a553
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2023-06-14 11:57:13 +02:00