aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/window
Commit message (Collapse)AuthorAgeFilesLines
* CMake: Fix examples that use 'shared' project when using a static QtAlexandru Croitor2021-09-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using a static Qt, linking of examples that use the 'shared' Qml module would fail with the following error Undefined symbols for architecture x86_64: "qt_static_plugin_sharedPlugin()", referenced from: StaticsharedPluginPluginInstance::StaticsharedPluginPluginInstance() in window_shared_init.cpp.o This happened because the 'shared' project pre-created its plugin target with qt_add_library instead of qt_add_plugin. qt_add_plugin passes an additional QT_STATICPLUGIN compile definition when compiling the moc'ed file to ensure that the QT_MOC_EXPORT_PLUGIN macro creates a qt_plugin_instance_PLUGIN_NAME symbol. Unfortunately we can't use qt_add_plugin for shared Qt builds, because some of the projects link directly against the plugin target and it's not possible to link against a MODULE_LIBRARY target which qt_add_plugin creates in shared Qt build. We could try to conditionally switch between using qt_add_library for a shared Qt build and qt_add_plugin for a static Qt build, but that further complicates the build system code because it requires specifying a class name and plugin type explicitly. Remove the direct linkage against the libraries in the examples and instead rely on plugin loading. This simplifies the logic of not having to pre-create a target. Amends 7b6eea37aeea55cdf1bcb1fd9c3091d6753f95e8 Fixes: QTBUG-96805 Change-Id: I5b2f3992ccda29b59f1e99748005381c73daca69 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit edc4357ae4893dd952ce1c07b180b4b334047606) Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* doc: Replace qmlscene with qmlShawn Rutledge2021-09-301-2/+3
| | | | | | | | | | | We deprecated qmlscene in a9c93e2716a097c637515aded49a3308e257204b so we should stop recommending it in docs, too. Task-number: QTBUG-53219 Change-Id: Ic729624a8ef849bd13f38087e20b5a410c5c5756 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 0c4851e12b9ec42fddbb64a9f86003a435644f80) Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Install the "shared" example module into macOS bundlesUlf Hermann2021-09-032-0/+5
| | | | | | | | | | | | | | | | If we build an application bundle we cannot rely on the relative path between the application's and the shared module's output directories. This is somewhat ugly, but as we don't have a comprehensive solution for building application bundles, yet, it's the best we can do right now. In order for the shared bundle to be loaded from the PlugIns directory, we need to add the PlugIns directory to the import path on macOS. Change-Id: I5b952420b4bb60af74886a140fa2c6a263d2f730 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 633a85cd39cdd294283439972cffebcff32ac0cb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix the qtquick/window example to use QML modulesUlf Hermann2021-08-303-47/+24
| | | | | | | | | | | | | The shared code becomes its own module. Due to the ${PROJECT_NAME} trick it should be possible to include it multiple times, in different examples. Change-Id: I78cc3211f67fae9a713320fae4041898e6a397ed Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> (cherry picked from commit 7b6eea37aeea55cdf1bcb1fd9c3091d6753f95e8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Raise cmake_minimum_required to VERSION 3.16 in examplesJoerg Bornemann2021-08-171-1/+1
| | | | | | | | Task-number: QTBUG-95636 Change-Id: I9f76b787533dad1c469fbb8c69df6c27b20a9aa3 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit b4ab58d791167329259f5403e52ce6c85b5f0074) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Use fixed qt_add_resource BASE argumentJoerg Bornemann2021-05-211-60/+15
| | | | | | | | Pick-to: 6.1 Task-number: QTBUG-86726 Change-Id: If6e1033642d98ccd40daeb57a453c0e5bc2985da Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* examples/quick: Explicitly cast Qt.application to (Quick) ApplicationMaximilian Goldstein2021-05-031-2/+2
| | | | | Change-Id: Ib9ec9eb0e9f47d8ce758a3c93fee2d1a5abb73ac Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Update window example to use QtQuickControls2Oliver Eftevaag2021-02-234-48/+48
| | | | | | | | | Replaces the use of custom made components from the shared directory, with QtQuickControls2 components. Fixes: QTBUG-90883 Change-Id: I6e659188aa75bfacf8181689f30580783bf280a2 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* CMake: Regenerate examples to set the WIN32_EXECUTABLE propertyAlexandru Croitor2020-10-261-0/+4
| | | | | | | | | As well as the MACOSX_BUNDLE properties as necessary. Task-number: QTBUG-87664 Task-number: QTBUG-86827 Change-Id: I46769fb543acb2cbeba122470b5e44ad478fbe4e Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Regenerate examples to use qt_add_executableAlexandru Croitor2020-10-201-1/+1
| | | | | | Task-number: QTBUG-87661 Change-Id: Ie5bba408000211b24694aa0143bdf79c4a298f42 Reviewed-by: Daniel Smith <Daniel.Smith@qt.io>
* Remove QtQuick.Window pluginUlf Hermann2020-06-154-8/+4
| | | | | | | | | | | | | | | | | We move all the types into QtQuick itself and retain QtQuick.Window only as alias to QtQuick. This requires support for qmldirs that consist of only an import statement. [ChangeLog][QtQuick][Important Behavior Changes] The contents of the QtQuick.Window QML module have been moved into the QtQuick module. QtQuick.Window is merely and alias for QtQuick now. An explicit import of QtQuick will override this alias. Therefore, if you import QtQuick with a different version than QtQuick.Window, you will get the QtQuick.Window types of the version given in the QtQuick import now. Task-number: QTBUG-84639 Change-Id: Ia82afab0ac2faba70cfdaf53dc8dfe4261e1113f Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: Regenerate qtdeclarative/examplesAlexandru Croitor2020-05-291-1/+5
| | | | | | | | | Includes - new example installation paths - one case of QT_QMLTYPES_FILENAME addition Change-Id: I24423da9b04b6ecc8445017fa35f148dd43b1829 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Remove Screen.orientationUpdateMaskShawn Rutledge2020-05-081-4/+0
| | | | | | | | Now Screen.orientation works by default rather than filtering by default. Task-number: QTBUG-83055 Change-Id: I0f49499ec25ceeebf19bc8ef1adc259023f1bc75 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Screen example: avoid shadowing final props with required context propsShawn Rutledge2020-03-241-3/+2
| | | | | | | | Amends 90b4528b846542bfa6f0723487315140b9de17b4 to fix the error qrc:/window/AllScreens.qml:75 Cannot override FINAL property Change-Id: Ie6528f6c9ccc6648ec76b4d237973588450cc932 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Merge remote-tracking branch 'origin/dev' into wip/cmakeAlexandru Croitor2020-03-124-36/+43
|\ | | | | | | | | | | | | | | Conflicts: dependencies.yaml src/qml/qml/qqmlengine.cpp Change-Id: I6a73fd1064286f4a2232de85c2ce7f80452d4641
| * Avoid discouraged patterns in examplesUlf Hermann2020-02-114-36/+43
| | | | | | | | | | | | | | | | | | | | | | In particular, use required properties where applicable, explicitly import QtQml where we use it, avoid unqualified access into the root scope of a component, use JavaScript functions with explicit parameters as signal handlers. Change-Id: I3eaaba47cc3c7a2a12d488e36f9eec145cedbb0e Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Regenerate ExamplesLeander Beernaert2019-10-141-2/+2
| | | | | | | | | | Change-Id: I2fbfb44bbb6d667e022bffb480feaf74ff0d0a5e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Update Examples with lowercase qt6_add_resources()Leander Beernaert2019-09-201-2/+2
| | | | | | | | | | | | | | | | Re-run pro2cmake on all exampls. Change-Id: Iafd1092beff023b407a8f29c2a5b651f2e534b75 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Convert ExamplesLeander Beernaert2019-08-231-0/+120
|/ | | | | | | | This patch converts all examples in qtdeclarative except for a few exceptions which require a public facing qml plugin api. Change-Id: I2cd2b1bb455be8b48796893a8235dea7f8b35aa2 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Merge remote-tracking branch 'origin/5.11' into devUlf Hermann2018-06-251-1/+1
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/qmltooling/packetprotocol/qpacketprotocol.cpp src/quick/handlers/qquickhandlerpoint.cpp src/quick/handlers/qquicksinglepointhandler.cpp tests/auto/qml/ecmascripttests/test262 Change-Id: I8908ec8c6116ca626fbd269af7625d4c429429ca
| * Doc: Add missing dots (qtdeclarative)Paul Wicking2018-06-191-1/+1
| | | | | | | | | | | | Task-number: QTBUG-68933 Change-Id: Ibb5aa227e82825085e7214e17dcffcb17fd44157 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | window example: close window on 'X' button press, not just hide itTor Arne Vestbø2018-04-251-1/+1
|/ | | | | Change-Id: Ice699b3350b223db25e4865c930caf6e3afb647c Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-10-246-20/+70
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/qml/qml/qqmlimport.cpp src/qml/qml/qqmlimport_p.h src/qml/qml/qqmltypenamecache.cpp Done-with: Ulf Hermann<ulf.hermann@qt.io> Change-Id: I41ba7a592b2659ddf53da6952ea3b456a7bba319
| * Fix outdated FDL license headerKai Koehne2017-10-171-5/+5
| | | | | | | | | | Change-Id: I76dccf547de40b5e72fd7abaa062fa96cb2c118a Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
| * Fix outdated BSD license headerKai Koehne2017-10-175-15/+65
| | | | | | | | | | Change-Id: Icc08925454445fc9497fb3bfd2c26efe90605983 Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* | Add screen product informationPier Luigi Fiorini2017-05-231-1/+10
|/ | | | | | | | | | Add information such as manufacturer, model and serial number that is now available on QScreen to the Screen attached property. [ChangeLog][QtQuick][Screen] Add manufacturer, model and serial number. Change-Id: If8f33dffa5eff33111f93212249424b9092250b8 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Add 10mm rectangle to screen example to verify Screen.pixelDensityTor Arne Vestbø2017-01-271-0/+7
| | | | | Change-Id: Icaca370be3eae3ed50971e5bd2f6f5f7278c2962 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Enable making window-screen associations from QMLLaszlo Agocs2016-10-105-7/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Qt Quick provides a Screen attached property to query information about the screen an item's window belongs to. This is a good start, but has two problems: it lacks some virtual desktop related info (e.g. the position in the virtual desktop) and it cannot be used in combination with the Window element in order to achieve a QML equivalent of QWindow::setScreen(). Therefore add the missing virtualX and virtualY properties and introduce Qt.application.screens. The latter is an equivalent to QGuiApplication::screens() and is a JS array the elements of which can be set as the value of the new Window.targetScreen property. This means that a call like window->setScreen(QGuiApplication::screens()[0]) translates to Window { targetScreen: Qt.application.screens[0]; ... } when using the Window type from QML. Screen addition or removal can be acted upon via onScreensChanged. QQuickScreenAttached has been split into two in order to allow reusing the QScreen wrapping queries for other purposes as well. Task-number: QTBUG-56115 Change-Id: I4b2fbd873315b40d0afe878da2fc50966c00e2e0 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* add shared Label for examples, and use in the Window exampleShawn Rutledge2016-10-103-21/+22
| | | | | | | | | It just saves the trouble of setting the Text color to the correct palette text color repeatedly, and avoids having black text on a dark background in case a dark theme is in use. Change-Id: If5c38fabe7f047fa5f6956a9d8b235886ab7ab5c Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* examples: replace 'foreach' with 'range for'Anton Kudryavtsev2016-09-031-1/+2
| | | | | | | | While touching the code, replace QStringLiteral with QL1S in QStringBuilder expression. Change-Id: I2519b254d82453e1c9bd5b834c0bd78e5c026f83 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* fix example installsOswald Buddenhagen2016-05-131-1/+2
| | | | | Change-Id: Ie6a219392a48fd6b1a32037cc215dc20d408e819 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Fixed license headersJani Heikkinen2015-02-174-12/+12
| | | | | Change-Id: I4d5640ff95e1361ec7e65fb3e87d7726d8185ff5 Reviewed-by: Sergio Ahumada <sahumada@texla.cl>
* Update copyright headersJani Heikkinen2015-02-126-28/+28
| | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I61120571787870c0ed17066afb31779b1e6e30e9 Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
* Screen attached property: expose devicePixelRatio propertyShawn Rutledge2014-10-231-1/+4
| | | | | | | Change-Id: I08b22766b3e389b7d27ca4c56729f550b0647a08 Reviewed-by: Jens Bache-Wiig <jensbw@gmail.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Window example: setOrientationUpdateMask to allow all orientationsShawn Rutledge2014-09-221-0/+4
| | | | | | | | The purpose of showing both orientation and primaryOrientation is to see how they both change when the screen is rotated. Change-Id: I54e51c834c568b1dbd895584b9f80e4b00c8d506 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* Doc: Updated "Qt Quick Examples" pages.Jerome Pasion2014-06-051-21/+38
| | | | | | | | | | | -added instructions about running the example (using \include) -used the example names as sections in the collection pages -general editing and documentation polishing -updated copyright information Change-Id: I044f29fcc1921a541040505d5821acb06dc4cb35 Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* QtQuick window example improvements: window size and DPI infoShawn Rutledge2013-12-182-3/+4
| | | | | | | | On high-resolution displays it's important to size the window so that the content will fit. Also show the DPI conversion for pixel density. Change-Id: Ie35852ecff0bb0ee5ab9b77c6c18e82cfc300448 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* examples/quick/window example: fullscreen is possible on OSXShawn Rutledge2013-11-151-0/+1
| | | | | | | | | | It's normally disallowed without the WindowFullscreenButtonHint. But if we're going to declare a value for flags, then we have to put back the Window type which would otherwise be there by default. Task-number: QTBUG-33607 Change-Id: Ibbd593b2648b98d37c7f70a0b9f96787b0a40f22 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* QtQuick examples make use of the new pixelDensity propertyShawn Rutledge2013-10-301-0/+3
| | | | | Change-Id: I273fc08405724158fbf7c7d410bfa38fef4600b1 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Fix image URLAlan Alpert2013-07-301-1/+1
| | | | | Change-Id: I4abac2a842453dbf6838f55703956b2fd53b8f37 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Window example: delay showing the splash until Component.onCompletedShawn Rutledge2013-07-111-3/+3
| | | | | | | | Otherwise it will have the wrong size on KDE. Task-number: QTBUG-32223 Change-Id: I3ed92ff8aead5c6e5a37a5189c7103a5383087ae Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Added QQuickWindow::setDefaultAlphaBuffer()Shawn Rutledge2013-05-301-0/+2
| | | | | | | | | | | | | | All QQuickWindows will render using the same OpenGL context, so for a window to support transparency, the OpenGL context needs to be created with support for transparency from the very start. Therefore the application needs to call setDefaultAlphaBuffer() before creating windows. There are some relevant comments in QTBUG-20768 although the bug itself is not the same use case (it was already OK as long as the first window had a translucent color, because of setAlphaBufferSize in QQuickWindow::setColor()). Change-Id: I92e111c1a62c0d510821b646fd334e52254f8f57 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* window example: show only the splash screen until the timeoutShawn Rutledge2013-05-302-6/+12
| | | | | | | | The window takes time to resize itself; we can avoid letting the user see that by delaying visibility of the main window. Change-Id: I81d656102b384a66b5539cbd879aadb85261ba33 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* window and Screen example: new properties; splash screenShawn Rutledge2013-05-2818-304/+547
| | | | | | | | | Demonstrates the new properties, how to make a splash screen, and how to make a standalone app with an icon. Combined the Screen info into this example too. Change-Id: I5b731539b39c55327f4e5b93860a880a35835896 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* Add new Item.Screen properties to screenInfo exampleShawn Rutledge2013-05-041-34/+35
| | | | | | | | Also removed the rotation animation which doesn't seem useful. (On most platforms the content will auto-rotate anyway.) Change-Id: Ia6ca1046fc2162a13be5c26cbf5d2b698ffa2367 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* Merge branch 'release' into stableSergio Ahumada2013-01-311-0/+5
|\ | | | | | | Change-Id: Ic270f7814489b2c7df7e0f1ecb46cd516802cac5
| * mark forgotten EXAMPLE_FILESOswald Buddenhagen2013-01-281-0/+5
| | | | | | | | | | Change-Id: I83c7706479ea3afd45ab9c97f63f68d416b28f55 Reviewed-by: Alan Alpert <aalpert@rim.com>
* | Update copyright year in Digia's license headersSergio Ahumada2013-01-106-6/+6
|/ | | | | | Change-Id: I6c3bd7bebe3d62d1cfd0fa6334544c9db8398c76 Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* remove some unnecessary CONFIG additionsOswald Buddenhagen2012-12-161-1/+0
| | | | | | | | qt is already added by spec_pre.prf, warn_on by default_pre.prf and dll by qt_module.prf. Change-Id: I449e49275622bac39b7d76af8855c417ddce21e9 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Use resource files for most examplesKai Koehne2012-12-123-5/+8
| | | | | | | | | Make examples shadow-build-friendly by using resource files instead of trying to derive the qml path from applicationDirPath(). Change-Id: I669424554c772d9b261249b366247190f5fbd8b1 Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>