Commit Graph

2120 Commits

Author SHA1 Message Date
Rym Bouabid
81857ad5c3 Revamp MIME Type Browser Ex: Fix too long lines
Fix code lines that do not respect the 100 characters limit rule.

Task-number: QTBUG-117146
Pick-to: 6.6 6.5
Change-Id: I9833e9a25a09833b3e0384c95af8a422d5aa4582
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-09-22 20:21:22 +02:00
Kai Köhne
f2ec221bd6 Make examples/bindableproperties a proper project
Both executables (subscription, bindablesubscription) are documented
as one project. Make sure that e.g. Qt Creator can also load this
project.

Fixes: QTBUG-117109
Pick-to: 6.5 6.6 6.6.0
Change-Id: I3912f2f76379940b02f3a57a7a55440a30366755
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-09-22 11:24:16 +02:00
Kai Köhne
802db7b523 Move rsslisting documentation to common dir
Move the rsslisting example documentation to examples/network/doc,
as it is done for all the other examples.

Fixes: QTBUG-117215
Pick-to: 6.5 6.6
Change-Id: If83202825afe8c69cb7fda0f84ca4832cf3d60e7
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-09-21 19:29:20 +00:00
Nicholas Bennett
e7847a3258 Docs: Update Links to Android Notifier Example
Added to the list of important links on the Android Platform home page.

Task-number: QTBUG-116780
Pick-to: 6.2 6.5 6.6 6.6.0
Change-Id: Id65a73d56bff0b288ebb1da098f6dbd8cbbe606e
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2023-09-21 17:28:43 +00:00
Rym Bouabid
badb0818f5 Revamp Local Fortune Client Example: Create QString instead of char *
Create QString at compile time using the literal operator""s instead of
using pointer to characters. This way, no conversion or allocation will
occur at runtime.

Task-number: QTBUG-117036
Pick-to: 6.6 6.5
Change-Id: I9942ef8efa38de9ac5975799249a65fcb4c966c9
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-09-20 20:36:31 +02:00
Rym Bouabid
b83736be05 Revamp Local Fortune Client Example: Fix include order
Fix include order to respect the Coding Conventions.

Include individual headers instead of "generic" headers.

Remove QT_{BEGIN,END}_NAMESPACE because these are private Qt macros that
should not be used in the examples.

Task-number: QTBUG-117036
Pick-to: 6.6 6.5
Change-Id: I33f9c54098824bfcfacac7c2f624554e105a291a
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-09-20 20:36:31 +02:00
Friedemann Kleint
62eaaeb4f5 hellogl2 example: Decouple mainwindow from window
The circular dependency cannot be ported to the corresponding Python
example.

Task-number: PYSIDE-2206
Pick-to: 6.6 6.5
Change-Id: I031b3fffdd7bd677d2fc55e132975a65f66ad128
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2023-09-18 22:45:36 +02:00
Friedemann Kleint
6f8398c8eb hellogl2 example: Streamline code
- Shorten menu code, add keyboard shortcuts and a quit action.
- Avoid calls to setLayout().
- Pass a parent to message boxes.
- Use the current screen for size calculation and consider
  availableGeometry().
- Prevent closing by the Escape key in docked mode.
- Split the dockUndock() function into dock()/undock() for clarity

Pick-to: 6.6 6.5
Change-Id: I007da3bff86ee3f2dc8f87379e5d2ba2f0f6f3d7
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2023-09-18 22:45:36 +02:00
Edward Welbourne
ccd59b2d4f Check input and output converters do support the relevant directions
It was previously possible to select an input-only converter for
output or an output-only converter for input. Also add a comment to
explain why failure to probe for the auto output converter isn't an
error, where failure to probe for the auto input converter is.

Pick-to: 6.6 6.5
Task-number: QTBUG-111228
Change-Id: I17dfbbee7d8b5a9629e66d0e1a6a4014b01a7262
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
2023-09-15 21:53:36 +02:00
Edward Welbourne
b9787a3985 Replace the image to illustrate the Serialization Converter
The old image wasted a log of space, was poorly legible and showed
little more than the cbordump example's illustration shows. Make
explicit that we get an initial CBOR file from savegame, show how it
can be converted to and from XML (idempotently) and still find space
to show the same thing as before. All more legibly and in a smaller
file.

Pick-to: 6.6 6.5
Task-number: QTBUG-111228
Change-Id: Ifc599d0dd646f136ccd2860ca927186d478b0fb9
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
2023-09-15 21:53:36 +02:00
Rym Bouabid
dcc0844056 Revamp Wait Conditions Example: Revisit the documentation
Change the title.

Remove the first \brief as there are two briefs in the document
so that the new title makes sense with the second brief in
"All Qt Examples" doc page.

Task-number: QTBUG-108860
Pick-to: 6.6 6.5
Change-Id: I1dec2ad107e3f9ff9b4203960ba54ae6d0d8c7b6
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Jaishree Vyas <jaishree.vyas@qt.io>
2023-09-13 20:45:18 +02:00
Rym Bouabid
0132ad0fde Revamp Shared Memory Example: Revisit the documentation
Remove "Example" from the title.
Extend the \brief.

Task-number: QTBUG-108858
Pick-to: 6.6 6.5
Change-Id: Ie8bd0c808503861027f80493c430e8ac1baada5f
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-09-13 20:45:17 +02:00
Rym Bouabid
976f30dc59 Revamp Shared Memory Example: Change the used QSharedMemory constructor
Use QSharedMemory(const QNativeIpcKey &key) constructor to port away
from the deprecated QSharedMemory(const QString &) constructor.

Task-number: QTBUG-108858
Pick-to: 6.6
Change-Id: I05615100f77f571fe32a3cf627c3df46baaa7f7a
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-09-13 20:45:17 +02:00
Rym Bouabid
0a62d4e4c0 Revamp Shared Memory Example: Fix formatting of the dialog.h header
"dialog.h" has inconsitent indentation.

Task-number: QTBUG-108858
Pick-to: 6.6 6.5
Change-Id: Id029d5ec63f3831e5ffcfe2b61d7e86896d4afb5
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-09-13 20:45:17 +02:00
Rym Bouabid
70815d31fe Revamp Semaphores example: Revisit the documentation
Change the title.

Remove the first \brief as there are two briefs in the document
so that the new title makes sense with the second brief in
"All Qt Examples" doc page.

Task-number: QTBUG-108859
Pick-to: 6.6 6.5
Change-Id: I8b0370c9a85179e172918231ae48a3c52845bf21
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-09-13 20:45:17 +02:00
Rym Bouabid
8643b52467 Revamp Shared Memory Example: Fix include order
Fix include order to respect the Coding Conventions.

Task-number: QTBUG-108858
Pick-to: 6.6 6.5
Change-Id: Ifecf7c60ca7135104631587b25e907cb1d39e25b
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-09-13 20:45:17 +02:00
Rym Bouabid
c4a1c171a3 Revamp Semaphores example: Replace const by constexpr when applicable
Replace const by constexpr when the value of the variable can be
calculated at compile-time.

Fixes: QTBUG-108859
Pick-to: 6.6 6.5
Change-Id: I4abf5162d521fc5dca0286a6254f86c57a473367
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-09-13 20:45:17 +02:00
Rym Bouabid
2a2275756b Revamp Mandelbrot example: Declare slots as methods instead
Declare zoom as a method because it's never used as a slot.

Declare updatePixmap as a method because it's used as a slot
as pointer-to-member-function, so it doesn't need help from moc.

Q_OBJECT is not needed anymore as the MandelbrotWidget class
doesn't contain signals ans slots anymore. It's replaced by
Q_DECLARE_TR_FUNCTIONS because we are using tr() function.

Fixes: QTBUG-108861
Pick-to: 6.6 6.5 6.6.0
Change-Id: I9a1d66711cdc9f0ca5a1bc6645f7e0ed3395645c
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-09-13 20:45:17 +02:00
Rym Bouabid
73a1ae6ea9 Revamp Mandelbrot example: Revisit the documentaton
Remove "Example" from the title.

Edit the link (title) to the documentation of Mandelbrot in QThread
documentation.

Delete the foreach related sentence as we are trying to port away from
this Qt pseudo-keyword.

Task-number: QTBUG-108861
Pick-to: 6.6 6.5 6.6.0
Change-Id: I6d04f24ac9c1fa1efe30a947c2da2ec7475edc80
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-09-13 20:45:16 +02:00
Rym Bouabid
7903a52d46 Revamp Mandelbrot example: Add const/constexpr when applicable
Add const in front of local variables when applicable.

Replace const by constexpr when the value of the variable can be
calculated at compile-time.

Task-number: QTBUG-108861
Pick-to: 6.6 6.5 6.6.0
Change-Id: I2cd1bc97aaa07d6d564731d9ccddba9a74e96fef
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-09-13 20:45:16 +02:00
Rami Potinkara
bbf0022d99 Update mobile example categories for Qt 6.6
Add mobile example category tags for the chosen examples.
Add for the ones that work best for both, Android and iOS.
Remove from the ones that do not work for both (at least yet).

Added
- hellogles3
Removed
- qtandroidnotifier (not iOS)

Fixes: QTBUG-116780
Pick-to: 6.6
Change-Id: Icb4c7ba1f22d4e67089a565071d83cdf8ec95896
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2023-09-12 00:44:11 +00:00
Edward Welbourne
e67f030600 Make \brief of Saving a Game to File actually brief
Specifically, prune it to fit on a single line.
Much of what it was saying was implicit in its context already.
It also neglected to mention CBOR's part in the story.

Pick-to: 6.6 6.5
Task-number: QTBUG-111228
Change-Id: I161a345cbbea8b706490fcbbadecd01b8946af31
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2023-09-11 17:56:51 +02:00
Topi Reinio
c46551e203 Doc: Fix documentation issues
Fix the following QDoc warnings:

* warning: Can't link to 'QRhiWidget::sampleConut'
* warning: Can't link to '`Q_NODISCARD_CTOR'
* warning: Invalid '\relates' (already a member of 'QEventLoopLocker')
* warning: Unknown command '\relatesalso'
* warning: Undocumented parameter 'separator' in QLocale::name()
* warning: clang couldn't find function when parsing \fn void QRhiWidget::framePresented()

In QAtomicPointer, work around the issue of QDoc not supporting
multiple \relates command for a single topic by adding a see-also
link to the global qYieldCpu() function.

Document the qvariant_cast() overload taking an rvalue reference.

Change-Id: I2528eee666149a97a14be059bbed537636d7aa0d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-09-11 15:56:10 +00:00
Rym Bouabid
36c2a9c514 Revamp Mandelbrot example: Fix too long lines
Fix code lines that do not respect the 100 characters limit rule.

Task-number: QTBUG-108861
Pick-to: 6.6 6.5
Change-Id: Idbc148b77b52a359d972233c977bbf2ccf9fcd24
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-09-11 15:05:47 +02:00
Rym Bouabid
ae0d545d31 Revamp Mandelbrot example: Use a Literal operator to create QString
Create QString at compile time using the literal operator""s instead of
using pointers to characters. This way, no conversion or allocation will
occur at runtime.

Task-number: QTBUG-108861
Pick-to: 6.6 6.5
Change-Id: I4fb51d74abbbfa08fb9fddfa90d8afcebd82a7e2
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-09-11 15:05:47 +02:00
Rym Bouabid
a4d7a4ccb3 Revamp Mandelbrot example: Fix Includes
Reorder the includes following the coding conventions.

Remove unneeded includes.

Add needed includes to avoid Transitive includes.

QGestureEvent is passed by a pointer in the gestureEvent method in
mandelbrotwidget.h. So, we do not really need to include the header.
Instead, forward-declare QGestureEvent class in a namespace.

Task-number: QTBUG-108861
Pick-to: 6.6 6.5
Change-Id: I48cfd663bf98350281ef7f31e6c0ef3e301a08ca
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-09-11 15:05:47 +02:00
Edward Welbourne
e53d0220da Turn Directions enum into an enum class in serialization converter
Pick-to: 6.6 6.5
Task-number: QTBUG-111228
Change-Id: Ie1f8ea5e2575427528c19875db7a8e4e27200aec
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-09-08 18:17:37 +02:00
Edward Welbourne
ad63118071 Turn Converter::Direction into a QFlags enum
This lets us testFlag() instead of using raw bit-field operations.

Pick-to: 6.6 6.5
Task-number: QTBUG-111228
Change-Id: I2c26e9a24728e81baa42cf14c75271a015460913
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-09-08 18:17:37 +02:00
Edward Welbourne
77fdd21cbf Serialization converter example: const-ify the Converter type
Its methods act on their parameters without changing the converter, so
can all be const. Its instances thus have no non-const members to
exercise, so can always be const.

Pick-to: 6.6 6.5
Task-number: QTBUG-111228
Change-Id: Ifcdb2f2159c2cfcd7998dd118aa327a32d299ccf
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-09-08 18:17:37 +02:00
Edward Welbourne
eaebb5c4d2 Separate streaming dumper and converter in the convert example
The two were in the same files but mostly unrelated to one another -
aside from the converter defaulting to the dumper for output.
Furthermore, the dumper actually uses QDebug and QTextStream, not
QDataStream; rename it to reflect this reality.

Pick-to: 6.6 6.5
Task-number: QTBUG-111228
Change-Id: Id65c120c319b555039f7fd186ed262f35ff5260a
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-09-08 18:17:37 +02:00
Edward Welbourne
d8517fb1ab corelib/serialization examples: clang-tidy and coding style clean-up
I overrode clang-tidy where it uglified or obfuscated and did some
clean-up provoked or made possible by its changes. Konrad pointed out,
in review, a constructor that could be = default; it could, in fact,
vanish entirely as a result.

Pick-to: 6.6 6.5
Task-number: QTBUG-111228
Change-Id: I9b7744a3abaa29e6f9e0689d0f6985bfd88cd0fd
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
2023-09-08 18:17:37 +02:00
Edward Welbourne
319b2e0e86 corelib/serialization examples: use string literals more
A couple more compilation units could use Qt::StringLiterals. Prefer
QL1SV for the code constants, to keep code small. Convert fpToString()
to take QL1SV instead of const char *, with suffix empty by default.
Also rearranged some spacing, some if it suggested by clang-tidy.

Pick-to: 6.6 6.5
Task-number: QTBUG-111228
Change-Id: I03d810d52afcd4a760d18f2553914b75af716b74
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2023-09-08 18:17:36 +02:00
Ahmad Samir
09b852b1d8 examples/: compile with QT_NO_CONTEXTLESS_CONNECT
Examples are usually a good way to get to know a new codebase, do not
teach developers who are new to Qt about the 3-arg connect() to begin
with.

Drive-by changes:
- `this` can't be implicitly captured with [=] in a lambda, instead
  capture by reference
- Update docs related to the sqlbrowser example; the overloaded signal
  it mentions has been removed in Qt6
- In the sqlbrowser example, rename addConnection() (no-arg) overload to
  openNewConnectionDialog, suggested in code review

Change-Id: I30c9f35bda4ac2f460d767ab7f84422ae3ed09f7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-09-08 19:17:36 +03:00
Safiyyah Moosa
a1d308a316 Doc: Add \examplecategory for qtconcurrent
Task-number: QTBUG-116071
Pick-to: 6.5 6.6
Change-Id: I7413a0d8085eec38e6480f6aa21c85620ca68f54
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2023-09-07 15:05:04 +02:00
Andreas Eliasson
ebd87ce2e5 Doc: Fix qdoc full stop warning in briefs
Add a full stop to the briefs to clear the following qdoc warnings:

* multistreamclient.qdoc: '\brief' statement does not end with
  a full stop.
* multistreamserver.qdoc: '\brief' statement does not end with
  a full stop.

Change-Id: If0e58bc100a595f3ee00c79c31ac19f8d9ee3ad9
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-09-05 21:14:59 +00:00
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