summaryrefslogtreecommitdiffstats
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
...
* Revamp Wait conditions exp: Add \examplecategory Data Processing & I/ORym Bouabid2023-10-051-0/+1
| | | | | | | Fixes: QTBUG-108860 Pick-to: 6.6 6.5 Change-Id: I2ccf20f42d5abaa22e2daf4c8e7777ff903d947e Reviewed-by: Ivan Solovev <[email protected]>
* Revamp Semaphores example: Add \examplecategory {Data Processing & I/O}Rym Bouabid2023-10-051-0/+1
| | | | | | | Fixes: QTBUG-108859 Pick-to: 6.6 6.5 Change-Id: I0fecf50e95c351564e7e41142cd3d385c4d1d867 Reviewed-by: Ivan Solovev <[email protected]>
* Revamp Mandelbrot example: Add \examplecategory {Data Processing & I/O}Rym Bouabid2023-10-051-0/+1
| | | | | | | Fixes: QTBUG-108861 Pick-to: 6.6 6.5 Change-Id: Ie622a94072e243eb5d3f6c162e490884d4cdd0f2 Reviewed-by: Ivan Solovev <[email protected]>
* Remove Custom Type Example and Custom Type Sending ExampleRym Bouabid2023-10-0415-484/+1
| | | | | | | | | | | | | | | | | | | | | The whole Q_DECLARE_METATYPE part is superfluous in these two examples, as QVariant works with any type as long as it is copy-constructible. And QVariant will call the equivalent of qRegisterMetaType, so that doesn't need to happen, either. Showing how to integrate the type with qDebug is fine in theory, but also a repetition of content that can be found in other places. Given that there isn't much else being shown in these two examples, it's better to remove them from examples and move them to manual tests. Some parts of "Custom Type Example" were used as snippets in other documentations under qtbase/src/corelib. So, they were added in customtypeexample.cpp file in the snippets folder. Fixes: QTBUG-117001 Pick-to: 6.6 6.5 Change-Id: I45b16338912e3f7394cbb5169642bd31af32d5e1 Reviewed-by: Ivan Solovev <[email protected]>
* Doc: QtCore: Fix documentation issuesTopi Reinio2023-10-023-3/+3
| | | | | | | | | | | | | | | * Fix references to Wait Conditions Example, Semaphores Example, and MIME Type Browser Example as they were renamed. * Rename 'Shared Memory' example as its title clashes with the title of another page (sharedmemory.html). src/corelib/global/qfloat16.cpp: * warning: Invalid '\relates' (already a member of 'qfloat16') Pick-to: 6.5 6.6 Change-Id: Ia28be8e3882a7ad1fadcdbd50a657705d58526bd Reviewed-by: Andreas Eliasson <[email protected]>
* Revamp Queued Custom Type Ex: Revisit the documentationRym Bouabid2023-10-022-3/+3
| | | | | | | | | | Remove "Example" from the title. Add \examplecategory {Data Processing & I/O}. Task-number: QTBUG-117147 Pick-to: 6.6 6.5 Change-Id: Ieaab75dedb60329dcdcbbcfe6e2ad360df4d98df Reviewed-by: Ivan Solovev <[email protected]>
* Revamp Queued Custom Type Ex: Declare stopProcess() as a methodRym Bouabid2023-10-021-3/+1
| | | | | | | | | | | Declare stopProcess() as a method because it's used in the connect() overload taking a pointer-to-member-function, so it doesn't need help from moc. Task-number: QTBUG-117147 Pick-to: 6.6 6.5 Change-Id: Iaa1c02de82cffdea455af520c37dc0e6e6861443 Reviewed-by: Ivan Solovev <[email protected]>
* Revamp Queued Custom Type Ex: Add const when applicableRym Bouabid2023-10-023-12/+12
| | | | | | | Task-number: QTBUG-117147 Pick-to: 6.6 6.5 Change-Id: I2fe342fa585f8c1203fa64d2a9ceabc07070cc77 Reviewed-by: Ivan Solovev <[email protected]>
* Revamp Queued Custom Type Ex: Fix includesRym Bouabid2023-10-025-10/+28
| | | | | | | | | | | | Fix includes order and add the needed ones to avoid transitive includes. Remove QT_{BEGIN,END}_NAMESPACE because these are private Qt macros that should not be used in the examples. Task-number: QTBUG-117147 Pick-to: 6.6 6.5 Change-Id: I6caa0a59f2ab4dfec6fb558a0896c27b05b6a5db Reviewed-by: Ivan Solovev <[email protected]>
* Deduplicate code in setup of serialization convertersEdward Welbourne2023-09-281-82/+49
| | | | | | | | | | | | | | | The setup of the input and output converters is fairly complex but was made harder to read by nearly-duplicating its logic for input and for output. Break out into a separate function to make clear what parts differ between the two and what parts don't. In the process, allow the search for a named converter to continue past a match that doesn't support the needed direction, on the off chance of a name collision. Make an error message more articulate in the process. Pick-to: 6.6 6.5 Task-number: QTBUG-111228 Change-Id: I2a9de8b406c538098076f388fc8a1980b91fe16b Reviewed-by: Mårten Nordheim <[email protected]>
* Move Calendar Widget Example to UI Components categoryKai Köhne2023-09-271-1/+1
| | | | | | Pick-to: 6.6 6.6.0 6.5 Change-Id: Iafa05fbfde41dbbf7ddffd667983db9cc1c6e184 Reviewed-by: Mats Honkamaa <[email protected]>
* Doc: Fix typo in examplecategory commandAndreas Eliasson2023-09-261-1/+1
| | | | | | | | | This resolves (qdoc) warning: Unknown command '\examplecateogry' Pick-to: 6.6 6.5 Change-Id: I52c417bde49ce52089da485d6144f64d636f5a3b Reviewed-by: Venugopal Shivashankar <[email protected]>
* Revamp Local Fortune Client/Server Ex: Update the QDataStream's verRym Bouabid2023-09-262-2/+2
| | | | | | | | | ... from Qt5.10 to Qt.6.0 Task-number: QTBUG-117036 Pick-to: 6.6 6.5 Change-Id: I47983b74d1001fa2e2cd278edda3d78430b97b45 Reviewed-by: Ivan Solovev <[email protected]>
* Revamp Local Fortune Server Example: Revisit the documentationRym Bouabid2023-09-262-2/+3
| | | | | | | | | | Remove "Example" from the title. Add \examplecategory {Connectivity}. Task-number: QTBUG-117064 Pick-to: 6.6 6.5 Change-Id: I53c106f3429d5fe31ca7a8e8b821e4c1cafdda64 Reviewed-by: Ivan Solovev <[email protected]>
* Revamp Local Fortune Server Example: Declare sendFortune() as a methodRym Bouabid2023-09-261-4/+3
| | | | | | | | | | | | | | | Declare sendFortune() as a method because it's used in the connect() overload taking a pointer-to-member-function, so it doesn't need help from moc. Q_OBJECT is not needed anymore as the "Server" class doesn't contain signals and slots anymore. Use Q_DECLARE_TR_FUNCTIONS Macro to allow tr() calls. Task-number: QTBUG-117064 Pick-to: 6.6 6.5 Change-Id: Id197cb4c9f9df2102b769d028d8a0cae91e5c492 Reviewed-by: Ivan Solovev <[email protected]>
* Revamp Local Fortune Server Example: Fix includesRym Bouabid2023-09-263-10/+10
| | | | | | | | | | | | | | | | Fix include order to respect the Coding Conventions. Add needed includes to avoid Transitive includes. Remove uneeded classes. Remove QT_{BEGIN,END}_NAMESPACE because these are private Qt macros that should not be used in the examples. Task-number: QTBUG-117064 Pick-to: 6.6 6.5 Change-Id: Ie98d4fbddb18d5578e2651bdb4850527ff984582 Reviewed-by: Ivan Solovev <[email protected]>
* Revamp Local Fortune Client Example: Revisit the documentationRym Bouabid2023-09-262-3/+5
| | | | | | | | | | Remove "Example" from the title. Add \examplecategory {Connectivity}. Task-number: QTBUG-117036 Pick-to: 6.6 6.5 Change-Id: I3103669d1613e9832190b00cbe13f34ca5683ae1 Reviewed-by: Ivan Solovev <[email protected]>
* Revamp Subscription example: Cretae QString using a Literal operatorRym Bouabid2023-09-221-8/+10
| | | | | | | | | | | 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-117425 Pick-to: 6.6 6.5 Change-Id: I2a19d4fe1150aad7908d0c2a7215099bc0814e8d Reviewed-by: Ivan Solovev <[email protected]>
* Revamp Subscription example: Fix includesRym Bouabid2023-09-221-1/+2
| | | | | | | | | Add needed includes and remove uneeded includes. Task-number: QTBUG-117425 Pick-to: 6.6 6.5 Change-Id: Iec4cc7a862aa164742e502f33447fa939dfb53ae Reviewed-by: Ivan Solovev <[email protected]>
* Revamp Bindable Subscription ex: Cretae QString using a Literal operatorRym Bouabid2023-09-221-8/+10
| | | | | | | | | | | 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-117422 Pick-to: 6.6 6.5 Change-Id: I92eed0a371bf6383ddb1e938646029f1c24242bf Reviewed-by: Ivan Solovev <[email protected]>
* Revamp Bindable Subscription ex: Fix includesRym Bouabid2023-09-223-5/+4
| | | | | | | | | | | | | Reorder the includes following the coding conventions. Remove unneeded includes. Add needed includes to avoid Transitive includes. Task-number: QTBUG-117422 Pick-to: 6.6 6.5 Change-Id: Iaf2b939bc160312de8aa4035da03b648cf76f17d Reviewed-by: Ivan Solovev <[email protected]>
* Revamp MIME Type Browser Ex: Revisit documentationRym Bouabid2023-09-221-1/+2
| | | | | | | | | | Remove "Example" from the title. Add \examplecategory {Data Processing & I/O}. Task-number: QTBUG-117146 Pick-to: 6.6 6.5 Change-Id: I6004f6708299886d6423325a551a9fd03a4a57df Reviewed-by: Ivan Solovev <[email protected]>
* Revamp MIME Type Browser Ex: Replace QObject by Q_DECLARE_TR_FUNCTIONSRym Bouabid2023-09-221-1/+2
| | | | | | | | | | When declaring MimetypeModel class, use Q_DECLARE_TR_FUNCTIONS Macro instead of Q_OBJECT as we only need to call tr() functions. Task-number: QTBUG-117146 Pick-to: 6.6 6.5 Change-Id: Ic7afd4a806d57ba2a651ebe129f3a91f35764354 Reviewed-by: Ivan Solovev <[email protected]>
* Revamp MIME Type Browser Ex: Fix includesRym Bouabid2023-09-224-19/+10
| | | | | | | | | | | | Fix include order to respect the Coding Conventions. Remove QT_{BEGIN,END}_NAMESPACE because these are private Qt macros that should not be used in the examples. Task-number: QTBUG-117146 Pick-to: 6.6 6.5 Change-Id: Iba7a4726180ec97d9654ed3b934baca8c1df0b5c Reviewed-by: Ivan Solovev <[email protected]>
* Revamp MIME Type Browser Ex: Fix too long linesRym Bouabid2023-09-221-6/+8
| | | | | | | | | 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 <[email protected]>
* Make examples/bindableproperties a proper projectKai Köhne2023-09-224-81/+54
| | | | | | | | | | | | 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 <[email protected]> Reviewed-by: Alexandru Croitor <[email protected]>
* Move rsslisting documentation to common dirKai Köhne2023-09-212-0/+0
| | | | | | | | | | 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 <[email protected]>
* Docs: Update Links to Android Notifier ExampleNicholas Bennett2023-09-211-0/+1
| | | | | | | | | | 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 <[email protected]> Reviewed-by: Ville Voutilainen <[email protected]>
* Revamp Local Fortune Client Example: Create QString instead of char *Rym Bouabid2023-09-201-1/+3
| | | | | | | | | | | 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 <[email protected]>
* Revamp Local Fortune Client Example: Fix include orderRym Bouabid2023-09-203-12/+12
| | | | | | | | | | | | | | 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 <[email protected]>
* hellogl2 example: Decouple mainwindow from windowFriedemann Kleint2023-09-183-9/+16
| | | | | | | | | | 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 <[email protected]>
* hellogl2 example: Streamline codeFriedemann Kleint2023-09-183-36/+45
| | | | | | | | | | | | | | - 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 <[email protected]>
* Check input and output converters do support the relevant directionsEdward Welbourne2023-09-151-4/+7
| | | | | | | | | | | | 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 <[email protected]>
* Replace the image to illustrate the Serialization ConverterEdward Welbourne2023-09-151-0/+0
| | | | | | | | | | | | | | 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 <[email protected]>
* Revamp Wait Conditions Example: Revisit the documentationRym Bouabid2023-09-131-5/+4
| | | | | | | | | | | | | | 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 <[email protected]> Reviewed-by: Jaishree Vyas <[email protected]>
* Revamp Shared Memory Example: Revisit the documentationRym Bouabid2023-09-131-3/+3
| | | | | | | | | | 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 <[email protected]>
* Revamp Shared Memory Example: Change the used QSharedMemory constructorRym Bouabid2023-09-131-1/+5
| | | | | | | | | | 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 <[email protected]>
* Revamp Shared Memory Example: Fix formatting of the dialog.h headerRym Bouabid2023-09-131-5/+5
| | | | | | | | | "dialog.h" has inconsitent indentation. Task-number: QTBUG-108858 Pick-to: 6.6 6.5 Change-Id: Id029d5ec63f3831e5ffcfe2b61d7e86896d4afb5 Reviewed-by: Ivan Solovev <[email protected]>
* Revamp Semaphores example: Revisit the documentationRym Bouabid2023-09-131-5/+4
| | | | | | | | | | | | | 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 <[email protected]>
* Revamp Shared Memory Example: Fix include orderRym Bouabid2023-09-133-2/+5
| | | | | | | | | 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 <[email protected]>
* Revamp Semaphores example: Replace const by constexpr when applicableRym Bouabid2023-09-131-2/+2
| | | | | | | | | | 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 <[email protected]>
* Revamp Mandelbrot example: Declare slots as methods insteadRym Bouabid2023-09-131-4/+3
| | | | | | | | | | | | | | | | 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 <[email protected]>
* Revamp Mandelbrot example: Revisit the documentatonRym Bouabid2023-09-131-2/+2
| | | | | | | | | | | | | | | 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 <[email protected]>
* Revamp Mandelbrot example: Add const/constexpr when applicableRym Bouabid2023-09-132-25/+24
| | | | | | | | | | | | 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 <[email protected]>
* Update mobile example categories for Qt 6.6Rami Potinkara2023-09-122-1/+1
| | | | | | | | | | | | | | | | 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 <[email protected]>
* Make \brief of Saving a Game to File actually briefEdward Welbourne2023-09-111-2/+1
| | | | | | | | | | | | 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 <[email protected]> Reviewed-by: Paul Wicking <[email protected]>
* Doc: Fix documentation issuesTopi Reinio2023-09-111-1/+1
| | | | | | | | | | | | | | | | | | | | 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 <[email protected]>
* Revamp Mandelbrot example: Fix too long linesRym Bouabid2023-09-111-2/+4
| | | | | | | | | | 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 <[email protected]> Reviewed-by: Ivan Solovev <[email protected]>
* Revamp Mandelbrot example: Use a Literal operator to create QStringRym Bouabid2023-09-111-2/+4
| | | | | | | | | | | 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 <[email protected]>
* Revamp Mandelbrot example: Fix IncludesRym Bouabid2023-09-114-7/+7
| | | | | | | | | | | | | | | | | | 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 <[email protected]> Reviewed-by: Ivan Solovev <[email protected]>