Commit Graph

145 Commits

Author SHA1 Message Date
Ulf Hermann dae5bc672e qmlplugindump: Consistently sort composite types
Previously the sorting depended on qHash(QQmlType), which hashes a
pointer to QQmlTypePrivate. That was not very useful.

Also, the defaultCompositeTypes were only populated when dumping
builtins, and only used when dumping regular types. Therefore, whenever
they were used, they were empty. We don't have to bother with that.

Change-Id: Ibfbfc7e14bee900d617bab58cbe39d05f5fe91c3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-10-02 11:20:05 +02:00
Ulf Hermann 8af52c803b Loosen qmlplugindump's checking of URI and major version
If not given a "--strict" argument, qmlplugindump will ignore the given
major version and only check the URI as prefix, not as exact match. This
is in line with what qmlplugindump did in version 5.13 and before.

Fixes: QTBUG-78745
Change-Id: Ib2803d47e6cb60c797fec8dfaa628278307d4cd4
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-09-26 13:03:29 +02:00
Fabian Kosmale c734eb3a8b qmlplugindump: fix prototypeNameForComposite
We do not put the objects we encounter in defaultReachaleNames. Thus,
the check in prototypeNameForComposite will fail most of the time.
Instead, we now use the same check as in collectReachableMetaObjects
(that is, does the type belong to the module).

Then, we once again only collect the metaobjects belonging to the module
in objectsToMerge, and only dump the relevant properties from there.

Fixes: QTBUG-78744
Change-Id: I78cae1e56b6f59e277198f9bcd0d826c4e0978a7
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-09-25 15:20:48 +02:00
Fabian Kosmale c763c5bbe6 qmlplugindump: Handle types reexported by QtQuick
Now that our own types are not registered with qmlRegisterType<T>() anymore,
we can use QQmlType::module to decide whether a type should be included
in the qmltypes file.

We include types with no module, to support existing user code which
still calls qmlRegisterType().

Change-Id: Iee0a132bf5b3ddcdfc222ab4b2d37a1f05b1851d
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-08-22 16:13:35 +02:00
Qt Forward Merge Bot 07205972ca Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	.qmake.conf

Change-Id: I20ad6f8a260f387a3b73566a32c35a5772b401a5
2019-07-04 13:32:18 +02:00
Qt Forward Merge Bot 97aa001da9 Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	.qmake.conf

Change-Id: Icd05d016de5b4cf9af5234cb47b5c3fd0f6a053e
2019-07-03 06:11:21 +00:00
Ulf Hermann 659b575d19 qmlplugindump: dump enums also for composite types
Change-Id: I2745d3df4fca77483313c70e5433339c444c7fd4
Fixes: QTBUG-76627
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2019-07-01 11:54:23 +02:00
Richard Weickelt 4d09813242 Move creation and management of singletons to QQmlEnginePrivate
Singleton object instances were previously managed by
QQmlType::SingletonInstanceInfo and kept in a shared storage. This caused
concurrency problems when instantiating singleton instances from different
QML engines in different threads.

This patch moves the singleton house-keeping infrastructure to
QQmlEnginePrivate and makes SingletonInstanceInfo immutable.
Singleton objects are stored in a QHash with QQmlType as the key because
the qml type id might be 0 for composite singletons. The public API of
QQmlType is extended to provide more information about singleton types so that
access to SingletonInstanceInfo is not needed.

All internal accesses of singleton objects must now take the same code path via
QQmlEnginePrivate::singletonInstance<T>() which simplifies overall usage of
singletons and scatters less implementation details throughout the code base.

Task-number: QTBUG-75007
Change-Id: I13c5fd21cac2eb7291f2cbcf2c2b504f0f51a07c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-04-24 08:43:00 +00:00
Qt Forward Merge Bot 76be4abbbc Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	src/qml/compiler/qv4codegen.cpp
        src/qml/animations/qsequentialanimationgroupjob.cpp

Change-Id: I8b76e509fd7c8599d4cef25181d790ee28edab54
2019-03-13 10:10:09 +01:00
Kai Koehne c911349b8b Fix re-dumping of composite types
Just like with 'normal' types, we don't want to include composite types
that were actually part of depending imports. So we need to remove them
from the list.

This fixes an issue with QtQuick.Controls style plugins, were so
far types from QtQuick.Controls 2 imports were re-dumped.

Change-Id: Ib099ae9cfba35218cab852d4d260369c2a652727
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-03-06 12:37:41 +00:00
Kai Koehne 073977a7a1 qmlplugindump: Make compositeTypes non-static
Change-Id: Ia4f35781ed96a347464b5e423bd7446f5a7f6752
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-03-04 13:41:19 +00:00
Sergio Martins 7e6ede9d5d Fix warnings about unused Qt containers
Fixes -Wclazy-unused-non-trivial warnings, in preparation for using
gcc/clang's warn_unused attribute in all containers.

Maintainers please check if some unused variable isn't hidding an
actual bug.

Change-Id: I83c5a11aa2328db3dce4c6c402295d86ef297c83
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-11-30 10:06:55 +00:00
Qt Forward Merge Bot 1a0b06bca7 Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: I7a2b9bdb69512b2d52050d829b1b65f4fcd9d99d
2018-11-01 01:00:14 +01:00
Liang Qi 2609429d7a Merge remote-tracking branch 'origin/5.11' into 5.12
Conflicts:
	src/imports/settings/qqmlsettings.cpp
	src/quick/items/qquickwindow.cpp
	tools/qmlplugindump/main.cpp

Change-Id: I96fedbc773a110374baed79a0b7de92d65df0ed6
2018-10-29 08:10:45 +01:00
Kai Koehne 53481058c5 qmlplugindump: Hardcode QtQml and QtQuick import to 2.0
Change 8725f9873d fixed qmlplugindump to always use the current
Qt minor version for the Qt Quick and Qt Qml dependencies.

Anyhow, this is unnecessary; for the dependencies resolution only the
major type is important. Hard-coding the latest import might lead to
people unnecessarily updating the plugins.qmltypes.

Change-Id: Icc969517f268b775492f2bcc901827de64123bae
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2018-10-17 12:43:26 +00:00
Kai Koehne 7ca32bc41c qmlplugindump: Remove sigsegv handler
It's not safe to use printf and memory allocations
in a signal handler.

Task-number: QTBUG-70460
Change-Id: I2a4caf302e17992471575bd89faa505a8db4a7e3
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-10-11 08:32:16 +00:00
Kai Koehne b7f5d34602 qmlplugindump: Properly handle extension types
Extension classes do augment the primary C++ class with additional
properties that should be part of the QML type. Anyhow, they should
not be visible in the API.

The old logic tried to emulate this by making the extension
class the actual C++ type, and 'inheriting' from the normal
class by setting it in the prototype. Anyhow, this failed for
e.g. Qt3D, where there are numerous types sharing the same
extension class.

Instead, this patch fixes the issue
a) hiding the extension class metainformation itself, and
b) printing properties of the extension class as part of the
   main type.

In the QMetaObject collection phase, we now traverse the class
hierarchy using QQmlType::baseMetaObject instead of
QQmlType::metaObject.

In the generation phase, we explicitly resolve the extended type,
and dump additional properties and "DefaultProperty" information
into the main type description.

Note that the ExtendedType sets the DefaultProperty independent
of the version. Changing this would require either revisioning
the defaultProperty, or (again) splitting up the types, which
however brings other problems.

Task-number: QTBUG-70294
Change-Id: I324469152398a605fae9e5a35b619845444ac4e8
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2018-10-09 07:50:37 +00:00
Kai Koehne c481ce0789 qmlplugindump: Fix calling of qmlimportscanner on Windows
Change-Id: I16618f0858b3fa878b4255147291c011efdacfc8
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2018-10-09 07:50:25 +00:00
Kai Koehne f24b3dacd0 qmlplugindump: Mark qsigSegvHandler with Q_NORETURN
Change-Id: I4b25bbe4f777f524762e6f3f15df9fc358a46da6
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2018-09-24 06:37:07 +00:00
Kai Koehne a836aee75c qmlplugindump: Add spaces to stderr output
Change-Id: Ib24b06a3c5dcdf99306fd4ecdf79e1846e492c9b
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-09-24 06:36:54 +00:00
Kai Koehne 638f80c317 qmlplugindump: Remove path for -dependencies argument
Do not print the full path passed to -dependencies in the file header.
This avoids local paths to show up in the plugin.qmltypes file, and
therefore in the Qt checkout.

Task-number: QTBUG-70264
Change-Id: I7870d7d4e30e57684c62f4e353a6bf6d72dc5faf
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-09-06 12:20:42 +00:00
Kai Koehne 8725f9873d qmlplugindump: Automatically use most up to date QtQuick version
QtQuick / QML minor version is nowadays the same as the Qt minor
version.

Change-Id: I4d7ef0b101320ee2179746c95093b62e063adba2
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-08-30 13:42:37 +00:00
Shawn Rutledge 499ec43937 use nullptr consistently (clang-tidy)
From now on we prefer nullptr instead of 0 to clarify cases where
we are assigning or testing a pointer rather than a numeric zero.

Also, replaced cases where 0 was passed as Qt::KeyboardModifiers
with Qt::NoModifier (clang-tidy replaced them with nullptr, which
waas wrong, so it was just as well to make the tests more readable
rather than to revert those lines).

Change-Id: I4735d35e4d9f42db5216862ce091429eadc6e65d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-02-26 07:13:18 +00:00
Lars Knoll 55a671ea73 Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts:
	src/qml/compiler/qv4compileddata.cpp
	src/qml/compiler/qv4compileddata_p.h
	src/qml/jsruntime/qv4engine.cpp
	src/qml/jsruntime/qv4qmlcontext.cpp
	src/qml/jsruntime/qv4qmlcontext_p.h
	src/qml/jsruntime/qv4regexpobject.cpp
	src/qml/jsruntime/qv4regexpobject_p.h
	src/qml/types/qqmllistmodel.cpp
	src/quick/items/qquickanimatedimage_p.h
	src/quick/scenegraph/qsgrenderloop.cpp
	tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp

Change-Id: If20ef62b2c98bdf656cb2f5d27b1897b754d3dc0
2017-09-20 14:27:41 +02:00
Marco Benelli 9464138014 qmlplugindump: skip imports containing "private"
Skipping paths that ends with "private" is not enough.

Task-number: QTBUG-47027
Change-Id: I25af518b76f594c268db6b77dbafd343f2f57ee8
Reviewed-by: Teemu Holappa <teemu.holappa@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2017-09-08 08:42:34 +00:00
Simon Hausmann 51763b1b19 Merge remote-tracking branch 'origin/5.9' into dev
Conflicts:
	tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp

Change-Id: I31375151eb239f348bec988d2d0506c2b4d9604c
2017-08-23 13:48:29 +02:00
Marco Benelli 93ff90d943 qmlplugindump: fix bug in reading command line
Task-number: QTBUG-58264
Change-Id: I317fb18d9ceb8738f2f132b8703dc1af3b17d35b
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2017-08-21 06:56:03 +00:00
Simon Hausmann 43a615e309 Merge remote-tracking branch 'origin/5.9' into dev
Conflicts:
	src/qml/compiler/qqmltypecompiler.cpp
	src/qml/jsruntime/qv4qmlcontext.cpp
	src/qml/jsruntime/qv4qobjectwrapper.cpp
	src/qml/qml/qqmlcustomparser.cpp
	src/qml/qml/qqmlimport.cpp
	src/qml/qml/qqmlimport_p.h
	src/qml/qml/qqmlmetatype.cpp
	src/qml/qml/qqmlmetatype_p.h
	src/qml/qml/qqmltypenamecache.cpp
	src/qml/qml/qqmltypenamecache_p.h
	src/qml/qml/qqmltypewrapper.cpp
	src/qml/qml/qqmltypewrapper_p.h
	src/qml/qml/qqmlvmemetaobject.cpp
	src/qml/util/qqmladaptormodel.cpp

Change-Id: Ic959d03e6f9c328fb02710d9abbb0f27cddde131
2017-08-18 11:46:11 +02:00
Mitch Curtis 2b7a9aa1c7 qmlplugindump: fix "useQApplication set but not used" build error
Change-Id: If6c3e513814a7fab62ecdf7de728939c7d61263b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-08-04 13:18:30 +00:00
Lars Knoll e61dca7268 Change data structures in QQmlMetaTypeData
Make sure any QQmlType stored in the meta type data
has a refcount of 1. This should now make it possible
to clean out unused types by iterating over the
list of types and removing those that have a refcount
of 1.

Some care is still needed for C++ registered types, that
will need to get one more refcount, so we don't accidentally
remove them.

Task-number: QTBUG-61536
Change-Id: Id2a18dae5ddcb815f34013f5fde1f05d2d9d0214
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-08-02 16:32:56 +00:00
Lars Knoll 49a11e8820 Use QQmlType by value
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>
2017-08-02 16:32:43 +00:00
Liang Qi b1fa22c168 Merge remote-tracking branch 'origin/5.8' into 5.9
Conflicts:
	src/qml/compiler/qv4ssa.cpp
	src/quick/accessible/qaccessiblequickview_p.h
	src/quick/items/qquickmousearea.cpp
	src/quick/util/qquickanimatorjob.cpp
	tools/qmlplugindump/main.cpp

Change-Id: I84474cf39895b9b757403971d2e9196e8c9d1809
2017-02-24 11:48:14 +01:00
Marco Benelli dfa468904d qmlplugindump: reports qmlimportscanner's message
Report to the user the stderr of qmlimportscanner, if needed.

Task-number: QTBUG-58930
Change-Id: Ib8ddf12cb3d18c936eb151f12991900a32175576
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2017-02-17 14:38:37 +00:00
Marco Benelli 12db36d8a6 qmlplugindump: import paths clean-up
Remove "qrc:/qt-project.org/imports" from the paths list passed to
qmlimportscanner.
qmlimportscanner will error out on a path that does not exist.
Since the internal qrc:/qt-project.org/imports path only exists if
the plugins are compiled in statically into qmlimportscanner, we
have to remove this path to stop it from erroring out.

Task-number: QTBUG-58930
Change-Id: I39525f2b6ff29c02b38f5f701342026dea871701
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2017-02-17 14:38:11 +00:00
Peter Varga 0ceac04beb Fix typo in qmlplugindump error message
Change-Id: Icbe18330ae665b693047f098e219c3b665be22e9
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-01-31 13:55:22 +00:00
Marco Benelli bdb18b5471 qmlplugindump: add -qapp option
Some modules (ie QtChart) require a QApplication instead of the
QGuiApplication that qmlplugindump use by default.
This option let the user specify if a QApplication is needed.

Task-number: QTBUG-58264
Change-Id: I10e68d0d3eab2afad315b57fef9ce92c42e70124
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
2017-01-31 09:55:19 +00:00
Liang Qi 60300fda46 Merge remote-tracking branch 'origin/5.8' into dev
Conflicts:
	.qmake.conf

Change-Id: I9d87ed86e95b5901a86cc3aa65d7ac39b0b708c2
2017-01-14 22:17:32 +01:00
Jacques GUILLOU 321726cb5e qmlplugindump : Add a "-output" argument to specify the output file
Having only the possibility to redirect the stdout of
qmlplugindump to a file is both unconvenient and unreliable
since some plugins might write content (such as logs) to
stdout, which pollute the output.

Change-Id: I8b1d482d7674945e6145d59aea839c54600e7784
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2017-01-05 16:54:38 +00:00
Liang Qi 0e80d28aa5 Merge remote-tracking branch 'origin/5.8' into dev
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
2016-12-14 19:01:23 +01:00
Marco Benelli ee347ee875 qmlplugindump: avoid warnings
Wrap all global variable in an anonymous namespace in order to avoid
compiler warnings on the uninizialized ones.

Change-Id: Ifabb790d2d76b6056d706580b9e4c0f12f5119f0
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
2016-12-08 09:17:29 +00:00
Liang Qi 5d4cbf4094 Merge remote-tracking branch 'origin/5.8' into dev
Conflicts:
	src/qml/jsruntime/qv4object_p.h

Change-Id: Iff4d3aba7710a999b8befdc493cbe959e1ce02f9
2016-11-23 10:49:37 +01:00
Friedemann Kleint 05e3cdd8ab Set Qt version on tools
Change-Id: I21d77b2eba7107528fc00db0cf5d87f8347b63be
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
2016-11-09 09:18:44 +00:00
Liang Qi cb5cbe9eb7 Merge remote-tracking branch 'origin/5.8' into dev
Conflicts:
	src/qml/compiler/qv4isel_moth_p.h

Change-Id: I8e86a649d1ef8ad27dc66cc8c290093b2faabc69
2016-09-21 09:24:03 +02:00
Marco Benelli d82ce2b82c qmlplugindump: update QtQuick references to 2.8
Change-Id: I2d418d50c6300e107795dd4ebdd95c78cb1b2175
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
2016-09-12 17:22:55 +00:00
Anton Kudryavtsev 457bb7a465 tools: use const (and const APIs) more
For CoW types, prefer const methods to avoid needless detach()ing.

Change-Id: If9018391c001eba3b4b2061d06c4caa8136811ab
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-08-22 16:44:33 +00:00
Anton Kudryavtsev 909d6498ed tools: replace 'foreach' with 'range for'
Catch rvalues to prevent detach()'ing.

Change-Id: I7be159a405c994429c0eee10805bfe96fcf4c806
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-08-22 08:32:23 +00:00
Anton Kudryavtsev 3ef4fac9ff tools: replace 'foreach' with 'range for'
Mark some local variables or parameters as const
to prevent detach()'ing.
Use qAsConst where is not possible mark as const.

Change-Id: I0a777c3bd855abd3bb1ad0907152360cf4a1050e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-08-20 06:52:34 +00:00
Andreas Cord-Landwehr 78f5b9e7f7 Do not override QT_QPA_PLATFORM env variables
The QGuiApplication documentation explicitly says that QT_QPA_PLATFORM
can be used to specify the QPA for every QGuiApplication. Unconditionally
overriding this value within the application is a unexpected behavior.

Task-number: QTBUG-54789
Change-Id: Ia7a61a0f2921ef8ec27fe630e8d307d20ba1eb37
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-08-16 11:24:49 +00:00
Kai Koehne ac44a5b574 qmlplugindump: Avoid warnings about missing createPlatformOpenGLContext
Fixes a regression introduced in 541eb6b704. There's no point in
setting AA_ShareOpenGLContexts for the minimal plugin.

Change-Id: Ibcc65ede41acf5a8cf22eacef4b94c20048a354a
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2016-06-29 10:06:08 +00:00
Marco Benelli 818abf6a8c qmlplugindump: add a command line option.
Add the option -noforceqtquick that prevent the inclusion of the
QtQuick dependency in the resulting qmltypes file.

Including the QtQuick dependency interfere with the generation of some
qmltypes, such that the one of QtQuick itself.

Change-Id: I63a44632b8dbabdd1ffecf16da050a9429e557da
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
2016-05-25 07:33:11 +00:00