summaryrefslogtreecommitdiffstats
path: root/examples/widgets
Commit message (Collapse)AuthorAgeFilesLines
* Fix pointer mismatch after QList::move() in tooltip exampleAxel Spoerl2023-03-283-24/+36
| | | | | | | | | | | | | | | | | | | | | | | | The tooltip example moves shape items within a QWidget. Shape items are stored in a QList of objects. When an item is moved, its pointer is taken from the QList and stored in a member variable. To have the moved item on the bottom of the list, QList::move() is called. This operation re-arranges the list objects, and the member variable starts pointing at a wrong object. This patch changes the list from a list of objects, to a list of pointers. Shape items are therefore allocated on the heap. A destructor is added to free the heap with qDeleteAll. The example's documentation is adapted accordingly and a snippet for the destructor is added. As a drive-by, int is replaced by qsizetype where it was used as an index of a QList. Fixes: QTBUG-104781 Change-Id: I9be26fa7954be5f85729d24f166d66980af71801 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 585bfe600a158743d68e4c8c81fb1a7106566d6a)
* Examples: Add missing include guardsFriedemann Kleint2023-02-014-0/+20
| | | | | | | | | Task-number: QTBUG-109394 Change-Id: I09a1b522d0faeb2346e1e075141f1e810c8155f7 Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit ddb94dd7927126978fc2a620ebd91954e2f96862) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Avoid continuous texture alloc in Composition Modes exampleLaszlo Agocs2022-12-024-8/+22
| | | | | | | | | | | There seems to be some confusion from back when the example were mass-ported to the QOpenGL stuff in Qt 5 times. Fixes: QTBUG-109119 Change-Id: Ic4bcd010df3fcf82e16385ce241b379f0c351788 Reviewed-by: Christian Strømme <christian.stromme@qt.io> (cherry picked from commit 919664b29a874e8cdc3d74427654cbaa2b61be29) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Pass a parent pointer to the Animation instance to avoid memory leakJan Arve Sæther2022-09-152-3/+3
| | | | | | | | | | The leak is just on termination, but we should show good practices in our examples Change-Id: I39abb7545d3c68a1a537b865ba3fcb5e60c22fbf Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> (cherry picked from commit 30947c7fd4dddd76b69a3aa11567e27174d7a3ea) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Basiclayouts: Add scrolling to exampleElias Hautala2022-08-191-2/+17
| | | | | | | | | | | | Adds scrolling to basic layouts example because the user interface in the example doesn't fit properly on smaller screen sizes. Fixes: QTCREATORBUG-27634 Change-Id: I61e6eac2b28e5b3ff0f984894fe38167b3f46a9c Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Markku Nokkala <markku.nokkala@qt.io> (cherry picked from commit 89ce9a1c5a29e3f420931baa88c705856b99ac25) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Sliders: Add function that changes widgets position on layoutElias Hautala2022-08-162-5/+40
| | | | | | | | | | | | | | Changes the layout to QGridLayout and adds function to change widgets position on the layout depending on the windows aspect ratio. Before this the widgets wouldn't fit on screen when using the example on Android in portrait. Fixes: QTCREATORBUG-27685 Change-Id: I00009cb6c8c250a8333ac3dfa635f70da4576d5e Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Jani Korteniemi <jani.korteniemi@qt.io> (cherry picked from commit 1a6019438881b9aa54cfc8dbd3f8fc06ddc35d67) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Make sure qtbase examples are installed into the correct pathAlexandru Croitor2022-07-283-6/+6
| | | | | | | | | | The find_package calls need to happen after we set INSTALL_EXAMPLEDIR to ensure that INSTALL_EXAMPLEDIR is overridden if necessary. Task-number: QTBUG-102879 Change-Id: I3c2e6c5a68a8c6ff9b98b79dbd6c83445d8da052 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit 818a15234c8fb80cd9adad54bd726cf69726fa79)
* GroupBox example: port away from using deprecated QAction::setMenu()Ivan Solovev2022-07-151-3/+1
| | | | | | | | | | | We can achieve the same UI by using QMenu::addMenu() directly Task-number: QTBUG-104857 Change-Id: I627f21bc93646943cf6dfbd3b388352b84f73f0f Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 6db91c0df1900df2ddcd5abeb243b8852b02b7ab) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* examples: add WindowStaysOnBottomHint into preview textLiang Qi2022-06-031-0/+2
| | | | | | | Change-Id: I1e4e390990fcb6e30b2ff7bb59168e4ffc01a936 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 43b779ab0462f85f9c2cce86ec2701f56306ac87) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Don't build the movie example if the feature is disabledAlexandru Croitor2022-03-191-1/+3
| | | | | | | | Fixes: QTBUG-101897 Change-Id: Idef9aaa0c0a0380b88d8769cb19becd613b2173b Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit 4b7225c66211ae242cf6d8dc7624f5de95087b8d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Fix echoplugin example to be built as an external projectAlexandru Croitor2021-12-151-1/+1
| | | | | | | | | | | | It was accidentally reverted as part of a different change. Amends 3c1125d9fe41332087ab6213a5514426109ead08 Task-number: QTBUG-90820 Change-Id: Id9b2650c7c42fd9f401cd2da3fcd60ed4d39d212 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit fc89d92150e41e0bb10ed15aec0d9020a895669c)
* Remove .prev_CMakeLists.txtKai Köhne2021-12-0630-1721/+0
| | | | | | | | | These are left-overs from the initial qmake2cmake conversion. Change-Id: Ie15c9ff022ea4566d10c1ba74599de9af83d29a7 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 251e84800793d3f74d7d8e7543eb5e9dba3834ad) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QSystemTrayIcon example: ignore non-spontaneous QCloseEventShawn Rutledge2021-12-032-8/+5
| | | | | | | | | | | Apparently this code is needed on other platforms now, not only macOS. Fixes: QTBUG-98504 Change-Id: Ie0a7e38609e8fc8c11915784dd3652a3517bb639 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io> (cherry picked from commit 46cadf7b48288fce4de6147ae38de493354c23d0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Repair parameter typeChunLin Wang2021-12-032-2/+2
| | | | | | | | | | Fix the parameter types corresponding to the sample code and subclasses Fixes: QTBUG-98578 Change-Id: I06e342ae1210ed53c5deec3e2711457cf2ac5b15 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 8e465c75fea7f71618a27743bac7faaccece6667) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix treemodelcompleter exampleJoerg Bornemann2021-10-271-3/+2
| | | | | | | | | | | | | | | | | All nodes in the view were at the top level due to a spurious trimmed() call. The condition in the indentation calculation was flipped, leading to a segfault. Also, the input data does not contain tabs. Remove the condition that checks for tabs altogether. This amends commit 3fede6cb547b783377e833c9b269d4cecfe47e61. Fixes: QTBUG-97727 Change-Id: Ic5068ead755c4dae5f0607724ac7704cce03227c Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> (cherry picked from commit 9beae46b599be011aab9f44efc92d49309b72da3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add missing LIBRARY DESTINATION for examplesAlexey Edelev2021-10-203-0/+3
| | | | | | | | Fixes: QTBUG-97629 Change-Id: I5b32824693206926de9b4ee6637749a1814fdde7 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 3f4082c0e847c21f468d38609766e8cf1e446531) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Polish the painting/affine exampleFriedemann Kleint2021-10-177-299/+256
| | | | | | | | | | | | | | | - Use member initialization - Remove C-style casts - Add space around operators - Use qsizetype for list indexes - Remove commented out debugging code Task-number: QTBUG-97095 Change-Id: I11a17fa6e7f17968367a57291d83ee6fba731a34 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit bb56560b6b323933773608d006fb282693ea6106) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Create plugin initializers for static user pluginsAlexandru Croitor2021-08-2411-136/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously we only created object library static plugin initializers for Qt plugins only, not user-project plugins. The reason was that if a user tried to install the plugin target via an export set, CMake would error out saying that the _init library is not part of the same export set. Introduce an OUTPUT_TARGETS option that would allow projects to get the name of the generated _init target, so they can install it if needed. This was already done for qt6_add_qml_module, so we just introduce the same option for qt6_add_plugin. Now user static plugins will have an _init target created, which will be propagated to consumers whenever the consumers link against the plugin itself. We also need an internal option to disable this propagation, because it's handled a bit differently for Qt plugins which can be linked either via finalizers or via usage requirements. Amends 91c65dd80cdd2de666448c14202c0c63718152b6 As a result of the implementation change, cleanup example projects to ensure that they build successfully (the important part is specifying the CLASS_NAME). Only plugandpaint works properly with both shared and static Qt builds. echoplugin works with a shared Qt build, but not a static one due to some assumptions in the C++ code about shared plugins. styleplugin doesn't seem to work properly neither with shared Qt builds nor static Qt builds, at least on macOS. But it builds fine. For some reason even if the plugin is found, the style is not applied. Amends 4caac1feea025b0ad496141e8f16ab88c04c2caa Task-number: QTBUG-80863 Task-number: QTBUG-92933 Change-Id: I6f631cda9566229b7a63992b23d7d7fa50303eeb Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 3c1125d9fe41332087ab6213a5514426109ead08) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Raise cmake_minimum_required to VERSION 3.16 in examplesJoerg Bornemann2021-08-17145-145/+145
| | | | | | | | Task-number: QTBUG-95636 Change-Id: I1270b4846d8a23bc3563b6942c0910e095d2be4a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit ff00ef641041d2a758ec2560d87ef8f549618a7d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Improve translations loading code in standarddialogs exampleFriedemann Kleint2021-08-061-7/+8
| | | | | | | | Change-Id: I799724b633f1b52675ca2aa69b22fdb678b84421 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io> (cherry picked from commit 74515a7a30b809a3ab0a2d67496e870ea3c872e6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Qt::PrintSupport is an optional component in the fontsampler exampleVolker Hilsheimer2021-06-151-0/+1
| | | | | | | | | | If we don't find it we can't link to it, and then the example will never have any print functionality, in spite of having the UI. Change-Id: Ib84be39a2655253c7d643520487adee054d5bd2d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit eee953aa56856da97e3104cf70ffe0cf7b27f891) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Regular Expression example: Brush up and add a way to preview replacementsFriedemann Kleint2021-06-013-27/+99
| | | | | | | | | | | | - Set a fixed font on text edits so that parentheses stand out - Rearrange the layout to have the text at the top be prevent long texts from being wrapped - Add a replacement field where one can exercise replacement with the \1, \2... placeholders. Pick-to: 6.1 Change-Id: I140a62e1fb2cd1c6bfe02a2f01b7f06a6f3b5eb2 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Build examples in isolated sub-builds using ExternalProjectCraig Scott2021-05-2629-171/+170
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Examples are intended to show how to build against an installed Qt. Building them as part of the main build means the way the Qt targets are defined and created are not representative of an end user's build. By building them as separate projects using ExternalProject, we can more closely replicate the intended audience's environment. This should allow us to catch more problems earlier. Having examples built as part of the main build also creates problems with some static builds where a tool built by the main build is needed during configure time. This happens with other repos like qtdeclarative but not (currently) with qtbase. Converting the examples in qtbase to be built using ExternalProject is intended as a demonstrator for how other repos can do similar. Until other repos are converted, they will continue to work as they did before, with examples as part of the main build for non-static builds only. The new build-externally behavior is only supported for non-prefix builds with this change. Prefix builds will continue to use the old non-external method. Support for building examples externally in prefix builds will be a separate change. Task-number: QTBUG-90820 Fixes: QTBUG-91068 Change-Id: I2304329940568dbdb7da18d54d5595ea7d8668bc Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Small fix to the notepad exampleFriedemann Kleint2021-05-184-68/+28
| | | | | | | | | | | - Remove misleading note about setCentralWidget() - Connect copy/paste and undo/redo directly to the QTextEdit instead of routing them via window - Add the missing "About" menu - Check for reject of QFileDialog Change-Id: Ia7457fbedd762028bf2bcde99dfcfb50bbc97f1d Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Fix BASE argument of qt_add_resourcesJoerg Bornemann2021-05-1810-1400/+350
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The BASE argument of qt_add_resources now denotes the root point of the alias of the file. Before, BASE was merely prepended to every file that got passed to qt_add_resources. Old behavior: qt_add_resources(app "images" PREFIX "/" BASE "../shared" FILES "images/button.png") Alias is "../shared/images/button.png", and pro2cmake generated QT_RESOURCE_ALIAS assignments to fix this. New behavior: qt_add_resources(app "images" PREFIX "/" BASE "../shared" FILES "../shared/images/button.png") The alias is "images/button.png". No extra QT_RESOURCE_ALIAS assignment is needed. The new behavior is in effect for user projects and for Qt repositories that define QT_USE_FIXED_QT_ADD_RESOURCE_BASE. Qt repositories will be ported one by one to this new behavior. Then the old code path can be removed. Pick-to: 6.1 Task-number: QTBUG-86726 Change-Id: Ib895edd4df8e97b54badadd9a1c34408beff131f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Brush up the text edit exampleFriedemann Kleint2021-05-182-82/+67
| | | | | | | | | | | | | | - Use initializer lists - Use u instead of QLatin1String() - Fix some clang warnings about else after return, constFirst() - Streamline code - Remove slot TextEdit::printPreview() which is not needed - Rename variable fileName to pdfFileName in filePrintPdf() to disambiguate from this->fileName Pick-to: 6.1 Change-Id: I377ebfd13487470b6f8eaf568dd5d99354f761f2 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Fix build of standalone painting examplesJoerg Bornemann2021-05-177-13/+18
| | | | | | | | | | | Since commit f5c69a51956 the examples/widgets/painting examples could not be built standalone anymore. Move the find_package calls out of the examples/widgets/painting/shared subdirectory and add a .cmake file that can be included to use the library conveniently. Change-Id: I35cb5bd8419a67c782d109104c4a88d64477a8be Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add missing PNG file to CMakeLists.txt of richtext/textedit exampleJoerg Bornemann2021-05-142-0/+4
| | | | | Change-Id: I3532646d16c14585f8800a16d3032535bc6a30a6 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Style sheet example: Fix doc url for Qt 6Friedemann Kleint2021-05-081-2/+4
| | | | | | Pick-to: 6.1 Change-Id: I5c66b472b1687eec0ed1109ce2723d747b1a4193 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Support CSS text-decoration-color in underlines, overlines, strikethroughShawn Rutledge2021-05-075-0/+19
| | | | | | | | | | | | Also add a feature to the textedit example to set this value. [ChangeLog][QtGui][CSS] The CSS text-decoration-color attribute is now supported in rich text spans with underlines, overlines and strikethrough. Fixes: QTBUG-82114 Task-number: QTBUG-39617 Change-Id: I0065cb5431833da55b0f503ce7ff2b83b74b718a Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Re-work the CMake project files for the plugandpaint exampleJoerg Bornemann2021-04-275-105/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the project prelude to examples/widgets/tools/plugandpaint/CMakeLists.txt to mark it as the entry point of the example project. Remove the project prelude from all its subdirectories, because the subdirs are not supposed to be built separately. Remove the wrong code that pro2cmake generated for the application's project file. That merely tried to link the basictools static plugin. Move common initialization code (CMAKE_AUTO*, INSTALL_EXAMPLESDIR) to the top-level plugandpaint project file. Remove superfluous CMAKE_INCLUDE_CURRENT_DIR. Set the output directory of the extrafilters plugin to the application's build directory such that the app can find the plugin without having to install the example. Skip regeneration in those files, to avoid scattering the project files with special case markers. Fixes: QTBUG-87449 Fixes: QTBUG-91066 Change-Id: I3ceb08f5fcda1ffea3c35cee8580f7b5e4ecfc1f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Android: Fix build error issue in examplesJukka Passi2021-04-271-1/+5
| | | | | | | | | | Added branching to plugandpaint example to get correct library architecture to the build Fixes: QTBUG-56322 Pick-to: 5.15 Change-Id: I4d0eb4e24681642991d08c3dd2bad73d10caf962 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Rewrite the fetchmore exampleFriedemann Kleint2021-04-235-55/+89
| | | | | | | | | | | | | - Start in root folder so that large directories (/bin/, Windows) are easily reachable - Remove the line edit and navigate by double clicking instead since this is more in line with expectations - Use a QPlainTextEdit for logging - Make the log message more informative - Add icons Change-Id: Ia3cd7fc143efef80772923291f0b711913aa47be Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Port example away from deprecated QTextCharFormat APIVolker Hilsheimer2021-04-231-1/+1
| | | | | | Change-Id: I1d62f14f9e64f14809bdced4e5d906979034cbdc Reviewed-by: Jonas Karlsson <jonas.karlsson@qt.io> Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* Avoid divide-by-zero in the gradients exampleShawn Rutledge2021-04-191-0/+2
| | | | | | | | | | | After 7a738daa97436478a21b5dd31ba2312b2cb2df41 we require QLineF::setLength() to take a finite length, and this code was probably always risky when HoverPoints has two points that are both 0,0. It's probably a transient condition anyway. Fixes: QTBUG-92908 Change-Id: If81122d2f78761026b0d656ceffe173132751317 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Port examples away from deprecated QTouchEvent APIsVolker Hilsheimer2021-04-175-35/+35
| | | | | | | Use the QEventPoints API instead. Change-Id: I7310fd34df110cad508f6188a41ad452a3cf848d Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Merge integration refs/builds/qtci/dev/1618592683Qt CI Bot2021-04-161-1/+1
|\
| * Fix call to QMessageBox::informationVolker Hilsheimer2021-04-161-1/+1
| | | | | | | | | | | | | | | | | | The call assumes two arguments for QString::arg, but only one was passed. The error string became a buttontext argument, which is clearly wrong. Task-number: QTBUG-92483 Change-Id: I1fab5be88331f636185693b721f0d9688c0d9ff3 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* | Merge integration refs/builds/qtci/dev/1618585460Qt CI Bot2021-04-161-1/+1
|\ \ | |/ |/|
| * Port example away from deprecated QVariant APIVolker Hilsheimer2021-04-161-1/+1
| | | | | | | | | | Change-Id: I284610f216409b593d307b8076c8f638722929e6 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | Revise deprecation of countriesForLanguage()Edward Welbourne2021-04-161-5/+9
|/ | | | | | | | | | | | | | | | | It was originally marked \obsolete without any comment on what was to be used to replace it, or deprecation markings in the declaration, so it got missed at 6.0. More recently it's been deprecated in favor of a territory-based name; but actually it was obsoleted by (iterating the territory() of each return from) matchingLocales() in Qt 4.8. So back out of adding territoriesForLanguage to replace it and, instead, mark it as deprecated in the declaration, in favor of matchingLocales(). Also rewrite the implementation to be exactly that replacement. Rewrote the one example using it. Fixes: QTBUG-92484 Change-Id: Iedaf30378446dd9adac5128b7ee5fee48aab1636 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add the "Territory" enumerated type for QLocaleJiDe Zhang2021-04-152-11/+10
| | | | | | | | | | | | | | | | | | | The use of "Country" is misleading as some entries in the enumeration are not countries (eg, HongKong), for all that most are. The Unicode Consortium's Common Locale Data Repository (CLDR, from which QLocale's data is taken) calls these territories, so introduce territory-based names and prepare to deprecate the country-based ones in due course. [ChangeLog][QtCore][QLocale] QLocale now has Territory as an alias for its Country enumeration, and associated territory-based names to match its country-named methods, to better match the usage in relevant standards. The country-based names shall in due course be deprecated in favor of the territory-based names. Fixes: QTBUG-91686 Change-Id: Ia1ae1ad7323867016186fb775c9600cd5113aa42 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* standarddialogs example: Fix font handlingFriedemann Kleint2021-04-071-1/+7
| | | | | | | | | | The example crashed since it passed the font label text (which receives the font key) to the QFont constructor taking the family list. Use QFont::fromString() instead. Pick-to: 6.0 6.1 Change-Id: I499fc9200b4d817b10c946a7b79ede4e7f7e69af Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* Fix Editable Tree Model example model rowCount and model instance leakSamuel Gaist2021-03-292-1/+4
| | | | | | | | | | | | | The rowCount method has been fixed to correctly pass the "Common error test #3: the second column should NOT have the same children". It also fixes the model being leaked. Fixes: QTBUG-92178 Pick-to: 5.15 Change-Id: If92973e6f83ea9a2715bd335269f6e50d80f52c6 Reviewed-by: Luca Beldi <v.ronin@yahoo.it> Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* Remove unnecessary int() casting in QRandomGenerator::boundedThiago Macieira2021-03-171-1/+1
| | | | | | | | | Commit 21d39168170c6833512c4a5f53985272741bd7e7 added the 64-bit version, so qsizetype now works cross-platform. The casts were added to make qtbase compile on commit df853fed66d891077ae2d04ecfa171d7e2cd5202. Change-Id: I26b8286f61534f88b649fffd166c409c5c232230 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Doc: Fix various documentation issuesTopi Reinio2021-03-161-3/+3
| | | | | | | | | | - Document QIODeviceBase - Document QPointerEvent::points - Fix linking issues Task-number: QTBUG-90662 Change-Id: Ib123d5708953b22e01f95c82626b39a49fff95b2 Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
* imageviewer example: Show the color space description when loadingFriedemann Kleint2021-03-051-2/+5
| | | | | | Change-Id: If9939676f29b9bbb43d698fb12efc42757e5c659 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Brush up the imageviewer exampleFriedemann Kleint2021-03-012-4/+5
| | | | | | | | | | | - Fix the save as file dialog being in "Open" mode by setting acceptMode - Fix clazy warnings about detaching QList by using constFirst() - Fix clazy warning about passing a context to slot connection Pick-to: 6.0 6.1 5.15 Change-Id: I0c800e9829e118fcec477322aa2a13660e3b51d2 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* dirview example: Show file icons on WindowsFriedemann Kleint2021-02-131-0/+2
| | | | | | | | | Use QFileIconProvider from QtWidgets. Pick-to: 6.0 Task-number: QTBUG-66177 Change-Id: I22db2f8671c64d90c45ff7160af9a6925d1cecea Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* UndoFramework example: make the background visibleIvan Solovev2021-01-111-0/+0
| | | | | | | | | | | | Existing background image was not displayed correctly due to scaling (see the description in related Jira task). This commit increases the thickness of the lines, so that the grid is displayed correctly Task-number: QTBUG-89896 Pick-to: 6.0 5.15 Change-Id: Iaa8218a5e9852adbc40715e86862ac3b34e1fbec Reviewed-by: Paul Wicking <paul.wicking@qt.io>