summaryrefslogtreecommitdiffstats
path: root/examples/widgets
Commit message (Collapse)AuthorAgeFilesLines
* Add missing LIBRARY DESTINATION for examplesAlexey Edelev2021-10-203-0/+3
| | | | | | | Pick-to: 6.2 Fixes: QTBUG-97629 Change-Id: I5b32824693206926de9b4ee6637749a1814fdde7 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Polish the painting/affine exampleFriedemann Kleint2021-10-167-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 Pick-to: 6.2 Change-Id: I11a17fa6e7f17968367a57291d83ee6fba731a34 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Support background-color CSS styling on <hr/>Shawn Rutledge2021-10-141-2/+7
| | | | | | | | | [ChangeLog][QtGui][CSS] The background-color style can now be applied to <hr/> to set the rule color. Task-number: QTBUG-74342 Change-Id: Ib960ce4d38caa225f258b6d228fb794cef43e1b7 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Remove checks for C++ standard versions C++17 and belowIevgenii Meshcheriakov2021-10-011-9/+0
| | | | | | | | | | | Qt requires a compiler that support C++17 thus __cplusplus is always 201703L or higher. This patch removes checks for __cplusplus value that always succeed. Change-Id: I4b830683ecefab8f913d8b09604086d53209d2e3 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_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 Pick-to: 6.2 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>
* Raise cmake_minimum_required to VERSION 3.16 in examplesJoerg Bornemann2021-08-17145-145/+145
| | | | | | | Pick-to: 6.2 Task-number: QTBUG-95636 Change-Id: I1270b4846d8a23bc3563b6942c0910e095d2be4a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Improve translations loading code in standarddialogs exampleFriedemann Kleint2021-08-061-7/+8
| | | | | | | Pick-to: 6.2 Change-Id: I799724b633f1b52675ca2aa69b22fdb678b84421 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Port all in-tree addAction() users from postfix to infix QKeySequenceMarc Mutz2021-07-143-13/+13
| | | | | | | The former is QT_DEPRECATED_SINCE(6, 4). Change-Id: I9e60639651b0832f1e3d3282d15dd0ab0b22d819 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QObject: optimize the common case of findChildren(QString())Marc Mutz2021-07-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Outside tests, all in-tree callers of QObject::findChildren() pass no name to match, and in my experience that is also true for the vast majority of out-of-tree users. Avoid the temporary QString creation in the caller and the repeated QString::isNull() checks in the implementation by overloading findChildren() without a name argument and checking for name.isNull() only once, forking off into separate helper functions. Adjust in-tree callers that used an explicit `QString()` argument in order to pass options, which goes to show that `name` should never have been the first argument of findChilden() in the first place, even though I appreciate the symmetry with findChild() (the use-cases of which, however, are radically different). Change a `findChildren().size() == 0` call found while scanning for findChildren() calls to `!findChild()` as a drive-by. Modernize loops in the various qt_qFindChild{,ren}_helper() overloads to match how the new code looks. [ChangeLog][QtCore][QObject] Added findChildren() overload taking no name (thus optimizing this common case). Change-Id: Ifc56e5438023d079b40c67f11ae274a3e128ad5e Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* 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. Pick-to: 6.2 Change-Id: Ib84be39a2655253c7d643520487adee054d5bd2d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* 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>
* Update Drop Site Example docs: mention the new markdown supportShawn Rutledge2020-12-011-1/+4
| | | | | | | Amends 4edcea762d9ce334c4c1a78234c90c118b81da87 Change-Id: Ide3e7a67b6604d07b76edcfe484c8d29e4e848fb Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix documentation links to High DPI documentationAndreas Buhr2020-12-011-1/+1
| | | | | | | | | | | The documentation on High DPI was recently rewritten, renaming several sections. This patch fixes the links which were broken by this change. Task-number: QTBUG-88533 Pick-to: 6.0 Change-Id: I5e9417554270a6740986d7cec5e3433d043e5560 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Rename Application ExampleVolker Hilsheimer2020-11-263-6/+6
| | | | | | | | | | Prefix it with "Qt Widgets -" to make it a bit clearer in the list of highlighted examples which module this one is about. Pick-to: 6.0 6.0.0 Change-Id: I0bf65b02db72173f1adfe0bcf8657be7905dbd6c Reviewed-by: Tuukka Turunen <tuukka.turunen@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* i18n example: No longer ignore return value of QTranslator.load()Friedemann Kleint2020-11-191-4/+9
| | | | | | | | Adapt to qtbase/86ebe46f591d33dc76e2f764524c988dd72f4437. Change-Id: Ie45d43b3eabe60195622d69458e3d881139f9ce1 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Doc: Fix documentation warnings for Qt WidgetsTopi Reinio2020-11-121-48/+0
| | | | | | | | | | - Exclude forwarding headers to Qt GUI as they caused the headers to be parsed twice. - Drop documentation for removed example Task-number: QTBUG-86295 Change-Id: I08eb46b7c7f813f103cc545f931896be99a3ccec Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Support the markdown underline extensionShawn Rutledge2020-11-071-4/+6
| | | | | | | | | | | | | | | | MarkdownDialectGitHub now includes this feature, so *emph* is italicized and _emph_ is underlined. This is a better fit for QTextDocument capabilities; until now, _underlined_ markdown could be read, but would be rendered with italics, because in CommonMark, *emphasis* and _emphasis_ are the same. But QTextMarkdownWriter already writes underlining and italics distinctly in this way. [ChangeLog][QtGui][Text] By default (with MarkdownDialectGitHub), markdown _underline_ and *italic* text styles are now distinct. Fixes: QTBUG-84429 Change-Id: Ifc6defa4852abe831949baa4ce28bae5f1a82265 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix a bunch of qdoc warningsVolker Hilsheimer2020-11-062-4/+4
| | | | | | | Remove or fix references to removed APIs, and some qdoc syntax fixes. Change-Id: I67d71062cd7a29f4eb74b02199b1482af5e59fc0 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Add multi key bindings to QShortcutAllan Sandfeld Jensen2020-11-041-1/+1
| | | | | | | | | | | This makes it feature comparable with QAction, and makes it possible to use as a backend for QAction, and fixes a few missing alternative keybindings in qtwidgets. Change-Id: Iaefc630b96c4743fc5ef429dc841870ddd99fc64 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Get rid of all instance usage of QFontDatabaseVolker Hilsheimer2020-11-033-12/+8
| | | | | | | | All QFontDatabase APIs are static, use them accordingly. Task-number: QTBUG-88114 Change-Id: I0e4a7508646037e6e2812611262eed8b6d7ad3de Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* DropSite example: support markdownShawn Rutledge2020-11-022-0/+5
| | | | | | | | | | | | | If the mime data includes text/markdown, display it decoded in the QLabel, and also display the raw markdown in the table below. QLabel supports markdown since 51cbd5288c85cb4de382cb23d6f5559c2b626126. Ideally we should add proper support for markdown to QMimeData, but it's too late to do that for Qt 5. Pick-to: 5.15 Change-Id: I2a9998e4b239658fe49f39786e7c4fdd0c08b21a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* CMake: Fix painting examples to build as standalone projectsAlexandru Croitor2020-10-277-51/+332
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The examples use an intermediate object library to avoid duplicate file compilation. The examples worked when built as part of Qt because the shared directory was always added, and Qt::OpenGL is available implicitly. Change each project to add_subdirectory(../shared) if the object library is not available, thus making the examples build as standalone projects. Call find_package inside the shared project, to ensure the Qt packages are found. Create an alias called 'painting_shared::painting_shared' and link against that to ensure that any failure is caught at configure time rather than build time. Adapt the pathstroke example to use the object library. Comment out the code for the OpenGL scopes, because it's handled by the object library. Make sure the OpenGL dependency is public. Make sure to run moc and compile the OpenGL specific files as well. Task-number: QTBUG-87444 Change-Id: Ib0ecb68948581c5267ca04f19d8043fa44ff3d54 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>