summaryrefslogtreecommitdiffstats
path: root/examples/opengl
Commit message (Collapse)AuthorAgeFilesLines
* CMake: Add deployment API to our examplesAlexandru Croitor2024-03-227-63/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Projects were modified using the tool at: https://git.qt.io/alcroito/cmake_refactor A couple of examples had to be adapted manually, due to them including more than one app per example subdirectory. The INSTALL_EXAMPLESDIR and INSTALL_EXAMPLEDIR assignments were removed. The install(TARGETS) calls were modified according to our documentation snippets for qt_generate_deploy_app_script. A qt_generate_deploy_app_script call was added for each executable target. Note that the deployment step will be skipped in the CI for now, because we enable QT_DEPLOY_MINIMAL_EXAMPLES and thus QT_INTERNAL_SKIP_DEPLOYMENT, and also because standalone examples are not enabled yet, and deployment is disabled for in-tree (so no-standalone-example) prefix builds. The install(TARGETS) calls for each example will still run, installing the examples into an installed_examples directory, that will not be archived by the CI. Pick-to: 6.7 Task-number: QTBUG-102056 Task-number: QTBUG-102057 Change-Id: Ida389bbad41710b2ae5da4d95e2d85be9e0cd9ce Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* wasm: Fix openglwindow exampleEven Oscar Andersen2024-03-221-43/+38
| | | | | | | | Use QOpenGLBuffer to satisfy WebGL Change-Id: Id40a85feb329a85844637c5f5a7a8ae534969086 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Correct license for examples filesLucie Gérard2024-03-078-8/+8
| | | | | | | | | | | | | | Example takes precedent over build system file type. According to QUIP-18 [1], all examples file should be LicenseRef-Qt-Commercial OR BSD-3-Clause [1]: https://contribute.qt-project.org/quips/18 Pick-to: 6.7 Task-number: QTBUG-121787 Change-Id: Id348a89884bb309b96abb31077f14a51086b5d0c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Kai Köhne <kai.koehne@qt.io>
* Doc: Move OpenGL examples to '3D' categoryTopi Reinio2024-02-212-2/+2
| | | | | | | Pick-to: 6.7 Task-number: QTBUG-122377 Change-Id: Id4c765c128ad2e90cacfffaa3f798bad349e71e8 Reviewed-by: Kai Köhne <kai.koehne@qt.io>
* Doc: Create separate Graphics and Multimedia example categoriesJaishree Vyas2024-01-164-4/+4
| | | | | | | Fixes: QTBUG-117884 Pick-to: 6.6 6.7 Change-Id: I33c7b1cbfaeae866dffb0e89a5d09d775736d886 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Docs: Add stereoscopic example to OpenGL examplesSafiyyah Moosa2023-12-051-5/+10
| | | | | | | | | | | | This fix uses the \ingroup command to add the stereoscopic example to the examples-widgets-opengl group. I also elaborated on the hardware requirements. Fixes: QTBUG-119280 Pick-to: 6.5 6.6 Change-Id: I6d5b992e533b897d84100f0f897aae97ef89290f Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Make contextinfo example a manual testLaszlo Agocs2023-11-179-726/+1
| | | | | | Change-Id: I9023016d50e82bba1fa73632cc1409b3d016f352 Reviewed-by: Kristoffer Skau <kristoffer.skau@qt.io> Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* 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 <laszlo.agocs@qt.io>
* 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 <laszlo.agocs@qt.io>
* Update mobile example categories for Qt 6.6Rami Potinkara2023-09-121-0/+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 <assam.boudjelthia@qt.io>
* Doc: Add example categories for qtopenglJaishree Vyas2023-09-056-1/+6
| | | | | | | Task-number: QTBUG-116069 Pick-to: 6.5 6.6 Change-Id: If675124e538c197d3b446f09da0620718b7b7118 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Docs: Add link to OPenGL examples to OpenGL indexSafiyyah Moosa2023-06-301-0/+1
| | | | | | | Task-number: QTBUG-112824 Pick-to: 6.5 6.6 Change-Id: Ib507e8c32518442fd211f3486c4317b4907ea414 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Examples: Remove unnecessary Q_INIT_RESOURCE callsKai Köhne2023-06-081-2/+0
| | | | | | | | | | | Explicit calls to Q_INIT_RESOURCE are only needed for resources embedded in static libraries. See also https://doc.qt.io/qt-6/resources.html#explicit-loading-and-unloading-of-embedded-resources Pick-to: 6.5 6.6 Change-Id: I06a24d1c04369eedc78ca60a6ca02ce33907d9e7 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Polish forward decl in vulkan and opengl examplesLaszlo Agocs2023-06-013-17/+9
| | | | | | | Pick-to: 6.5 Change-Id: I9f05aedc7649ab7e248b7332c04a6664e85182d8 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Move qopenglwidget example to manual testsLaszlo Agocs2023-05-2413-1108/+0
| | | | | | Pick-to: 6.5 Change-Id: I76e6377008484a7b17c65e3c03139a0fb2fc5c34 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Docs: Update OpenGl example docsNicholas Bennett2023-05-092-14/+135
| | | | | | | | | | | | | Updated hellogle3 and cube docs. Made brief statements more brief, rearranged to reference examples were suitable, added snippets. Fixes: QTBUG-108416 Pick-to: 6.5 Change-Id: Ia86f9dc8eaa53d9f9654afe099caf3ee8c7fccee Reviewed-by: Mats Honkamaa <mats.honkamaa@qt.io> Reviewed-by: Rami Potinkara <rami.potinkara@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Examples: Use versioned CMake targets for Qt modulesKai Köhne2023-05-021-5/+5
| | | | | | | | | | | Use e.g. Qt6::Core instead of Qt::Core. This is better matching the find_package(Qt6 ...) call, and also avoids issues that the versionless targets have. Pick-to: 6.5 Task-number: QTBUG-113277 Change-Id: Ib4373036092163518a611bd5c688591d18096d7e Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Tune textures example to work with wasm and update docsLaszlo Agocs2023-04-251-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | Old examples inherited from Qt 4 tend to set some state, such as enabling the depth test or culling, in initializeGL(). Newer examples tend not to do this; they rather set the necessary state in paintGL(). This mattered little (or not at all) in the past, but with WebAssembly and WebGL there are limitations in the GL context management in the wasm platform plugin. Under certain conditions, esp. when QOffscreenSurface is involved, it looks like the same native context gets reused, which means there is a chance of unexpected changes to the current state between calls to initializeGL() and paintGL(). (and also between paintGL() calls) See QWasmOpenGLContext for details. Update the textures example the same way we did for the cube one. Add a note to the QOpenGLWidget docs about this problem. Task-number: QTBUG-111304 Pick-to: 6.5 6.4 Change-Id: I29d2b2cdeb07bcecc5dc915d79c12b4323ca9ab3 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Inho Lee <inho.lee@qt.io>
* cube example: always set required state in paintGLLaszlo Agocs2023-04-201-8/+8
| | | | | | | | | | ...instead of expecting whatever was set in initializeGL will persist. Task-number: QTBUG-111304 Pick-to: 6.5 6.4 Change-Id: Ifcf75a3df9bed6a45d2e9264a5e3f32504b42313 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* cube example: Switch to a power-of-two textureLaszlo Agocs2023-04-191-0/+0
| | | | | | | | | | | | | | Just to make sure it runs with strict WebGL 1 implementations. This cannot generally be a solution, naturally, so requiring WebGL 2 is more likely the way to go, but in the case of this example it seems the only thing we need is to resize the image file, so we might just as well do that. Pick-to: 6.5 6.4 Task-number: QTBUG-111304 Change-Id: I1b4a72ac1a7b94575bf1abd61c5aa722959c92e4 Reviewed-by: Inho Lee <inho.lee@qt.io>
* cube example: make sure the program is boundLaszlo Agocs2023-04-181-0/+1
| | | | | | | | | | | | | | ...in paintGL. There is nothing saying the current program (or other state) cannot change between paintGL calls (or initializeGL and paintGL calls). Correctly call program.bind(). This eliminates the WebGL warning with WebAssembly. Pick-to: 6.5 6.4 Task-number: QTBUG-111304 Change-Id: I19792f5f193dcdb305473a939780df33deb1f8e1 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Move hellogles3 docs to where the rest of these files liveLaszlo Agocs2023-03-233-0/+2
| | | | | | | | | And expand the note in the openglwindow example to point to hellogles3 as well. Pick-to: 6.5 Change-Id: I2c0ee9b83fa59752d937c57eaf0194f0d0a8a7d9 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* Remove erroneous widget dependency for hellogles3Laszlo Agocs2023-03-233-3/+9
| | | | | | Pick-to: 6.5 Change-Id: I42b476be28acd5b5c68f115bd98cf5c43cd8d97b Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* Change paintedwindow example to be a manual testLaszlo Agocs2023-03-237-313/+1
| | | | | | Pick-to: 6.5 Change-Id: I25a0f491f824c43fc75ba6358518133ede09adcd Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* Move hellowindow and qopenglwindow to be a manual testsLaszlo Agocs2023-03-2314-1028/+2
| | | | | | Pick-to: 6.5 Change-Id: I8d1517ee57df9b2dee0486f47562b0754e9dcbad Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* Change computegles31 example to a manual testLaszlo Agocs2023-03-229-603/+0
| | | | | | Pick-to: 6.5 Change-Id: I652daf3ccbb921c5eb73b48586ee9616c7704b97 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* Remove threadeqopenglwidget exampleLaszlo Agocs2023-02-2811-616/+0
| | | | | | | | | | | | | | | It is neither documented nor very useful, and it has platform-specific issues as reported over the years. Remove it now as part of the example revamp initiative. Task-number: QTBUG-50278 Task-number: QTBUG-110093 Task-number: QTBUG-76054 Task-number: QTBUG-43209 Pick-to: 6.5 Change-Id: I6dadaf4162b4c19411c544b9f204c19e37aa740d Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Examples: Add missing include guardsFriedemann Kleint2023-02-013-0/+14
| | | | | | | | Pick-to: 6.5 6.4 6.2 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>
* Fix ContextInfo example crashing on AndroidJani Korteniemi2023-01-311-0/+2
| | | | | | | | | Disabled desktop OpenGL renderer on android Task-number: QTBUG-91627 Pick-to: 6.2 6.4 6.5 Change-Id: I61ec7cc768d46c368dc0187714bd0bd085257a67 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Examples: Use PRIVATE CMake linkageKai Köhne2022-11-3013-13/+13
| | | | | | | We (almost) only build apps, for which PRIVATE linkage makes more sense. Change-Id: I09a509c3fb33a00cdfdede687b3f95d638f42091 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Add support for stereoscopic content in QOpenGLWidgetKristoffer Skau2022-11-2812-1/+503
| | | | | | | | | | | | | | | | | Need to add the plumbing necessary to support two textures in QOpenGLWidget and use these in the backing store. The changes required on the RHI level is already done in an earlier patch. Then paintGL() needs to be called twice, once for each buffer. Also add overloads for the other functions of QOopenGLWidget where it makes sense to query for left or right buffer. Then finally create an example. [ChangeLog][Widgets][QOpenGLWidget] Added support for stereoscopic rendering. Fixes: QTBUG-64587 Change-Id: I5a5c53506dcf8a56442097290dceb7eb730d50ce Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Examples: Use qt_standard_project_setup()Kai Köhne2022-11-1713-26/+26
| | | | | Change-Id: I0ceab08108b7e58e4e2ed25db9e3c289f5c0ddac Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Examples: Use Qt6:: to qualify Qt CMake packagesKai Köhne2022-11-1714-55/+55
| | | | | | | This is what we promote also in the documentation. Change-Id: If91aebafe861b0c934acbb2c69afd182abc3345d Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-113-4/+4
| | | | | | | | | | | | | | | | We've been requiring C++17 since Qt 6.0, and our qAsConst use finally starts to bother us (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace, with manual unstaging of the actual definition and documentation in dist/, src/corelib/doc/ and src/corelib/global/. Task-number: QTBUG-99313 Change-Id: I4c7114444a325ad4e62d0fcbfd347d2bbfb21541 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Change the license of all CMakeLists.txt and *.cmake files to BSDLucie Gérard2022-08-2314-14/+14
| | | | | | | Task-number: QTBUG-105718 Change-Id: I5d3ef70a31235868b9be6cb479b7621bf2a8ba39 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Add license headers to cmake filesLucie Gérard2022-08-0314-0/+42
| | | | | | | | | | | | CMakeLists.txt and .cmake files of significant size (more than 2 lines according to our check in tst_license.pl) now have the copyright and license header. Existing copyright statements remain intact Task-number: QTBUG-88621 Change-Id: I3b98cdc55ead806ec81ce09af9271f9b95af97fa Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Fix typos in docs and commentsKai Köhne2022-06-151-1/+1
| | | | | | | | | Found by codespell Pick-to: 6.4 Change-Id: Ie3e301a23830c773a2e9aff487c702a223d246eb Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-1671-3341/+142
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Examples: Do not depend on transitive includesFabian Kosmale2022-03-171-0/+2
| | | | | Change-Id: I7bba855a14289edbedbaa07a1234213f59085c1d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Compose render-to-texture widgets through QRhiLaszlo Agocs2022-03-116-22/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QPlatformTextureList holds a QRhiTexture instead of GLuint. A QPlatformBackingStore now optionally can own a QRhi and a QRhiSwapChain for the associated window. Non-GL rendering must use this QRhi everywhere, whereas GL (QOpenGLWidget) can choose to still rely on resource sharing between contexts. A widget tells that it wants QRhi and the desired configuration in a new virtual function in QWidgetPrivate returning a QPlatformBackingStoreRhiConfig. This is evaluated (among a top-level's all children) upon create() before creating the repaint manager and the QWidgetWindow. In QOpenGLWidget what do request is obvious: it will request an OpenGL-based QRhi. QQuickWidget (or a potential future QRhiWidget) will be more interesting: it needs to honor the standard Qt Quick env.vars. and QQuickWindow APIs (or, in whatever way the user configured the QRhiWidget), and so will set up the config struct accordingly. In addition, the rhiconfig and surface type is (re)evaluated when (re)parenting a widget to a new tlw. If needed, this will now trigger a destroy - create on the tlw. This should be be safe to do in setParent. When multiple child widgets report an enabled rhiconfig, the first one (the first child encountered) wins. So e.g. attempting to have a QOpenGLWidget and a Vulkan-based QQuickWidget in the same top-level window will fail one of the widgets (it likely won't render). RasterGLSurface is no longer used by widgets. Rather, the appropriate surface type is chosen. The rhi support in the backingstore is usable without widgets as well. To make rhiFlush() functional, one needs to call setRhiConfig() after creating the QBackingStore. (like QWidget does to top-level windows) Most of the QT_NO_OPENGL ifdefs are eliminated all over the place. Everything with QRhi is unconditional code at compile time, except the actual initialization. Having to plumb the widget tlw's shareContext (or, now, the QRhi) through QWindowPrivate is no longer needed. The old approach does not scale: to implement composeAndFlush (now rhiFlush) we need more than just a QRhi object, and this way we no longer pollute everything starting from the widget level (QWidget's topextra -> QWidgetWindow -> QWindowPrivate) just to send data around. The BackingStoreOpenGLSupport interface and the QtGui - QtOpenGL split is all gone. Instead, there is a QBackingStoreDefaultCompositor in QtGui which is what the default implementations of composeAndFlush and toTexture call. (overriding composeAndFlush and co. f.ex. in eglfs should continue working mostly as-is, apart from adapting to the texture list changes and getting the native OpenGL texture id out of the QRhiTexture) As QQuickWidget is way too complicated to just port as-is, an rhi manual test (rhiwidget) is introduced as a first step, in ordewr to exercise a simple, custom render-to-texture widget that does something using a (not necessarily OpenGL-backed) QRhi and acts as fully functional QWidget (modeled after QOpenGLWidget). This can also form the foundation of a potential future QRhiWidget. It is also possible to force the QRhi-based flushing always, regardless of the presence of render-to-texture widgets. To exercise this, set the env.var. QT_WIDGETS_RHI=1. This picks a platform-specific default, and can be overridden with QT_WIDGETS_RHI_BACKEND. (in sync with Qt Quick) This can eventually be extended to query the platform plugin as well to check if the platform plugin prefers to always do flushes with a 3D API. QOpenGLWidget should work like before from the user's perspective, while internally it has to do some things differently to play nice and prevent regressions with the new rendering architecture. To exercise this better, the qopenglwidget example gets a new tab-based view (that could perhaps replace the example's main window later on?). The openglwidget manual test is made compatible with Qt 6, and gets a counterpart in form of the dockedopenglwidget manual test, which is a modified version of the cube example that features dock widgets. This is relevant in particular because render-to-texture widgets within a QDockWidget has its own specific quirks, with logic taking this into account, hence testing is essential. For existing applications there are two important consequences with this patch in place: - Once the rhi-based composition is enabled, it stays active for the lifetime of the top-level window. - Dynamically creating and parenting the first render-to-texture widget to an already created tlw will destroy and recreate the tlw (and the underlying window). The visible effects of this depend on the platform. (e.g. the window may disappear and reappear on some, whereas with other windowing systems it is not noticeable at all - this is not really different from similar situtions with reparenting or when moving windows between screens, so should be acceptable in practice) - On iOS raster windows are flushed with Metal (and rhi) from now on (previously this was through OpenGL by making flush() call composeAndFlush(). Change-Id: Id05bd0f7a26fa845f8b7ad8eedda3b0e78ab7a4e Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* threadedqopenglwidget example: Split out class RendererFriedemann Kleint2022-01-259-310/+441
| | | | | | | | | | | This makes the code clearer and decouples it from the GLWidget. As a drive-by, add a global shortcut to close. Pick-to: 6.3 6.2 Change-Id: I3469d29bc367acc17c5f8acf9d46219259b8315b Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Examples: Remove unneeded CMake optionsKai Köhne2022-01-2413-52/+0
| | | | | | | | | | | | | | | CMAKE_INCLUDE_CURRENT_DIR is not necessary anymore for moc since CMake 3.8: https://cmake.org/cmake/help/latest/release/3.8.html#other-changes CMAKE_AUTORCC should not be used anymore. Instead, we now use qt_add_resources() or similar Enable CMAKE_AUTOUIC only if .ui files are present. Pick-to: 6.3 Task-number: QTBUG-87643 Change-Id: I835e2994cd5dba9918136999499b9077961b616c Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Examples: Remove unneeded target_include_directoriesKai Köhne2021-12-172-8/+0
| | | | | | Pick-to: 6.3 Change-Id: Icd97815ee231c34ad4ea5ab94a73bfc26df7e0ca Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Examples: Fix whitespace issues in CMakeLists.txtKai Köhne2021-12-1313-19/+40
| | | | | | Pick-to: 6.3 Change-Id: I8e6dd1f250f8be6016ee4164cb2ab7034cbb1203 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Examples: Remove remaining conversion markers in CMakeLists.txtKai Köhne2021-12-1314-28/+0
| | | | | | Pick-to: 6.3 Change-Id: Ia5d474a3efd6aadbd0ef1537318f2f24e6c24fee Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Prefer unversioned commandsKai Köhne2021-12-133-3/+3
| | | | | | Pick-to: 6.3 Change-Id: Ib32700ab82cf6b271c49e25d12fbad8c9c6bc1d1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Examples: Use find_package(Qt6 REQUIRED COMPONENTS ...) idiomKai Köhne2021-12-1013-52/+13
| | | | | | | | | Also consolidate several find_package(Qt6 ...) calls in one call. Task-number: QTBUG-98867 Change-Id: Idfd5e71f46d4489fac7411cbfadb84437a0658f3 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Remove .prev_CMakeLists.txtKai Köhne2021-12-061-36/+0
| | | | | | | | These are left-overs from the initial qmake2cmake conversion. Pick-to: 6.2 Change-Id: Ie15c9ff022ea4566d10c1ba74599de9af83d29a7 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Raise cmake_minimum_required to VERSION 3.16 in examplesJoerg Bornemann2021-08-1713-13/+13
| | | | | | | Pick-to: 6.2 Task-number: QTBUG-95636 Change-Id: I1270b4846d8a23bc3563b6942c0910e095d2be4a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Build examples in isolated sub-builds using ExternalProjectCraig Scott2021-05-261-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>