app.qmltypes is being added as a new convention to Qt 5.15. These files
are to be found next to application binaries, and contain the QML types
those application register themselves, in contrast to QML types
registered from plugins loaded via the regular import mechanism.
lib.qmltypes works the same way, in principle, for libraries. This
change only adds it to the possible names for qmltypes files, though.
Change-Id: I1d7c5835c8c3e988d214c5cdb949ca677b48dfc5
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
The reasoning in 1b4766e26c did not take into account that the scope
of QT_NO_JAVA_STYLE_ITERATORS may change over time, as done with
f70905448f6 in Qt base.
Change-Id: Ib1966ff26c4d36d5f62e149d6b45baa4aecf825d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
We'd like to make use of it in a more general context, and it's not
directly related to QML.
Change-Id: I025ec67829f85544667684cdb8c99d1ee4c18197
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
QT_INSTALL_IMPORTS and the used ProjectInfo.qtImportsPath variable
were only used for QtQuick1.
Change-Id: I34da0cfc77effa84f3a7578e7f91fed0768a9bf4
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
The introduction of Controls.2 changed the way in which imports are
resolved. This patch fix some leftovers of the old resolution scheme.
Such leftovers caused false positives in import declaration to happen
when resetting the QML/JS code model.
The code has also been simplified a little, by the removal of
duplicate code and of unused methods.
Change-Id: I90bdf7ed47fdfea7cbd8259acd7a9a968f27301b
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Easily conflicts with a macro of the same name in windows.h.
Change-Id: Ia6dfb294092497c48816e71ff901e9c3b2c8359f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Qml files used by Quick tests are not necessarily added to the
project file and therefore not fully handled by the QmlJS code
model / snapshot.
When adding qml files to a directory that is handled by the
code model these folders are not scanned again - we need to
enforce such a scan on AutoTest plugin's side.
Task-number: QTCREATORBUG-17805
Change-Id: Ie3d071a9aa03297d618648b06d52fb298c856d25
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
When rescanning imports we generally get a new version of the parent
document. When replacing the cached documents we want to release the
old ones, not the new ones. Failing to do so leads to types
disappearing from the QML code model and to leaking memory.
Task-number: QTCREATORBUG-17175
Change-Id: I3994444ac0a6cd87f9d9d0b47ab3d6015660e416
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
Previously the code model would only get updated when the document that
contains the qmlRegisterType changed. If the actual component exported
to QML lives in a different file, any updates to that component would
be lost. With this change we keep track of the header files the
components are declared in and rescan if any of them changes.
This is still not the greatest way to do it as there are a number of
ways to introduce dependencies the system cannot detect. It's better
than before, though.
Change-Id: Ic077c516dca3ac720f78973c84e5e6e91b6a5c07
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
Previously qrc paths of QML/JS documents were not considered for
implicit imports. Only the path of the document in the file system
was considered. The QML engine, however, doesn't know the original
path at all and only uses the qrc paths for import resolution. This
created a mismatch between what the QML engine could recognize and
what the code model suggested.
Without alias directives, any files imported from a qrc file would
have to reside in the same directory as the one implicitly importing
them, so this arrangement happened to work, most of the time.
In order to support aliases we have to search the files in the same
qrc path to figure out the imports. To do that, we keep a reverse
map of qrc paths to files in the QrcParser and iterate that when
resolving imports.
Change-Id: I84baae6cbfbe96ddd5322c81494c1e4a3f473f3f
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
- Use simple list instead of QFutureSynchronizer (no feature of that was
used)
- Avoid duplicate code cleaning up the current list of running futures
- Clean list of running futures after waiting for them all to finish
Change-Id: Ia13ee25ab7835fc4f4970d23d20b16cfe6bf6dfb
Reviewed-by: Marco Benelli <marco.benelli@theqtcompany.com>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
operator bool() is a trap, but with explicit it's far safer,
and we can use that now.
Change-Id: I4e58631c94e87c00256c3ab3cff4fd2c5f632713
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
Method that returns list of all project infos where this file belongs (similar to methods in cpp module).
Change-Id: I94eb86ffa5bdbee8d794377a03160418b7340662
Reviewed-by: Marco Benelli <marco.benelli@theqtcompany.com>
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
If the qmljsmodel has no background task, then isIdle returns true
Change-Id: I31420343c560c5ed118f371f7be347eadb6622f4
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
setting QT_NO_CODE_INDEXER = 1 disables the qmljs code model,
as consequence the qml designer will not work with this setting.
Change-Id: I71a2989b14e55e4d130463edd4a6459dee3cbd3d
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
First tests using the new qmljs testing architecture
Change-Id: Id88fe53dddbb720c56cd0473e74f476862feb803
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
Language::Enum -> QmlDialect
* class instead of enum
* moved Language specific operations to it (from Document)
* nicer handling
QStringList -> PathsAndLanguages
* store language along with path, to perform a correct scan and improve
path handling
Change-Id: If69d35c63cfeb48aa670b51870916cd0c40f1916
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
This removes qmakeprojectmanager and qmlprojectmanager dependency on
qmljstools.
Qmlprojectmanager still imports qmltoolsconstants.h for a constant
but that gives no runtime dependency.
Change-Id: Ifd2e76500a3b27a21937603925f03a70049900e1
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
defaultVContext did call defaultProjectInfo which could
be called only from the ui thread (as it did check the current
project)
Now update the defaultProjectInfo via signals, and lock on access
making defaultProjectInfo threadsafe.
Task-number: QTCREATORBUG-12556
Change-Id: Ibffeb59bbcef7120f08766160bb1e2ddc9af2922
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
This was an intentional, time-limited workaround that has
served its purpose now that we require C++11.
Change-Id: I96ece9c21bd405d281fd381bd9b87edc00c5ee84
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
The new function does properly update the latest snapshot.
Change-Id: If3148701e2f98c39a0822d1395b43f4fa7ee1949
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
Uniform handling of the different qml dialects.
Now paths for a given document prefer the project of that document.
For Qt the following sequence is used:
- Qt of the project of the document
- Qt of the active target
- Qt used to run creator
Currently all paths of the open projects are still merged, but that
can be changed.
Change-Id: Id302c13c893b66fbfe24e301602fe69de152eed4
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
Uniform handling of the different qml dialects.
Now paths for a given document prefer the project of that document.
For Qt the following sequence is used:
- Qt of the project of the document
- Qt of the active target
- Qt used to run creator
Currently all paths of the open projects are still merged, but that
can be changed.
Change-Id: Iacf28d63184c05e2bcdfe0210ec472d2bf140d66
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
allows to more easily scan the various qml dialects
Change-Id: I9f8c44459e05e4658d3814c624e0f07762c83279
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
Currently ModelManager contains lot logic, but as it sits in QmlJSTools
it is not possible to use it in standalone tests.
Moving most of the logic to ModelManagerInterface (and cleanup)
to allow better testing, and refactoring.
This introduces a dependency of the qmljs lib on the cplusplus lib
Also a (small) part of the CppTool::ModelManagerInterface has been
moved to CPlusPlus::CppModelManagerBase to remove the dependency on
CppTools to gather the Qml types exposed from C++.
Change-Id: Icad7fe96dfd0f1a2b1058d82bd98c77c40aa5e9d
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
Done using the following ruby script:
Dir.glob('**/*.h').each { |file|
if File.file?(file)
s = File.read(file)
t = s.gsub(/^namespace .+ \{\n\s*class .*;\n\s*\}.*$/) { |m| m.gsub(/\n\s*/, ' ').gsub(/\s*\/\/.*$/, '') }
if t != s
puts file
File.open(file, 'w').write(t)
end
end
}
Change-Id: Iffcb966e90eb8e1a625eccd5dd0b94f000ae368e
Reviewed-by: hjk <hjk121@nokiamail.com>