Commit Graph

1390 Commits

Author SHA1 Message Date
Orgad Shaneh
f392d94f6b QmlJS: Add a missing break
Detected by GCC7

Change-Id: I554e33fb709188acf780673705315091a526242e
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2017-06-07 07:38:04 +00:00
Orgad Shaneh
8430da3bf7 Merge remote-tracking branch 'origin/4.3' into master
Change-Id: I01ab8c85ea3372b6dce4142ddb9cf92d903ffca6
2017-05-23 23:41:40 +03:00
Thomas Hartmann
c515f68786 QmlJS: Allow Loaders in ui.qml files
Loader are working in the designer and we will add more support for
them in the future.

Change-Id: Ied62d65b0eb9933b44a7833ccafcb934d4ae6fba
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-05-22 14:19:02 +00:00
Tim Jenssen
19239e3770 QmlJs: use initilizer_lists for pairs
Change-Id: I0386d57ad3549814ab197c4e24549705e061c95a
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2017-04-27 07:45:06 +00:00
Christian Stenger
e821b98c11 QmlJS: Fix compile using Qt5.6 on macOS
Change-Id: I3d8dd1ad1d149be24d9a3af1c9a5e8bfb4228c67
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-04-24 05:03:38 +00:00
Eike Ziller
dae2556d2f Merge remote-tracking branch 'origin/4.3'
Change-Id: I44511e06986b7df6007be7daf7051c895a10794b
2017-04-21 15:30:00 +02:00
Montel Laurent
158ab3316e Use QString::*Ref method
Change-Id: I63a10f274dd17e08b5b8a2577762cc9f7960b5af
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-04-21 12:04:38 +00:00
Montel Laurent
86ea365a0b Use const'ref in theses methods
Change-Id: Idfa5ffdcf23d1ef80442276690b8082b8279dbfa
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-04-21 07:58:39 +00:00
Thomas Hartmann
e2be021cba Fix dead store
Change-Id: Ia7547803a379cd0518fdf3d707717f1bc9976dd1
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-04-20 08:01:12 +00:00
Eike Ziller
88897f3a87 Merge remote-tracking branch 'origin/4.3'
Conflicts:
	src/plugins/genericprojectmanager/genericproject.cpp
	src/plugins/genericprojectmanager/genericproject.h
	src/plugins/genericprojectmanager/genericprojectnodes.cpp
	src/plugins/genericprojectmanager/genericprojectnodes.h

Change-Id: Ie0c870f68c8d200a75489b75860987655b2f6175
2017-04-19 09:56:14 +02:00
Montel Laurent
5d27bc747b Use QFileInfo::exists(...) which is faster that QFileInfo(..).exists
Change-Id: I0d2e61d84c74e60ef4f54074a4ca00f2d0835562
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-04-14 13:18:28 +00:00
Montel Laurent
f18ae4ff6f Don't use return keyword when not necessary
Change-Id: I4b9fad1eee60e942ddbccda53a4af27e978df498
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-04-14 11:02:14 +00:00
Robert Loehning
6344815d0d QmlJS: Abort if file could not be opened
Change-Id: Ic2175c2b8dc6ec8ce378db07bdd2b667b15f70cb
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2017-04-07 10:23:33 +00:00
Marco Benelli
d0823cd5e2 QmlJs: fix reformatting of 'signal' statements
Reformatting 'signal' preceded by comments used to bring to a bad
formatted file.

Task-number: QTCREATORBUG-17886
Change-Id: I02e093a4721cd1e75d45b498ea768251aee88ea4
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-04-07 05:32:20 +00:00
Robert Loehning
ad92439930 qmljs/qmljsdescribevalue: Remove pointless check
Change-Id: I4b932550ccaebd8b02d52da2b00c158011cbc4bf
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
Reviewed-by: Christian Kamm <mail@ckamm.de>
2017-04-05 09:36:07 +00:00
Robert Loehning
a49df50443 qmljs: Prevent possible nullptr access
Change-Id: Ice4a2dd102ed4afda351dc7d011752120d3952b5
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
Reviewed-by: Christian Kamm <mail@ckamm.de>
2017-04-04 08:57:51 +00:00
Thomas Hartmann
9089fbdfc5 QmlDesigner: Allow Dialog in .ui.qml files
The support is not perfect, but I see no reason to
excplitly not allow it.

Change-Id: I6b1d825acde156cc7b50160060e89bb964667ab8
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-03-31 08:56:18 +00:00
Thomas Hartmann
7ff7aefeb3 QmlJS: Add special severity for loading type information
The designer has to be able to handle this error/warning
explicitly. To be able to identify the warning I added
a special severity.

Change-Id: I99571497f7327a7857244ef48334c14a254c8ca0
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2017-03-30 13:07:28 +00:00
Marco Benelli
24ff3a2cbd QmlJs: fix compile-time condition
The update of the qmljs parser changed the 'ifndef QT_NO_TEXT_CODEC'
condition to 'if QT_CONFIG(textcodec)' that causes a compilation
failure on some platforms.  Since QtCreator does not support development
against a Qt version without the feature, the condition is removed.

Change-Id: I18e69eee2b6996233562fbfcf7f29ad619911d8b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-03-23 14:30:26 +00:00
Marco Benelli
61d30a20ce QmlJs: sync qmljs parser
The last version of the grammar contains some constructs that the code model
needs to know.

Task-number: QTCREATORBUG-17842
Change-Id: I6250f96431acc05b19f3fd1b6cc268a07485cf0f
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-03-23 07:50:26 +00:00
Robert Loehning
5c3fce7f97 QmlJS: Fix version detection in updateProjectInfo
Change-Id: Ib8b53e8fdf5e69caf843a34390e820e9221a8be5
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2017-03-15 18:43:16 +00:00
Orgad Shaneh
cf93b4cc03 Merge "Merge remote-tracking branch 'origin/4.2' into 4.3" into 4.3 2017-03-14 14:42:07 +00:00
Robert Loehning
2d703c7dd4 qmljs/parser: Remove check for impossible value
Change-Id: Ide23dd761016a37ef4720c7637818e20925df7d7
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-03-14 14:25:53 +00:00
Orgad Shaneh
da7cb91446 Merge remote-tracking branch 'origin/4.2' into 4.3
Change-Id: I4931dcc81be872d7712e67123e94d15ee696459f
2017-03-14 16:20:14 +02:00
Samuel Gaist
4033471aa9 QRegExp include cleanup
This patch adds the missing include statements for QRegExp.

Change-Id: Ibb03b929940adb84ae190b5090cb6b88653cc14c
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-03-13 22:05:30 +00:00
Robert Loehning
5f95b61b2b qmljs: Remove dead code
Change-Id: I2b9cdf9960a28c952905e11332f029e1503850ce
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2017-03-10 10:00:58 +00:00
Christian Stenger
05e8f34d3e QmlJS: Allow forced rescan on already known paths
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>
2017-03-08 08:57:34 +00:00
Tim Jenssen
2631ffabd5 Remove spaces in initializer lists
Format initializer lists code style like.

Change-Id: Ib82c235e4ba7dc75ee96a7abc0c47eff7b0a9013
Reviewed-by: hjk <hjk@qt.io>
2017-02-22 16:25:09 +00:00
Thomas Hartmann
fb14b4a6c8 QmlDesigner: Allow qsTranslate in .ui.qml files
Also adding the NoOp functions. They can be used in models.

Task-number: QTCREATORBUG-17714
Change-Id: Ide9745613850580f0098d2fa7f8889809d18bd45
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2017-02-13 16:01:11 +00:00
hjk
56409f5afa Replace a few occurrences of QStringList() << ...
... by something shorter.

Change-Id: I363b4e509adb07997517b2d233246a333aea4aea
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-02-08 11:21:45 +00:00
Marco Benelli
1134c097e2 QmlJs: reformatter for multiline-comments
Fix a reformatter bug that causes wrog indentation of multiline
comments.

Task-number: QTCREATORBUG-17426
Change-Id: I05493638dda0a353f5901fd95f06dc2e8e020237
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
2017-01-31 09:55:37 +00:00
Marco Bubke
7dbd869e5b Fix exports for shared libraries
We use "shared" to define a shared library and not dll.

Change-Id: Ia97ebd0042a7ef0f33eadaa448d9a44b42331ad1
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-01-16 18:21:17 +00:00
Thomas Hartmann
afb52340f6 QmlJS: Adding missing properties to Font value property
Task-number: QTCREATORBUG-17511
Change-Id: I2298bb76bc85b11954a0be1b551972dddefbebbf
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2017-01-02 14:47:35 +00:00
Tim Jenssen
1898ba5ad3 make library defines more consistency
Change-Id: I211d511667d5b9c8f518bfbe750aca4483baff62
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-12-12 14:48:34 +00:00
Eike Ziller
e487b3bd55 Merge remote-tracking branch 'origin/4.2'
Change-Id: I575f1cf98f2a4740577cdd94da21687d3392cdb7
2016-11-30 15:09:11 +01:00
Tobias Hunger
9c895ed6f1 QmlJS: Make destructor of base class virtual
Change-Id: I11233c4fde6e1db09b604965f07ae32741c1bddf
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2016-11-30 09:46:51 +00:00
Thomas Hartmann
95366d25e0 QmlJS: Fix crash in QML reformatter
This fixes a tack overflow caused by an exponential
number of combination tested.

We try to find the optimal solution for line breaks by brute force.
Unfortunately this leads to a stack overflow, if two many
line breaks are possible.

This patch limits the number of possible line break positions to 11.
If there are more possible line breaks we remove every second one.

This seems to be a reasonable enough heuristic and we deal with
a corner case anyway.

Task-number: QTCREATORBUG-17331
Change-Id: I1b80fc3eaa0e148aec30fc57ac75824181f2d883
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2016-11-30 08:30:29 +00:00
Orgad Shaneh
971292a044 Remove last nokia references in comments
Change-Id: Ic5b815061212f66af5e36396b9a2b94cfbdfbe52
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-11-24 08:35:05 +00:00
Thomas Hartmann
6890e4e131 QmlJSCheck: Allow Math. function in ui.qml files
The Math. function like Math.max() are quite useful
to define more complex layouts. Therefore we allow them.

Change-Id: Ia95dcbcc1b8e96c117650dc8643da4a9de0ecdba
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2016-11-17 10:34:56 +00:00
Dmitry V. Tchoomak
10954e07a5 QMlJSCheck: Add missed types of State changes
Change-Id: I08ed689dfa92477e35961b7b0b1d407f0c974979
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
2016-11-09 08:19:43 +00:00
Thomas Hartmann
062512a246 QmlJSCheck: Adding more unsupported in designer types
Using initializer lists looks much better.

Change-Id: I314d846a9d383dbda432cd67010d79b492f40915
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-08 16:14:18 +00:00
Leena Miettinen
8ab3d91afd QML JS: Add missing space in UI text
Change-Id: I25e525216bb6ad07c5491c7e9660c7d9becad1d4
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-04 08:36:10 +00:00
Oswald Buddenhagen
424639ecac make resource file handling able to deal with QMakeProject's VFS
resources.prf may create virtual qrc files when RESOURCES contains
non-qrc files.

Change-Id: If591de9b32b775059d67e94bc3cb06d23ee44b08
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-11-01 17:34:55 +00:00
Denis Klychkov
1872cff611 QmlJS: Fix auto-indent after an opening brace placed on a new line
Left brace wasn't handled in the expression_maybe_continuation state
of qml/js code formatter. It led to expression_or_objectdefinition
could not be continued on a new line.

Task-number: QTCREATORBUG-12326
Change-Id: Id8fcaa586000008fce72c7c0c03ed1739b1c7aa1
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2016-11-01 15:43:42 +00:00
Thomas Hartmann
3673ced26e QmlJS: Get version numbers from components
If we have a pure QML plugin with a qmldir file,
then the code model ends up without a version number.
This is bad, since the version is required for graphical tooling.

What we can do is to take the highest version number from all
components that are defined in the plugin.

Change-Id: Idb4206201efac91250100740e287676031d3016a
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-01 14:43:48 +00:00
Thomas Hartmann
2cab55ea1a QmlDesigner: Allow JavaScrip blocks in Connections in .ui.qml
Inside a Connections item JavaScript blocks should be allowed.

Change-Id: Ia6a08fc575a72980bd53a32249bf302b7a426266
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2016-10-28 14:27:58 +00:00
Ulf Hermann
424005c911 QmlJS: Release the same documents we keep before
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>
2016-10-28 11:39:18 +00:00
Thomas Hartmann
6eddf41886 Documenting QmlJS error message
I also fixed the "."

Change-Id: I65cdc6be8b2de31af411d1172780281afd20a4f9
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-10-26 16:41:53 +00:00
Thomas Hartmann
99aaf86a33 QmlJSCheck: Add error for ambiguous ids
Certain ids can be ambiguous and have name clashes with properties.
Those ids are not supported in the designer.

Change-Id: Ida293d24611c467df6ef813a541e8abfc06b51cb
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-10-26 16:08:29 +00:00
Oswald Buddenhagen
bd3f39a358 accept absolute paths in qrc file elements
while untypical, it's perfectly legitimate to have absolute paths in qrc
files. auto-generated files (like the ones created by resources.prf when
shadow-building) can make good use of them.

Change-Id: I59da260b5241096f7c44b9de5ee04f65e8c1218c
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-10-25 09:11:36 +00:00