Commit Graph

57 Commits

Author SHA1 Message Date
Marco Benelli 86dcf1580f qmlimportscanner: add some literal strings definitions
Change-Id: Ie65e7541b5a189867b27471b83e52dc2e4416183
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-07-12 09:33:45 +00:00
Marco Benelli c6b9d1a5b8 Use anonymous namespace instead of static declarations
Change-Id: Iced889303616fdae0074149a3f10572425275085
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-07-12 07:26:16 +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
Morten Johan Sørvig 61716e2bbc qmlimportscanner: Scan the root directory again
“qmlimportscanner -rootPath /path/to/foo” should scan
QML files in the “foo” directory.

Remove QDir::NoDot, which was added in commit 6ff0e9a6.

Change-Id: I15cc4a289cf246786cdf8fe2020c7f3d2798b7a5
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2017-09-19 08:07:40 +00:00
Liang Qi 2795ac5d59 Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts:
	src/quick/items/qquickwindow.cpp
	src/quick/scenegraph/qsgrenderloop.cpp

Change-Id: Idd7106995b5545fcac869e9056a365ef9edb36ca
2017-09-05 09:31:34 +02:00
Andy Shaw 6ff0e9a656 qmlimportscanner: Only skip debug/release directories if the path ends with them
Since the preceding path may contain debug or release in it, then we
only want to check if the path ends with it as opposed to containing it.

Change-Id: Ib4d466987fccb75771fcd2fa018b6f1375df7dc4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2017-09-04 19:38:03 +00:00
Kai Koehne fc3f8766d5 Adjust QMAKE_TARGET_PRODUCT, QMAKE_TARGET_DESCRIPTION
The product should be Qt5 (the default). The QMAKE_TARGET_DESCRIPTION is
actually less than a description but a beautified name, that is shown
e.g. in the task manager, crash reporting tool etc. Make it title case,
like most Windows applications do.

Change-Id: I570aee2c2016e78fdb7a93c2d7a66b70fdcb0cff
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-07-28 10:57:06 +00:00
Kai Koehne 11a664a752 Remove custom setting of qmake VERSION field in tools
qt_tool.prf sets the VERSION to MODULE_VERSION by default. Also,
qmake automatically makes it a quadruple for the .rc file metadata.

Change-Id: Ie2d0f2022c4416ce824a6786eef4a8c461ed70f1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-07-28 10:41:43 +00:00
Liang Qi 78dd18a0cd Merge remote-tracking branch 'origin/5.9' into dev
Change-Id: I6cbd83b61fac34c2ba6936711289ec09a490719a
2017-03-02 09:05:12 +01:00
Liang Qi afec9016d0 Merge remote-tracking branch 'origin/5.9' into dev
Change-Id: I92b13a9c1727644d63e125c1e6f1fdac72720ad7
2017-02-28 13:04:17 +01: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
Alexander Volkov febb1f721f sources: Add missing override and remove redundant virtual
Change-Id: I48e26b1491024d41ebf75d40f0d1a7e9a1b20f22
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-02-23 14:26:49 +00:00
Marco Benelli 038c98fb79 qmlimportscanner: allow "-" as value for qmlFiles
Passing "-" as an argument for -qmlFiles instructs qmlimportscanner to
read the qml file from stdin.  This is how qmlimportscanner is invoked
by qmlplugindump.

Task-number: QTBUG-58930
Change-Id: Ie43292988a31f9821887fbb704b903c03012fd3d
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2017-02-17 14:38:54 +00:00
Friedemann Kleint dc0a7d7021 Tools: Add product name, version and description to the .pro files
This information will then be visible in Windows explorer.

Change-Id: I9d2f936584308394b4e3246d57bed44083b3cbca
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
2017-01-31 08:44:36 +00:00
Liang Qi 9a272ad185 Merge remote-tracking branch 'origin/5.8' into dev
Conflicts:
	tools/qmlimportscanner/main.cpp

Change-Id: I01e17581f6691a03f83788773364d0cf96319514
2016-12-25 18:35:38 +01:00
Friedemann Kleint 68e23adeeb qmlimportscanner: Output the relative path of a plugin
Change 3c5e438890 enabling
using the target path version of a parent module made it harder
to determine the deployment target path from the module name.
Output the relative path in addition to remove the need to
do that in deployment tools.

Task-number: QTBUG-57494
Task-number: QTBUG-52556
Change-Id: Ib76f40f19b530f9351205df9109f2fef6191979d
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
2016-12-20 19:20:14 +00:00
Liang Qi 172260ebef Merge remote-tracking branch 'origin/5.8' into dev
Change-Id: I905dcd29377bf1b2e0ee086823b54277d18e78dd
2016-12-14 08:54:57 +01:00
Friedemann Kleint 4b22e2093f qmlimportscanner: Output application name in generic error messages
This makes it easier to spot issues in build logs.
Amends change a23bcdf919.

Change-Id: I68e440c2ce79504fb5f5fa08392a91d39e631e25
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2016-11-24 12:25:37 +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
Andy Shaw a23bcdf919 qmlimportscanner: When passed an invalid file/directory it should cause an error
Task-number: QTBUG-56617
Change-Id: I82eb9c07fd6350b2a63f80e62af4c0adf52656c7
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2016-11-10 09:16:30 +00: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
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
Anton Kudryavtsev 696e12d137 qmlimportscanner: fix MSVC build
MSVC does not like QStringLiteral in operator[].
And the follow-up patch, which replaces 'foreach'
with 'range for' triggers this MSVC bug.
So this prequel patch resolves 2 issues:
1. fix MSVC build - the main issue.
2. de-duplicate QStringLiteral data (.rodata)
   - as drive-by issue.

Change-Id: Ic6607edf324e9330d2b8dccd34561abb90f79cf1
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
2016-08-18 08:43:24 +00:00
Anton Kudryavtsev a61dafa2f5 qmlimportscanner: use QStringLiteral more judiciously
Replace it with QL1S or with QL1C in QStringBuilder expressions

Change-Id: I894c546d2d010a713cc476d60b7966e77df996af
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-08-18 08:05:33 +00:00
Anton Kudryavtsev 829c8faee2 tools: use QStringRef more
Change-Id: I4fccbfb2b965daf3a31846d1d51d39eb74ad944d
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-08-12 12:09:35 +00:00
J-P Nurmi 42fd8ec249 Fix qmlimportscanner to find Qt Quick Controls 2 styles
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: Id5083c7934071666dd5e11511f16dea07d3104bf
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-05-02 16:05:27 +00:00
Liang Qi 20a51e87fd Merge remote-tracking branch 'origin/5.6' into dev
Conflicts:
	.qmake.conf

Change-Id: I356ec83cf687bd2833f9a7c5e820d56b1efa8979
2016-02-12 10:53:43 +01:00
Anton Kudryavtsev 151fd89616 QuickTest, QmlImportScanner: replace QStringLiteral with QLatin1String
... in string comparisons. It's more efficient.

Change-Id: Ia157618cf870870f24c4a2962a385962da819275
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-02-10 11:17:14 +00:00
Liang Qi 1e421097f0 Merge remote-tracking branch 'origin/5.6' into dev
Change-Id: Iec1b2de53c275996364c4bab0123ccb3e6e9895e
2016-01-29 13:01:22 +01:00
Marco Benelli 187a5b0c6e qmlimportscanner: do not use local predicates.
Some (?) pre C++11 compilers are not able to resolve template arguments
for std::find_if when the predicates are local to the function.

Change-Id: I1e5c4adc3409bd32081ddedff158ab9dcc2eaa9a
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-01-28 10:19:23 +00:00
Jani Heikkinen 38ec3bd755 Updated license headers
From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some
exceptions, see
http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/

Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one
(in those files which will be under GPL 3 with exceptions)

Change-Id: I04760a0801837cfc516d1c7c02d4f503f6bb70b6
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-01-20 11:46:25 +00:00
Friedemann Kleint b35301f0b1 qmlimportscanner: Improve command line help.
Output example line containing the Qt import path ready for
copy & paste.

Task-number: QTBUG-48424
Change-Id: I44d0793ade4322d376ed2b72e5c3935b19ba2c7d
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
2015-11-16 08:42:27 +00:00
Marco Benelli bb28b13d51 Skip designer-related directories while scanning imports.
The qtcreator's qmldesigner plugin contains some directories that are
not reacheable during the import scan, resulting in qmlplugindump
complaing for missing dependencies.
Since these components are not needed, let the scanner just ignore
them.

Change-Id: Icdf7c9e841cf5bcc1e737a0fc75a63b1e02f87f9
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
2015-10-19 06:46:05 +00:00
Friedemann Kleint 16154fba86 Tools: Fix single-character string literals.
Use character literals where applicable.

Change-Id: I55679dcc13c4c79567712c0dfaaabc2b84fee010
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
2015-10-13 13:40:44 +00:00
Frank Meerkoetter a450f2807d Remove unused QQmlPool
This code is no longer in use.

Change-Id: If0cb009ac6622ed36cba5886d6685d3f242c3c87
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-07-31 07:14:28 +00:00
Sérgio Martins 73b77bc512 Use by-ref in foreach when T is large or non-trivial
Change-Id: I79271fdc3fa064e362dfaa64ff11d8a4c6b7e8c3
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-07-18 19:41:11 +00:00
Lars Knoll 0a499043fb Get rid of qv4value_inl_p.h and replace it by qv4typedvalue_p.h
This is a cleaner separation and further reduces include dependencies
in the definitions of our basic data structured.

Change-Id: I18aa86cdea0c0dfbc16075d4d617af97e638811e
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-04-24 15:20:43 +00:00
Jani Heikkinen c5796292ad Update copyright headers
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>
2015-02-12 10:28:11 +00:00
Simon Hausmann 9d7b27f5bf Clean up JS .import/.pragma directive scanning
There's a scanner in QQmlJS::Lexer::scanDirectives that can parse those, so
let's get rid of extra parser that operates on a string. Instead this way we
can do the scanning all in one shot, avoid detaching a copy of the source code
string and (most importantly) bring the parser closer to the copy in Qt
Creator, which uses the directives approach to extract imports and pragma.

Change-Id: Iff6eb8d91a45d8a70f383f953115692be48259de
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@theqtcompany.com>
2015-01-08 22:08:19 +01:00
Shawn Rutledge 3ec6520117 qmlimportscanner: parse "depends" lines in qmldir files
These lines specify additional hidden dependencies.  The first use case
is in QtQuick.Dialogs: DefaultFileDialog.qml uses FolderListModel, but
this file is not listed in the qmldir because the decision whether to
use it is made at runtime.  So QtQuick.Dialogs qmldir contains this:
depends Qt.labs.folderlistmodel 1.0

Task-number: QTBUG-41489
Change-Id: Ide4bca2ce2e342b95e9a87cc418d26f331372d12
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-10-01 14:40:52 +02:00
Fawzi Mohamed 26387cf498 qmlimportscanner: allow a qmlFile to come from stdin
Change-Id: I22b0e45a8aa25d232791cdbeca15b5bc7400ae7d
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2014-09-25 16:13:34 +02:00
Jani Heikkinen e7ceacda70 Update license headers and add new licenses
- 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>
2014-08-25 11:28:46 +02:00
Simon Hausmann 41f0925dc8 Fix parsing of JS imports from JS files
If a .js file had an import of another .js file itself, like so:

    .import "otherFile.js" as Blah

then the import scanner would keep the quotes and store

    "\"otherFile.js\""

in the JSON as opposed to

    "otherFile.js"

This is fixed by making use of the same code for extracting the .import
statements from JS files that is also used by the engine itself.

Additionally this fixes the use of comments in .import lines (and other
whitespace characters not producing tokens).

Change-Id: I4dd4a5217308f6fc93b6b148cd8e13392f97d2a6
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-04-24 15:36:42 +02:00
Morten Johan Sørvig f7a8a41e48 Add support for scanning javascript files.
Javascript may contain ".import" pragmas/statements,
which should be treated in a similar way as qml file
imports.

Add findQmlImportsInJavascriptFile() which extracts and
parses the .import lines. Refactor findQmlImportsInFile()
to handle both .qml and .js and call out to the correct
parsing function.

Add "-jsFiles" for specifying javascript
files on the command line similar to "-qmlFiles".

Task-number: QTBUG-35349

Change-Id: I6b8e0cc254c1edcf16940bec5cfda7c2637f115e
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-02-25 17:08:02 +01:00
Morten Johan Sørvig 2dc69a99f0 Improve qmlimportscanner.
Fix several qmlimportscanner defects:

- Expand qml file search to include subdirectories.
This applies to search paths specified with "-rootPath"

- Add "-qmlFiles" for specifying the file list directly

- Parse files with UTF8 BOMs correctly

- Don't set properties where the value is the empty string

Change-Id: I81a538d73487b49fb635c18ef4fe479748ba0bfc
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2013-11-12 13:12:54 +01:00
Oswald Buddenhagen a9a3063230 simplify host_build logic again
qt_tool handles bootstrapping fully automatically.

This reverts commit 0fc040ef70,
and adds some more.

Change-Id: Icffcf7f487dbf660678c7ee622f94b1063fef7e3
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-10-25 18:54:35 +02:00
Oswald Buddenhagen aa07ab4562 remove useless CONFIG-=app_bundle
qt_app.prf does this for us.

Change-Id: Ifdbed1028a170f1a5040d9ef38c0adc89ed6da52
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-10-25 18:54:28 +02:00