| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We must protect various resources in the type loader with our existing
lock. The QQmlTypeLoaderQmldirContent is now value based, so that we can
release the lock on the shared cache early. Copying it involves
adjusting the refcount of the QHash and QString instances in the
QQmlDirParser.
The safety of this was verified with a TSAN build and the example
supplied in the task. It crashed reliably with TASN errors first and
with this patch it runs without errors.
Task-number: QTBUG-41465
Change-Id: I616843c4b8bdfd65d1277d4faa8cb884d8e77df8
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit a3ad52526f79c1528f170c8affe5af00b68ca61d)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When importing modules - in the QML loader thread - with plugins we keep
globally track of the Qt plugins that we have loaded that contain QML
modules, to ensure that we don't call the engine-independent
registerTypes() function on the plugin multiple times. After
registerTypes() we may also call initializeEngine() on the plugin for
the engine-specific initialization, which - as a QQmlEngine is provided
as parameter - must happen in the gui thread. For that we issue a
thread-blocking call that waits until the gui thread has woken up and
processed the event/call.
During that time the global plugin lock is held by that QML loader
thread.
If meanwhile the gui thread instantiates a second QQmlEngine and
attempts to issue a synchronous type compilation (using
QQmlComponent::CompilationMode::PreferSynchronous), then gui thread is
blocking and waiting for its own QML loader thread to complete the type
compilation, which may involve processing an import that requires
loading a plugin. Now this second QML loader thread is blocked by trying
to acquire the global plugin registry lock
(qmlEnginePluginsWithRegisteredTypes()->mutex) in qqmlimports.cpp.
Now the first QML loader thread is blocked because the gui thread is not
processing the call events for the first engine. The gui thread is
blocked waiting for the second QML loader thread, which in turn is stuck
trying to acquire the lock held by the first QML loader thread.
The provided test case triggers this scenario, although through a
slightly different way. It's not possible to wait in the gui thread for
the plugin lock to be held in a loader thread via the registerTypes
callback, as that also acquires the QQmlMetaType lock that will
interfere with the test-case. However the same plugin lock issue appears
when the first QML engine is located in a different thread altogether.
In that case the dispatch to the engine thread /works/, but it won't be
the gui thread but instead the secondary helper thread of the test case
that will sit in our initializeEngine() callback.
This bug was spotted in production customer code with backtraces
pointing into the three locations described above: One QML loader thread
blocking on a call to the gui thread, the gui thread blocking on a
second QML loader thread and that one blocking on acquisition of the
plugin lock held by the first.
Fortunately it is not necessary to hold on to the global plugin lock
when doing the engine specific initialization. That allows the second
QML loader thread to complete its work and finally resume the GUI
thread's event loop.
Change-Id: If757b3fc9b473f42b266427e55d7a1572b937515
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
On QQmlImportsPrivate::updateQmldirContent we need to check if the new
module has actually been established after figuring out that it doesn't
have any components or scripts. If it has, then we shouldn't fail, as
obviously a plugin has been loaded. We don't need to check the component
and script versions in that case, as plugins don't have separate
versions.
Change-Id: Ie328b59038fe65c3f6a2eeecfe969927bba6cd68
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We need to intercept the URL when it is created. This relieves us of the
need to hack around in it when actually retrieving the content of the
qmldir file and prevents the futile attempt to load remote qmldir files
via the code path that should load local ones (or vice versa).
The back and forth conversion between URLs and strings is unfortunate,
but can only be solved by using QUrl rather than QString where we
actually mean URL. This would be a bigger change which is unsuitable for
5.9. Mind that nothing changes for code that doesn't use URL
interceptors.
Task-number: QTBUG-36773
Change-Id: I6bff3ae352009fdc0a17ec209691c7b390367f11
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In QQmlTypeData::resolveTypes() we know if we're looking at a reference
to a composite singleton type, or some other type reference. When we
call resolveType() we expect the correct type to be returned, not only
based on URL, but also based on its singleton property.
QQmlTypeData::resolveType() eventually invokes
QQmlImportInstance::resolveType() which will call
fetchOrCreateTypeForUrl(), passing a parameter on whether the result
should be a composite singleton. When operating on a qmldir component
the component itself encodes this. When fetching a type from a local
file without qmldir, we currently assume that it isn't a singleton, no
matter QQmlTypeData::resolveTypes() has determined. This means that
actual singletons loaded this way later get refused by the sanity check.
In order to fix this, pass the information about the expected singleton
property on to QQmlImportInstance. This is done using
QQmlType::RegistrationType, which gets another entry for "any type". If
the expected type is CompositeSingletonType QQmlTypeData::resolveType()
will not create a non-singleton type. If it is any specific other type,
it will not create a composite singleton. And if it is
AnyRegistrationType, it will behave as it previously did.
Change-Id: I6b7e082b63582e0aed946bb3d19077b94c7a45f7
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a qml file uses a qml singleton, we need to reliably detect when
the singleton changes and re-generate the cache of the qml file using
it. This is a scenario covered and fixed by commit
5b94de09cc738837d1539e28b3c0dccd17c18d29, with the exception that
currently QML singletons registered via qmlRegisterSingleton were not
added to the list of dependent singletons for a qml file. We can fix
this by extending findCompositeSingletons() to also cover the singletons
that do not originate from a qmldir file.
[ChangeLog][Qt][Qml] Fixed bug where sometimes changes to a qml
singleton would not propagate to the users or cause crashes.
Task-number: QTBUG-62243
Change-Id: I16c3d9ba65fd82e898a29b946c341907751135a9
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
| |
Task-number: QTBUG-61536
Change-Id: Ia2b5cfeab093d8be91728032528788dd238c2872
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The QML engine destructor as well as trimComponentCache()
do now clean out unused composite types that the engine
registered internally.
This helps avoid 'static' leaks, when more and more types
would get registered by the engine.
Task-number: QTBUG-61536
Change-Id: I5b32af4b88fbf626de8c0bfbaedb2285b09e3679
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
QQmlType is now refcounted, and we need to use it by
value, to control it's lifetime properly. This is
required, so we can clean up the QQmlMetaTypeData
cache on engine destruction and with trimComponentCache()
Task-number: QTBUG-61536
Change-Id: If86391c86ea20a646ded7c9925d8f743f628fb91
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
After commit 709f6370884b110def2e4665df8fa7bbf5fae734 we required the
use of QQmlExtensionInterface_iid in qml plugins for static linkage.
This mean that plugins using the "/1.0" variant would also continue to
load, but those not would fail to load. This is annoying when porting
apps from older Qt versions.
To make the upgrade path easier, let's just support both IIDs.
[ChangeLog][Qml] Fix loading of static qml plugins using the old plugin
interface id
Change-Id: I1c662b1fedad3f32b7dea1eddc32838d2eb9f3be
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
|
|
|
|
|
|
|
| |
Removing QT_CONFIG(library) checks around static plugin handling code
Change-Id: I5408d0fee2f58b27372c59004351f37ee8f566b9
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
| |
Change-Id: I73895a1938c60a9d83f7e8bbe306eb0c3f05a5ed
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We didn't have resolution of composite types previously, which is a
prerequisite to do more exciting things with QML types in JavaScript
(such as instanceof).
By deferring the resolution to QQmlImports, we can avoid the need to
fill the cache with types that may not be needed, while still finding
types which are requested.
In the future, we could consider removing the "special" handling for composite
singletons as they should be found through QQmlImports now. If we do
that, we may still want to cache the QUrl for the types, to avoid using
QQmlImports too often directly, as it is a little slow itself.
This change doesn't regress tst_compilation.
Task-number: QTBUG-24799
Change-Id: I9ba2e4829ca49008fd180fb488c586475cf90674
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
| |
Using nested types means we cannot forward declare them, which is
basically a prerequisite for using these classes anywhere else. As we
want to do that for QQmlTypeLoader, let's untangle the knot.
Change-Id: I05fff3521cda553965ae3368eb3731265bf46a9c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
| |
This is mandatory to split some of QQmlImport's internal classes out
into headers for reuse elsewhere, as we cannot forward-declare a nested
class.
Change-Id: I6524a372a89b37a22a99ed3eada76036e10e8660
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
| |
Change-Id: Ibe21938e83571e78d1baaca4c1f4b26563ab2f3a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
| |
Change-Id: Ibf559814d3d86b23c12a194fa619c207790e1e1d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Only resolveLocalUrl if we really have to. The string manipulation are
quite expensive.
This boosts tst_compilation::bigimport a tiny bit.
Change-Id: I435633c8be9fcf4f8166900e8c0a52b320fb64d3
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
| |
Change-Id: Iee1dc32a5921b5da6d1511f26e93998baaae918e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
| |
The new name better matches what the method does. At the same time, clean it up
a little: make the flow a little clearer, extrapolate on some comments, remove
some old debug. Also add a small method doc explaining this method does.
Change-Id: I494efc2dfe8760734f228a9af440abf7067354b7
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.cpp
src/plugins/qmltooling/qmldbg_inspector/globalinspector.cpp
src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp
src/qml/qml/qqmlimport.cpp
src/quick/items/context2d/qquickcontext2dtexture_p.h
tools/qmleasing/splineeditor.h
Change-Id: I8f6630fcac243824350986c8e9f4bd6483bf20b5
|
| |
| |
| |
| |
| |
| |
| |
| | |
Instead use QT_CONFIG(foo). This change actually detected a few
mis-spelled macros and invalid usages.
Change-Id: I06ac327098dd1a458e6bc379d637b8e2dac52f85
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| | |
Use std::greater
Change-Id: I30554cd85b05e8c6ce13402d4b318751315cd0e6
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|\|
| |
| |
| |
| |
| |
| | |
Conflicts:
src/qml/compiler/qv4isel_moth_p.h
Change-Id: I8e86a649d1ef8ad27dc66cc8c290093b2faabc69
|
| |
| |
| |
| |
| |
| |
| | |
So now we can read it without getting cross-eyed.
Change-Id: Ica6a072fcd505fd4fedca3ccfac7dfc00b522354
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
| |
| |
| |
| |
| |
| |
| | |
Not all, just instances with low risk.
Change-Id: Ie6b4530f748e04ccb90e7ef23415a91d6c377417
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This method does not modify the object.
While touching the code, port loop to C++11 'range for',
and replace 0 with nullptr
Change-Id: I3695f3aa162daf0da396a0991d96ac4c438c1221
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|/
|
|
|
|
|
| |
This way we can keep the vector of plugins const.
Change-Id: Icb5e8b6f461586aecb389144603aa4f0734c304b
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|\
| |
| |
| | |
Change-Id: I326616356ee26d4532c6d57558c43c919f0a900d
|
| |\
| | |
| | |
| | | |
Change-Id: I20c622263f40c322954328e4d10a8071db3ca6d1
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
As of version 10.12 (Sierra), the name of Apple's desktop operating
system will be macOS. Change all occurrences where the Mac platform
is discussed to use the macro \macos (defined in the documentation
configuration in qtbase).
Change-Id: Iea114ac73c01d74401bcd77373b41a825d2636c9
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Use QStringBuilder more.
Use QString::asprintf instead of arg()'s chain.
Use += operator to reserve extra capacity for
possible free following append/prepend/+= call.
Change-Id: Ib65398b91566994339d2c4bbfaf94e49806b7471
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Don't allocate memory.
Change-Id: I50542bd77c9b5432d452fec2a87b6858b5c4f9c7
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
... or with QL1C in such cases:
- if there is overloaded function
- in QStringBuilder expressions
Saves ~1.5 KB in text size.
Build config: ubuntu 16.04 x64, gcc 5.3
Change-Id: Icc0789f1c244ce20a3182494b0c7f35c9d77e41d
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|\| |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Conflicts:
src/qml/qml/v8/qqmlbuiltinfunctions_p.h
tests/auto/qml/qqmlqt/tst_qqmlqt.cpp
Change-Id: I9dd93732f4b19513576ca1dd89ae18c69de0203b
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The styles are installed to eg. qml/QtQuick/Controls.2/Material.
That is, the version is in the parent module. See 3c5e438 for more
details.
Change-Id: Icdeccb356554ada74dd1116b99be198565c98de6
Task-number: QTBUG-53284
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We reverted this in 6f59c91c51edd7207635c3fa2f0b2b1179e7aa6e to avoid further
breakage in a patch release. Now let's do the right thing in the next minor
release and replace the qobject_cast on the instance with the IID check that
won't require instantiating the plugin in the qml loader thread.
[ChangeLog][QtQml][Important Behavior Changes] When the engine looks for QML
modules / extension plugins in statically linked applications, the plugins are
not instantiated in the qml loader thread anymore. For this to work however
it is necessary for plugins to use Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
in their class declaration instead of hardcoding the interface id as a string
literal.
Task-number: QTBUG-52012
Change-Id: I45fe8b9fec23b3d0408b7ee79ce297c7d47ce36d
Reviewed-by: Sebastian Lösch <Sebastian.Loesch@governikus.com>
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Doing so will spare us from creating a temporary container just to
iterate over it.
Change-Id: Iab6aec0d83bfc168f12d2348909b053dfddf67a1
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
|
|\| |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Conflicts:
src/qml/jsapi/qjsengine.cpp
src/qml/qml/qqmlengine_p.h
src/quick/items/qquickanchors.cpp
src/quick/items/qquickanimatedimage_p_p.h
src/quick/items/qquickitem_p.h
tests/auto/qml/qqmlecmascript/testtypes.h
tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
tests/benchmarks/qml/creation/tst_creation.cpp
Change-Id: I65861e32f16e8a04c7090a90231627e1ebf6ba6f
|
| |\|
| | |
| | |
| | | |
Change-Id: I6648a0ce49e0fd2b0881444bd38b9a10c093dc18
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Revert the plugin loading check for Qt 5.6.x. It turns out that making this
check strict broke multiple static plugin builds beyond the qtdeclarative
repository. Let's not cause unnecessary breakage in a patch release of Qt to
fix a bug that has existed for much longer.
I'll revert this change in the dev branch for Qt 5.8, together with an entry in
the change log to inform the developers that a behavioral change in their code
is necessary (the use of the interface id variable).
Change-Id: I3c658433eaa125ac0d272806e3bbbf016cf6d3cb
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
|
| |\|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Conflicts:
src/quick/items/qquickimagebase.cpp
src/imports/layouts/plugin.cpp
Change-Id: I5f48474df4034a1347ec74795c85d369a55b6b21
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
When instantiating static plugins no check is done whether the
QQmlExtensionInterface is declared. Therefore all user plugins are
instantiated in the Qml thread, which may cause problems.
Task-number: QTBUG-52012
Change-Id: Ia91ec5ec7b2a9721bd11e3648cdc161855b4454e
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Replace substring functions that return QString with
corresponding functions that return QStringRef where
it's possible.
Create QString from QStringRef only where necessary.
While touching the code, also port loops to C++11 style.
Change-Id: I04c99b24ea6afd3715e3edf9ea00bfab838fd53c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
For example, the QML Engine is now able to locate QtQml.Models 2.x
in both of the following target/installation paths:
- QT_INSTALL_QML/QtQml/Models.2
- QT_INSTALL_QML/QtQml.2/Models
This is required for QtQuick Controls 2. The target path of the module
is QT_INSTALL_QML/QtQuick/Controls.2. The built-in styles are installed
as sub-directories to be able to locate them from the controls module.
Some of the built-in styles provide their own C++ extensions via style-
specific imports (eg. the Material attached property is imported from
QtQuick.Controls.Material 2.0). The problem is that the QML Engine does
not find the module from QT_INSTALL_QML/QtQuick/Controls.2/Material,
but requires it to be installed outside the main controls module ie.
QT_INSTALL_QML/QtQuick/Controls/Material(.2). This makes it a) hard to
locate the styles from the main controls module, and b) conflicts with
the target path of QtQuick Controls 1.
[ChangeLog][QtQml] Made the QML Engine capable of locating QML sub-
modules from within a versioned parent module path. For example,
QtQml.Models 2.x can be either in QT_INSTALL_QML/QtQml/Models.2 or
in QT_INSTALL_QML/QtQml.2/Models.
Change-Id: I2fe4bbdd6d04dd1e80cbe9b3e7e02617658a0756
Task-number: QTBUG-52556
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
|
|/ /
| |
| |
| |
| | |
Change-Id: I7689fabb5398c2c2d2781b2c788dcc60f4e1ea44
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
|
| |
| |
| |
| |
| |
| |
| | |
Reduces the number of messages that need to be translated.
Change-Id: I986d3202ac2dcc6c8e197e19c735dd66dad37f39
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
|\|
| |
| |
| |
| |
| |
| | |
Conflicts:
tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
Change-Id: I9588a3e2c7d590e031dd4c66905a79f0d74d3ac8
|
| |
| |
| |
| |
| |
| |
| |
| | |
Composite singleton types used to always have version -1,-1; regardless
of what is written in qmldir.
Change-Id: Ia193e73695e57095f6a09b97768805f2f23cd56a
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
|