aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlapplicationengine.h
Commit message (Collapse)AuthorAgeFilesLines
* Fix minor API problemsUlf Hermann2023-01-181-1/+2
| | | | | | | | | | | Add explicit where appropriate, and use more elegant constructs in inline functions. Introduce removed_api.cpp for QJSEngine::create(int, const void *). Pick-to: 6.5 Change-Id: Ie54b0494fe3c5567f8a5ca361c3a583de3d97dd5 Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Introduce QQmlApplicationEngine::loadFromModuleFabian Kosmale2022-12-021-0/+2
| | | | | | | | | | | | | | | | | This allow instantiating QML types via their module and typename. It simply exposes the underlying functionality of QQmlComponent::loadFromModule. Also add the corresponding convenience constructor. This commit also does some minor refactoring so that functionality can be shared between load and loadFromModule. [ChangeLog][QtQml][QQmlApplicationEngine] It is now possible to load QML types via their module and type name. Fixes: QTBUG-97156 Change-Id: Iee812db269d27e4db4b10117ed2570272a7cc40c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Use SPDX license identifiersLucie GĂ©rard2022-06-111-38/+2
| | | | | | | | | | | | 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. Pick-to: 6.4 Task-number: QTBUG-67283 Change-Id: I63563bbeb6f60f89d2c99660400dca7fab78a294 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QQmlApplicationEngine: Add a more convenient error signalFabian Kosmale2022-04-061-0/+1
| | | | | | | | | | | | | | | | | | | In Creator's hello-world QML example, we currently have to do quite some unhandy logic to check whether creation failed: Connect to objectCreated, and then check whether the object is nullptr in a lambda. Provide objectCreationFailed as a more convenient alternative for when we are only interested in the error case, and do not want to do anything with the created object. This allows simplifying the hello world example to a simple connect of the new signal to QCoreApplication::quit. [ChangeLog][Qt Qml][QQmlApplicationEngine] Added objectCreationFailed signal as a more convenient way to check for errors than objectCreated. Task-number: QTBUG-47996 Change-Id: I6513bf726807de183a604e03379e65515e090ccc Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Remove non-const overload of QQmlApplicationEngine::rootObjectsFabian Kosmale2020-06-201-3/+0
| | | | | Change-Id: Icb4ba3d282bb556236dd9415ab3ccf9163965808 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Clean up QQmlFileSelectorUlf Hermann2020-03-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The global static map of file selectors is not thread safe. If you add a file selector to engine A running in thread 1, you cannot at the same time retrieve the file selector of engine B running in thread 2. Alas, we only need the static map to discern file selectors from other URL interceptors, and we only need to do this on QQmlFileSelector::get(), which we don't use. Unfortunately it is public API, though. Deprecate QQmlFileSelector::get() and add a different hack to discern the interceptors for the case that it's still called. Also remove the duplicate setExtraSelectors() method. For this to work, we also add a method to QQmlApplicationEngine that allows us to pass extra file selectors and delay the initialization of QQmlApplicationEngine's QQmlFileSelector until the first file is loaded. [ChangeLog][QML] QQmlFileSelector::get() is deprecated. You can use the new method QQmlAplicationEngine::setExtraFileSelectors() to pass extra selectors to QQmlApplicationEngine's internal QQmlFileSelector. Manually created QQmlFileSelectors should be configured immediately after creation, before they are used by the QQmlEngine. Change-Id: Ia61a93777dc910b441a03ffb42d35a2a224c0e26 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add Qt.uiLanguage and QJSEngine::uiLanguage propertiesSimon Hausmann2020-01-231-0/+1
| | | | | | | | | | | | | | [ChangeLog][QtQml] Added Qt.uiLanguage and QJSEngine::uiLanguage properties These properties mirror the same value in QML and C++ and can be used freely. They also provide API symmetry to Qt for MCUs. QQmlApplicationEngine binds to this property and applies translations accordingly by constructing a QLocale with the value and using QTranslator::load(locale). Change-Id: Id87d6ee64679b07ff3cb47844594e8eeebd8c8b6 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Christian Kamm <mail@ckamm.de>
* Introduce functions to set properties during creationFabian Kosmale2019-08-191-0/+1
| | | | | Change-Id: Idd4c8ab9e34b9bc3e00f21d7cf1e4f1a70586e7f Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* use the override keyword consistently and correctly (clang-tidy)Shawn Rutledge2018-02-271-1/+1
| | | | | Change-Id: If9e28d143f8cba3df3c757476b4f2265e2eb8b2a Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Replace Q_NULLPTR with nullptrKevin Funk2017-09-271-3/+3
| | | | | Change-Id: I0c01862dbb475494c84e39c695cb563df8cbcfa8 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Replace usage of QSignalMapper by lambdaOlivier Goffart2017-02-141-1/+0
| | | | | | | | | | | | | | | | | QSignalMapper ought to be deprecated soon. It simplifies the code, too. There is still one use in QQuickGenericShaderEffect which is a bit complicated to get rid of. A very similar use of QSignalMapper was in use in QQuickOpenGLShaderEffectCommon but was removed in commit 8c745d80, the same should be done for QQuickGenericShaderEffect. (Note the QueuedConnection in qquickparticlesystem is there because the QSignalMapper used to be in the main thread, meaning a round-trip via the event loop) Change-Id: I331b787becbad37f717035bf119bafd7a7214630 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* QQmlApplicationEngine: mark rootObjects() as constAnton Kudryavtsev2016-10-131-1/+5
| | | | | | | | | This method does not modify the object. Can't change the API, so overload and mark the old function for removal in Qt 6. Change-Id: I15943c770b30460f8ccd14239526e2249c59a242 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-03-071-3/+3
|\ | | | | | | Change-Id: Icfa1d61fcc286c3418d4a625de11d2191336fa60
| * Make public headers compile with -Wzero-as-null-pointer-constantMarc Mutz2016-03-031-3/+3
| | | | | | | | | | | | | | | | | | | | | | ... or equivalent. QtBase 5.6 headers already compile that way, so let the other modules follow suit. Task-number: QTBUG-45291 Change-Id: Ied526fb2d7adc3a68946d6843a6bd6f475ebf864 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Updated license headersJani Heikkinen2016-01-191-14/+20
|/ | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: Ic36f1a0a1436fe6ac6eeca8c2375a79857e9cb12 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-121-6/+6
| | | | | | | | | 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>
* Update license headers and add new licensesJani Heikkinen2014-08-251-18/+10
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: I84a565e2e0caa3b76bf291a7d188a57a4b00e1b0 Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
* Add QQmlApplicationEngineAlan Alpert2013-03-201-0/+80
This helper class exposes QML application functionality that QML-only applications want to have, but QML-using applications may not. Change-Id: If91c3f55ffa2a4aecdd9d6cc62f6ad09fd35b0dd Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>