aboutsummaryrefslogtreecommitdiffstats
path: root/doc/src/snippets/code
Commit message (Collapse)AuthorAgeFilesLines
* Doc: Unqmakify "Qt for Windows - Deployment" pageJoerg Bornemann2025-11-111-14/+8
| | | | | | | | | | Rewrite the parts of the page that were referring to QMake as the tool of choice. Favor CMake and Ninja. Pick-to: 6.10 Fixes: QTBUG-141358 Change-Id: Ie47d15b3385a25e3ce326b4e2c3b764c4333765a Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* linguist docs: deprecate //= comments in documentationMasoud Jami2025-09-151-1/+0
| | | | | | | | | | | | | The documentation on how to write source code for translation briefly mentions //= metastrings without going into details. As the functionality of //= metastrings is not fully implemented and documented, and is mostly misunderstood and misused, it's deprecated to use this metastring. Task-number: QTBUG-139769 Pick-to: 6.10 Change-Id: If8d1601ffbfeffce924db1b2a996749a4c7ef33a Reviewed-by: Kai Köhne <kai.koehne@qt.io>
* Doc: Correct signal handler HowToAxel Spoerl2024-12-191-2/+6
| | | | | | | | | Use PMF based connect syntax. Add initialization of static members, to make sure copied code compiles. Pick-to: 6.9 6.8 6.5 Change-Id: Ib531f793de0dfd2f42083a5a0a4f6dea018166ed Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Correct license for documentation filesLucie Gérard2024-03-1930-30/+30
| | | | | | | | | | | | According to QUIP-18 [1], all documentation files should be LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only [1]: https://contribute.qt-project.org/quips/18 Pick-to: 6.7 6.7.0 Task-number: QTBUG-121787 Change-Id: Idbbd9c9bc1780cf97c71398a3b118d5b371b0ca3 Reviewed-by: Kai Köhne <kai.koehne@qt.io>
* Doc: Update section on static linking on LinuxKai Köhne2024-01-141-3/+5
| | | | | | Pick-to: 6.5 6.6 6.7 Change-Id: Ia6b98f83b6757e14b5080ffab15ba9833bd97689 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Doc: Mention retranslateUi() in source code translation pageAndreas Eliasson2023-09-131-0/+11
| | | | | | | | | | When using Qt Widgets with uic, inform the user of the ui.retranslateUi function. Also, add code snippet to clarify how to use the function. Fixes: QTBUG-110846 Pick-to: 6.6 6.5 Change-Id: I67a01fe5fbda47124396792bd2198bdf908838c2 Reviewed-by: Kai Köhne <kai.koehne@qt.io>
* Mark the module as free of Q_FOREACH, except where it isn'tMarc Mutz2023-08-171-0/+2
| | | | | | | | | | | | | | | | | | | | | | The density of Q_FOREACH uses is moderate here, but too high for this author, unfamiliar with this code, to tackle in a short amount of time. But they're concentrated in just a few TUs, so pick a different strategy: Mark the whole module with QT_NO_FOREACH, to prevent new uses from creeping in, and whitelist the affected TUs by #undef'ing QT_NO_FOREACH locally, at the top of each file. For TUs that are part of a larger executable, this requires these files to be compiled separately, so add them to NO_PCH_SOURCES (which implies NO_UNITY_BUILD_SOURCES, too). NB: there are none such TUs in this module. Created QTBUG-115830 to keep track of this. Task-number: QTBUG-115830 Change-Id: I68c9394c04af68cab46480153a5601828565461a Reviewed-by: Ahmad Samir <a.samirh78@gmail.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Docs: Update code snippet to use shadow buildSafiyyah Moosa2023-06-302-48/+8
| | | | | | | | | Removed unused doc/src/snippets/code/doc_src_emb-install.qdoc file. Task-number: QTBUG-113747 Change-Id: Ic707083289417a3636b840ccedae47122eb369db Pick-to: 6.5 6.6 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Doc: Replace mentions of deprecated macrosTopi Reinio2023-05-091-25/+0
| | | | | | | | | | | | | | Q_ENUMS() and Q_FLAGS() are deprecated in favor of Q_ENUM() and Q_FLAG(). Also, remove unused code snippets that use the old macros. Pick-to: 6.5 Task-number: QTBUG-113229 Change-Id: I42c47128ddcf0073ba3493a6c59e143f0e9753c6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Kai Köhne <kai.koehne@qt.io>
* Doc: Rewrite Qt for Linux/X11 - Building from Source pageKai Köhne2023-02-201-39/+0
| | | | | | | | | | | | | | | Adapt the structure of the Windows page by first detailing where to get the sources, and explicitly listing the required build tools. Inline code snippets, and use the \QtVersion macro to give the real path instead of relying on %VERSION%. Remove some outdated information. Pick-to: 6.5 Change-Id: Ic7cc60182a9f7f08d656e12ba76af3b4f0602b95 Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
* Doc: Fix name of qt-everywhere packageKai Köhne2023-02-202-10/+10
| | | | | | | | | | We don't have dedicated opensource and commercial packages anymore since years. Pick-to: 6.4 6.5 Change-Id: I6cb19493249e7d0362a3fcb2ca30b052e874c7db Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* macOS: Update example of how to retrieve the application bundle pathTor Arne Vestbø2023-02-171-8/+2
| | | | | | | Fixes: QTBUG-110742 Pick-to: 6.5 6.4 6.2 Change-Id: Ic81ea40caf9fe6b261f2536f11fa2b460b416aaa Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* qml/i18n: Mention LanguageChange event for C++ typesFabian Kosmale2023-02-081-0/+52
| | | | | | | | | | | | | | | | | | When QQmlEngine::retranslate refreshed all bindings, that conveniently worked also for C++ properties. However, that is no longer the case since Qt 6.2, which only refreshes actual translation bindings. As bindings cannot know that a C++ setter uses a translation macro/function, there needs to be a way to inform the engine about them. Promote event handling as the recommended approach in C++ types, which aligns with what needs to be done in a Widgets application. Task-number: QTBUG-102393 Pick-to: 6.5 Change-Id: I16b91fcea35331d300fd70756de8819740b5dcb4 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Update uic documentation and command line optionsFriedemann Kleint2023-02-071-12/+0
| | | | | | | | | | | | Remove obsolete sections on Makefiles and point to the Qt Designer documentation for usage. Pick-to: 6.5 Task-number: PYSIDE-2191 Change-Id: Iaf377cd7ec4a2e1655825719b5dc8333507ef0af Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Doc: Consolidate internationalization documentationLeena Miettinen2023-01-253-36/+0
| | | | | | | | | | | | | | | | | | - Combine the "Internationalization with Qt" and "Internationalization and Localization with Qt Quick" topics - Add a "Localizing Applications" topic - Move information from the Qt Linguist Manual developer section to the new topics - Add a link to a YouTube video about localizing apps - Use active voice and present tense Fixes: QTBUG-71876 Change-Id: If2db1d4865e47a85e0b63adac326fc123ad65e50 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Kai Köhne <kai.koehne@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Remove section about translating application menus on macOSTor Arne Vestbø2022-10-211-19/+0
| | | | | | | | The information applied only to Carbon Pick-to: 6.4 Change-Id: Iee6d9e7afbd3846ed50a6030da3c1925d19a5ee4 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Replace deprecated Q_WS_MAC define with Q_OS_MACOSTor Arne Vestbø2022-10-201-1/+1
| | | | | | Pick-to: 6.4 Change-Id: If9b07fe0f04fa525249d050cb14ffbab5cc8de8b Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Use SPDX license identifiersLucie Gérard2022-06-0770-3384/+140
| | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. License files are organized under LICENSES directory. Pick-to: 6.4 Task-number: QTBUG-67283 Change-Id: Idfd176b7f7b077a5b7c66b7738dc9bcac94ab290 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Windows: Remove outdated information about VS linker & spacesKai Köhne2022-05-241-58/+0
| | | | | | | | This seems to work just fine, at least with CMake. Pick-to: 6.2 6.3 Change-Id: I37c9a15455f7da251da60840be48c13c39edc91c Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Replace uses of deprecated _qs with _sSona Kurazyan2022-04-261-2/+4
| | | | | | Task-number: QTBUG-101408 Change-Id: I011d5ed352298902158d0b1b89ad3b99b310fc83 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Update documentation on translationsFriedemann Kleint2021-08-311-4/+6
| | | | | | | | | Adapt to qtbase/74515a7a30b809a3ab0a2d67496e870ea3c872e6. Pick-to: 6.2 Change-Id: I200e8a6803a46deb064f84d312a15e888f5d4e6d Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Update macOS documentation for Qt 6Tor Arne Vestbø2021-06-212-3/+2
| | | | | | | Fixes: QTBUG-92276 Pick-to: 6.2 Change-Id: Ifd75f940384a16499d97084ad78d80efa6a72730 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Update build instructionsJoerg Bornemann2021-04-011-1/+1
| | | | | | | | | | Remove -xplatform configure arguments and add -qt-host-path where necessary. Pick-to: 6.1 Fixes: QTBUG-92047 Change-Id: I2d9f7fff3a6353e7e41c667e35e202dc40bdf40e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Don't recommend deprecated QLibraryInfo::locationVolker Hilsheimer2021-03-251-1/+1
| | | | | | | | Point readers at QLibraryInfo::path instead. Pick-to: 6.0 6.1 Change-Id: I671c76bc58934b2de7ad84b10716ed36a3664aa8 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Remove unused snippets from doc_src_installation.qdocKai Koehne2020-11-111-139/+0
| | | | | Change-Id: I4b0e1ed4c5233dcb4d4a5b779709e1025fc022e9 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* macOS: Update macos-building.html for Qt 6Kai Koehne2020-11-101-2/+2
| | | | | | | | | | | | | | | Advise to users to use cmake --build, cmake --install instead of make, make install. Also remove the mentioning of problems with parallel builds (is this still current)? Finally, remove the mentioning of the Fink / QMAKESPEC issue; The new Qt 6 build system doesn't use QMAKESPEC anymore. Change-Id: I5d1cee7d795c6b1d2cee022bc3049f6767561177 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Remove usage of deprecated QStandardPaths::DataLocationKarsten Heimrich2020-10-211-1/+1
| | | | | | | Task-number: QTBUG-87037 Change-Id: I86b05c0ef07fd34ec7b17f01269bc1939a7cc764 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Example: Add the app icon setupVenugopal Shivashankar2020-06-151-24/+0
| | | | | | | | | | | | | The example's qmake setup includes the app icon config, which is dropped in the CMake setup for some reason. In addition, updated the app icon setup instructions to use this example as a reference instead of the snippet file. Change-Id: I12bb8b007904164226dc78f2a2e162b08c9003e1 Fixes: QTBUG-83696 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Doc: Add cmake instructions for app icon setupVenugopal Shivashankar2020-06-151-0/+24
| | | | | | | | | | Added CMake-specific app icon setup instructions for windows and macOS. Change-Id: I81378ba8cee010685811b34b4dee85fdbe2b2edf Fixes: QTBUG-83696 Pick-to: 5.15 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Doc: Fix snippetPaul Wicking2020-04-241-0/+1
| | | | | | | | | | | The field sa_flags of the structure term is not initialized to zero, so SA_RESTART is in OR with whatever value was in the memory. It should be set to zero as already done for the structure hup. Fixes: QTBUG-83686 Change-Id: If4c2b68136fb0cab26af164bbdb461807b11ce70 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Levon Sargsyan <levon.sargsyan@qt.io>
* Merge remote-tracking branch 'origin/5.15' into 5.15.0Qt Forward Merge Bot2020-04-221-2/+2
|\ | | | | | | Change-Id: Ibac97219e1738afb001d4a6829e4ab7269378382
| * Update connects to QSocketNotifier::activatedMårten Nordheim2020-04-201-2/+2
| | | | | | | | | | | | | | | | | | | | The int-overload will in some cases truncate the descriptor. So it's being replaced. Task-number: QTBUG-70441 Change-Id: I1cd7dd0a8064dc90b862b41c969d270ac707439f Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | Make docs encourage readers to query locale rightMiłosz Kosobucki2020-04-211-1/+1
|/ | | | | | | | | | | | | | | | | Currently the example shows the usage of "filename" + QLocale::name() which will not work correctly for users with different locale and display language. Even the QTranslator::load() docs discourage using it in this way. This approach is copied by users of Qt. For example in KDE: https://github.com/search?q=org%3AKDE+%22%2B+QLocale%3A%3Asystem%28%29.name%28%29%22&type=Code We should follow the best practice in the first place the user is going to look at when working with i18n in Qt. Hopefully, with this change the incorrect code will slowly die out. Change-Id: I881f50f39740632bbd4640495270aae22bd44d0d Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Merge remote-tracking branch 'origin/5.13' into 5.14Qt Forward Merge Bot2019-10-161-1/+2
|\ | | | | | | Change-Id: I6b985ad066151f8c2baaa37066dc58bdc5f5a55d
| * Describe building Qt reference docsLeena Miettinen2019-10-021-1/+2
| | | | | | | | | | | | | | | | | | ... as a part of building Qt from sources. Otherwise, the docs will not be visible in the Qt Assistant that was built. Fixes: QTBUG-18988 Change-Id: I20c702d46c8996aa070859dcfd9287af9620a67a Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | Merge remote-tracking branch 'origin/5.13' into 5.14Qt Forward Merge Bot2019-09-281-7/+8
|\| | | | | | | Change-Id: I470561a048e670ad91ce019d45a247ceb8a7b5ca
| * I18N: describe loading translations for Qt modulesLeena Miettinen2019-09-251-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the first example simpler and move the code for locating Qt modules to a subsection. Map Qt modules to catalogs available in the qttranslations repository. Explain that devs can either use the meta catalog or pick the catalogs for the modules that they use (only available way for new Qt 5 modules). Task-number: QTBUG-69203 Change-Id: I0727ca3b5547349ab2a1e387040086ead532b688 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | Stop using DISCARDABLE attribute for icon resourcesFredrik Orderud2019-02-261-1/+1
|/ | | | | | | | | | The DISCARDABLE attribute is only supported on 16bit Windows, and is ignored for 32 & 64bit applications. Usage can therefore be removed to simplify the sample code. Microsoft doc: https://docs.microsoft.com/en-us/windows/desktop/menurc/common-resource-attributes Change-Id: I216064c0480e131f89865cdc320c347cecbd9d48 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Properly document license of Qt examplesKai Koehne2018-10-111-0/+56
| | | | | | | | | | | | | | | | So far we only referenced http://opensource.org/licenses/bsd-license.php, which is actually not the BSD-3-clause license we use, but BSD-2-clause. While at it, also document the license itself as part of the documentation, and reference it from the licensing entry page. Change-Id: I877dde5b8a1f1c2dfbdc01665a2a9965a997552d Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix outdated BSD license headerKai Koehne2017-10-176-18/+78
| | | | | Change-Id: I84b17d5d6e19b88943c4e8011fae47060a0abda8 Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-08-014-12/+12
|\ | | | | | | | | | | | | | | Conflicts: doc/src/legal/3rdparty.qdoc doc/src/platforms/emb-linux.qdoc Change-Id: I8fcdb28b51438b5135cd31176bc635a6daad269b
| * Fix invocation of static methods of QCoreApplication and subclassesFriedemann Kleint2016-07-184-12/+12
| | | | | | | | | | | | | | Replace qApp-> by static invocation where applicable. Change-Id: I24df2689b0df8609d1aa8e7c9c9da75ed94a4bab Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* | Remove Windows CEFriedemann Kleint2016-06-305-301/+0
| | | | | | | | | | Change-Id: I9c64017ad5068656c536bcb112e989483705d20d Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-06-291-2/+2
|\| | | | | | | | | | | | | | | Conflicts: doc/src/legal/3rdparty.qdoc doc/src/platforms/supported-platforms.qdocinc Change-Id: I09059d9bc22fcc69e86f100b9c3ef4b24639eef9
| * Unix signals: fix check of sigaction's return valueGiuseppe D'Angelo2016-05-291-2/+2
| | | | | | | | | | | | | | | | | | sigaction(2) returns 0 on success, non-zero (-1) on failure, so checking for > 0 is actually never going to detect failure. Change-Id: I78b4a00be99de4c6424f0cfa0c91ff712e96d1ff Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7v5.7.0-rc1Liang Qi2016-05-191-77/+6
|\| | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: If44eb502c905dca363d5506ae9c5f250287d8279
| * Doc: Fix references to Plug & Paint example pathsTopi Reinio2016-05-091-6/+6
| | | | | | | | | | | | | | | | The Plug & Paint example (in qtbase) has had its folder structure reorganized. Fix the links and references to it. Change-Id: Ifab2f51f5498b1e7e342ac955dca3e790f643220 Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
| * Doc: Remove unused snippets for deployment documentationTopi Reinio2016-04-281-71/+0
| | | | | | | | | | | | | | These snippets are not referenced anymore. Change-Id: Iaac8ee9ad6d92cfe87b3ea1fd66668df6f8ffef5 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-02-151-6/+1
|\| | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I62e28b5afd37bcdb3d725e7edb439522715bef22
| * Doc: Remove unused snippetJoerg Bornemann2016-01-251-5/+0
| | | | | | | | | | | | Change-Id: I074243651b8f97f41c729c5631c18bbb3e3519f2 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>