Commit Graph

1974 Commits

Author SHA1 Message Date
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
Friedemann Kleint
3a553507a1 Brush up the DOM bookmarks example
- Use modern string literals (use QStringLiteral instead of
  QLatin1StringView for strings that go into the DOM API).
- Use mime types in the file dialog handling
- Streamline code
- Remove mentions of SAX
- Use per class includes
- Do not use QObject::tr()
- Use the configure system instead of QT_NO... defines
- Fix some doc text typos

Complements 3dd3268ded.

Pick-to: 6.6 6.5
Task-number: QTBUG-111974
Change-Id: If0dc7b61e729d0a71f37743efc9b82e285d3f451
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-06-13 01:51:10 +02:00
Friedemann Kleint
723e331f0a XBEL stream reader: Brush up
- Use mime types in the file dialog handling
- Use per class includes
- Use the configure system instead of QT_NO... defines

Pick-to: 6.6 6.5
Task-number: QTBUG-111228
Change-Id: Iea915604e89d3005270f0eb83eca882855589a44
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-06-13 01:51:10 +02:00
Volker Hilsheimer
b908c5cf28 Move scroller/graphicsview example into tests/manual
The example seems incomplete, is undocumented (and unused in shippets,
in spite of tags being present), and generally full of comments that
give the impression that this is for manual testing rather than showing
best practices.

Pick-to: 6.5 6.6
Change-Id: Ie615420e493cc6bb461c5d9ff8d4ae82bb3591db
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2023-06-12 21:22:36 +02:00
Volker Hilsheimer
a89f575be3 Move storageview example into tests/manual
The code is mostly an implementation of a model based on QStorageInfo,
shown in an otherwise uninteresting tree view.

Pick-to: 6.5 6.6
Change-Id: Id6ce70d71ddc9bcd6e82a9ee12f5e1af159eac7a
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2023-06-12 21:22:36 +02:00
Volker Hilsheimer
ce13dc8c2f Remove flattreeview example
The relevant bits are a two-line snippet.

Pick-to: 6.6 6.5
Change-Id: Id1731e5bc6585b1d1fd684817b39d19ad0a8a9cc
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2023-06-12 21:22:36 +02:00
Edward Welbourne
97f68cd306 XBEL examples: construct the text of the separators cleanly
Create the fixed string once and reuse it. Also give a name to the
escape code that's its repeated character.

Pick-to: 6.6 6.5
Task-number: QTBUG-111228
Change-Id: I3d6416070f1d5490ec137e251daff0e1637fb788
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-06-12 15:46:14 +02:00
Edward Welbourne
b610c7aa89 XBEL stream reader: shuffle order of functions
Put readBookmark() first of the constituent parts, as it's the most
intelligible (albeit currently undocumented) and gives some clue to
the purpose of readTitle(), which is next.

Pick-to: 6.6 6.5
Task-number: QTBUG-111228
Change-Id: I91d3d6bf8adc3f3001c90274bb62a9da6bf05362
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
2023-06-12 15:46:14 +02:00
Oliver Eftevaag
fc9aae544b Dialogs example: add checkbox for ColorDialogOption::NoEyeDropperButton
If we wish to introduce a new color dialog option, then we might as well
use it in our example.

Change-Id: I7771d9d50e2ab0489fbeece8dea38a0b72b9b21e
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-12 15:11:26 +02:00
Topi Reinio
17ddf2a6a5 Doc: Fix documentation issues
The Qt Widgets Application example was moved to manual tests,
and no longer contains the snippet identifiers. Fix \snippet
and \quotefile commands to quote similar code snippets from
other examples or snippet files.

Fix also the following documentation warnings:

* No such parameter 'parsingMode' in QUrl::fromEncoded()
* Missing image: rsslisting.cpp

Pick-to: 6.6 6.5
Change-Id: Ibc989e83abc49837db08628facaf8e5f72b2f123
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-06-09 18:24:15 +00:00
Edward Welbourne
8e1b60b331 There is no frank.xbel so don't tell qmake to find it
Both the DOM and XML stream versions of the XBEL bookmarks example had
a frank.xbel in their EXAMPLE_FILES, but there is no such file. So
asking qmake to include it is spurious.

Pick-to: 6.6 6.5
Task-number: QTBUG-111228
Change-Id: Iec08042d181fc09c2c428685ce841a13161ab273
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-06-09 14:05:06 +02:00
Edward Welbourne
202b1dca5d XBEL example - modernize strings: use "..."_L1 for literals
The XML stream reader and writer accept QAnyStringView arguments these
days, so passing a QLatin1StringView is entirely sufficient. This
makes static functions to provide access to unique QString instances
redundant. Linkers are allowed to uniquify the literals the "..."_L1
reference.

Pick-to: 6.6 6.5
Task-number: QTBUG-111228
Change-Id: I7f37e97631e11683b9ddd3842fc6233547bed5ff
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-06-09 14:05:06 +02:00