The idea in this approach is that we only collect those futures,
which have resulted from runAsync. The assumption is that
all tasks associated with those futures may sooner or
later finish, without the need to call qApp->processEvents().
OTOH, we don't collect fake futures coming from Utils::onFinished,
as these requires the spinning event loop in order to deliver
the onFinished signal.
So, the new joinAllThreads() method waits for all collected
futures to finish. We also _do_ want canceled and not finished
futures to finish, since even when they are canceled,
they may still be running and using the internals
of possibly destructed ModelManager. This means, we are only
waiting for other threads to be finished, without reporting
their results to e.g. onFinished() handlers.
Some tests require that all onFinished handlers are also processed.
In order to achieve this, we create a loop inside
tst_joinAllThreads() method and we call joinAllThreads(), so
it will wait for all pending queue to finish, and then we call process
events, in order to let finished futures propagate their results
to their respective onFinished() handlers.
Some handlers may have stared another threads when being processed,
so we may expect that some new futures will appear.
So, after processing the events we check if any new events
appeared, and in this case we repeat the loop.
Otherwise, we finish synchronization.
Amends: 96c860159b
Task-number: QTCREATORBUG-25350
Change-Id: I5e44150c55f6be00445a5695938482d948990c94
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
We should check for the version. For this we have to enable
semantic errors.
Change-Id: I8bedca041ebf9bbc0580b89076203e47942cc539
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
QtQuick 1.1 is not supported anymore.
Change-Id: Ibfeba6f2e0617892ea823d1043344502e4617b7a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
We use a NonIndenting rewriter and do not test the indentation.
Therefore we can trim white spaces.
Change-Id: I16e4acbbbc69568549cb679d988ff951b68f33b0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
QtQuick 2.15 is supposed to work and we can use it in some tests.
Change-Id: Ic3f6505dd5c683ec6521015b5dcd6c8f83a1171e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
It is ambiguous if QtObject and Component come from QtQml or QtQuick.
Change-Id: I2e1dd48d80ee7aec8293eac85160d62a584c2819
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Blocks are no more considered bad per se. Only if they
contain a var statement they are considered as bad and
worth a warning.
Amends 2447d1d69c.
Change-Id: I93b5e43c01059b66f3fb287772e54f3ae3e157af
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Tweak the test to allow multiple messages per line.
Task-number: QTCREATORBUG-24615
Change-Id: I662ab4801794dc3e49f68667f634337a847bc503
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
For swap we cannot provide all the arguments and they are only used in the
rewriter. So we use now a simplified notifier for all views except the
rewriter view. After the introduction of the new rewriter we can remove
the old notifier.
Task-number: QDS-4159
Change-Id: Idc91a618ea40da0bda9856888d115a84016597d5
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
QUL uses module mapping for theming of QtQuick.Controls: during
code-generation the compiler is pointed to the Controls implementation
it should use. This is done by rewriting any import of QtQuick.Controls
with the given module name. The CMake build scripts will write a file
for each target to the directory "qml_module_mappings" in the build dir,
and those files will contain the mappings used.
Fixes: QTCREATORBUG-25356
Change-Id: I3f74897836dde7717b03bd6dffa46dcc0689ffdd
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
Qt Creator required Qt 5.14 or higher. Let's removed the #idef-ed code
for building against lower Qt versions.
Add a comment in porting.h where we still need such code for sdktool.
Change-Id: Ib330275208eec4a2f285b4b9f480530c171f538a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* correct indentation after required property QTCREATORBUG-24144
* handle required <name> statement
* allow default readoly required reordering
* more permissive than the actual parser (which then will show errors
for invalid sequences)
* backport form QmlDom
Fixes: QTCREATORBUG-24144
Change-Id: I19166ca65d108d533a1ed3748c09e35bcfdbc56d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* add (multiline) template string support
templates can be nested, which means that the scanner/lexer cannot
be a simple state machine anymore, but should have a stack to store
the state (the number of open braces in the current template
string).
The lexer stare is currently stored in an int, so we abuse that and
store a the number of open braces (maximum 0x7f = 127) for at most 5
nested templates in the int after the flags for the multiline
comments and strings.
* improve representation of delimiters (==, <=, ||,... not split in
separate delimiters)
* (QmlDom backport)
Change-Id: I2b4d23b65febedef29a748f4c5f377fde27bd7fd
Fixes: QTCREATORBUG-22766
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
currently we mainly try to warn about primitive == null/undefined or
primitive === non primitive.
There are other that we could warn about null==null null==undefined,
but I feel that they might be triggered too much by clean code.
Change-Id: Id43d838d60a4e13f361be34e4bb38211777a081e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* fix ASTVariableReference::value: correctly get reference value type
by using either initialiser of bindingTarget (broken since a codemodel
update in 2018)
* disable warning for casting in bool to null comparison (it does not
cast, is always false)
* fix property checks (where skipped without default of readonly)
* remove non relevant checks (ErrInvalidPropertyType for lowercase now that custom
value types are supported, and for properties called data)
* updated import version
Change-Id: I38407acf327d0f773b38dda4c02fb4d95a420851
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* add inline components to bind.
* inserts inline components in the component that contains them (makes
Context:lookupType simpler)
* unify Context:lookupType overloads without adding extra heap allocations
using a template (avoid code duplication)
* add tests for inline components
* warn about nested components
* use model manager to load dependencies in tst_check (old test did
not load dependencies and simply skipped all checks on imports)
Fixes: QTCREATORBUG-24766
Fixes: QTCREATORBUG-24705
Change-Id: Ibcade7752cdaa08e960f66db3a724ab7fb3268cf
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This is mainly just making sure that token that are "empty" are really
empty (to avoid writing them out in the reformatter), but still
contain the correct location (for error messages using for example
firstSourceLocation()).
Introduce a SourceLocation::zeroLength() method to make this change
simpler to do.
QtCreator does not run qlalr automatically, so it is "polluted" by the
updated generated files.
Fixes: QTCREATORBUG-25198
Change-Id: I0ab19fb380ee3d9a7d9e05d104fe313468f52703
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Fixed the dependencies test.
Now it makes sure that all dependencies are loaded before evaluating
the checks, otherwise a race condition in the link process (QTCREATORBUG-25240) might give problems.
This requires running the event loop to ensure that the invokeMethod
in PluginDumper::loadPluginTypes creates the futures in the model
manager.
Change-Id: I4c0dd5cc948917e2a74fd46c3b66ee3bb5370da4
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
update imports of tst_dependencies to newer version (for Qt 5.15)
Change-Id: I095200a2fe54a059cd2d69c76b6da08ab8e596a5
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Mainly update import lists for Qt5.15 and ensure load is complete
before comparing.
Change-Id: I954cc4806d49d1a466f5e558b836ce49eb3693b0
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This will make it easier to implement custom puppets. The new connection
manager will restucture the code and it add a mechanism to capture data
too.
Task-number: QDS-2529
Change-Id: I5d15c3303ef1c9a3e25ba197d350e0d561ce813a
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Support required list properties
The corresponding rules were missing so far.
Fixes: QTBUG-85716
Change-Id: Iaf0cbfbb8736929a213bd6bf329bb2ebdde652c4
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
The failure output is not very helpful without them.
Change-Id: I827876336c3ffdebb0b071f6d1a743c6766d92fb
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Enables the user to have pixel positions in the style sheet even if the
template does not use pixel positioning.
Also adds some more ordered properties to make the test case
deterministic.
Task-number: QDS-2208
Change-Id: I79b6af0c24539d1b9eb03dcf0fb52bb078d74afe
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Also add a test case and Remove some dead code along the way.
Task-number: QDS-2071
Change-Id: If34d4e152860ec9ab098f07e36e3a5dc4368c67f
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* This seems be the correct expected outcome.
* Minor fix in SwitchTemplate
Change-Id: I5de04d943d3522a37ac1664157f384594ddddcde
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Currently, the tests fail, but the output is by and large correct.
There are some issues that still need to be analyzed.
Task-number: QDS-2071
Change-Id: Idb4618171a7256ec527368d6079c756eb734db82
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Adds classes to merge a template qml file and a qml stylesheet that have
been exported from other design tools into a resulting qml file that can
be used for further processing in Qt Design Studio.
Current issues:
* Sometimes it makes sense to define width and height
if an anchor is present, but most of the time not.
* Actually if the hierachy was defined (e.g. Text item not child of
background) most likely the anchors should be ignored.
But this would be just a "dirty" heuristic. I suggest to let the
template decide. If the template has anchors those have "precedence".
It is always possible to define templates without anchors.
Task-number: QDS-2071
Change-Id: I9159514a8e884b7ffc31897aef4551b5efbbcb87
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
The QtQuick module plugins.qmltypes in Qt 5.15.0 do not contain
QML types like QtObject. Instead, they are found in the QtQml module.
Something similar applies to QtQml and QtQml.Models and
QtQml.WorkerScript.
As Qt 5.15 can't use the "import" command in the qmldir file, this code
instead detects the 5.15 QtQuick and QtQml modules and adds the
dependent imports manually, as a workaround.
Change-Id: I982e349298eb7200372390dfc384fb43a762b253
Task-number: QTCREATORBUG-23986
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>