Commit Graph

1034 Commits

Author SHA1 Message Date
Tim Jenssen
a9221a53d8 QmlJS: improve static initializings
Change-Id: Ifa37c912d0e43bcda896cb0ea851f97566c88d78
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2016-09-21 12:05:23 +00:00
Orgad Shaneh
b8c99a66b3 QmlJS: Replace macro usage with HostOsInfo
Change-Id: Ie1e7c5eb5a5f700ae63b4bcc6c1a9b1a4ed7a426
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2016-09-12 13:21:03 +00:00
Marco Benelli
cc996134de QmlJs: more informative warning message for Javascript
The warnings for Javascript follows the rules of JsLint, that can be
non-obvious to the user.  This patch add a reference to the relevant
section in QtCreator documentation.

Task-number: QTCREATORBUG-16771
Change-Id: I64ce331c6adf4b45c2510e35d68a6ce7e37ed6d5
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2016-09-12 12:00:07 +00:00
Marco Benelli
aecc590390 qmljs: use QRegularExpression to parse imports.
Use a regular expression to get the module name, major version and
minor version from a string representing the module import.

Change-Id: I99f85ff4844cdfba142b45b4881241a1d40b772e
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
2016-09-12 10:29:58 +00:00
Eike Ziller
c56aa52b80 Merge remote-tracking branch 'origin/4.1'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri
	src/plugins/qmakeprojectmanager/makestep.cpp
	src/shared/qbs

Change-Id: If1787ed23afa786ed2cef57f53c1db642559cbe0
2016-08-31 14:40:38 +02:00
Marco Benelli
19a9eac46e QmlJs: circular dependencies handling
Task-number: QTCREATORBUG-16585
Change-Id: Ia1e01f1314cd4022d59dc768752baaa367fe250a
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
2016-08-26 07:34:56 +00:00
Orgad Shaneh
5bc8d10baa Remove uses of deprecated QProcess::error signal
This overload of error is deprecated in 5.6.

Replace with errorOccurred, which was introduced in 5.6.

Change-Id: Iccfba7e7103b7ce377471696f1f2ec217e52c840
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2016-08-09 16:02:43 +00:00
Orgad Shaneh
670e54345c Remove use of deprecated Qt algorithms
Change-Id: Ib35cffa2d5762874feea9b1d4df7f569c0e5f496
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-08-09 13:41:25 +00:00
Erik Verbruggen
b47b9ea951 QML: Band-aid fix to prevent a crash
If the document that FindExportedCppTypes is to search is not in the
snapshot, skip over it (instead of passing the shared pointer with a
null-value inside).

Change-Id: I462e3d22aa4e1cc51e710c75ae0f9399c151240b
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2016-07-25 06:22:18 +00:00
Leena Miettinen
aa566604be QMLJS: Fix punctuation of messages
- Add full stop to the end of messages.
- Use double quotes for emphasis (instead of single quotes).

Change-Id: I5b0bd2cecda115735b67ceaab202c36ca5d81b43
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-07-20 12:06:45 +00:00
Ulf Hermann
1e7bf7f721 QmlJS: Reparse cpp types when component headers change
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>
2016-07-15 16:22:42 +00:00
Thomas Hartmann
0db6f2a372 QmlDesigner: A StateChangeScript can be the child of a State
I found this while testing our demos.

Change-Id: I575e1d2f487a2ba137ac8181f4980c30b171f726
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2016-07-01 15:29:32 +00:00
Thomas Hartmann
8e1e987dd5 QmlJS: Do not try the canonical file path
This is a real bottle neck on Windows
and I do not know of a case where it is required.

Change-Id: I99ebf3bfdd22cfb0ed82d6d39eeb83f079f654d6
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2016-06-28 13:23:26 +00:00
Thomas Hartmann
0a3f596599 QmlDesigner: Fix regression caused by semantic check
States can of course contain PropertyChanges.

Change-Id: Ie78be1db58c6820a49356b1cd70102e10211030b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-06-28 11:49:16 +00:00
Orgad Shaneh
7609e56ee3 QmlJS[|Editor|Tools]: Use Qt5-style connects
The heavy lifting was done by clazy.

Change-Id: I56550546b341d486d321329e9a90b9369d56af40
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2016-06-28 08:47:26 +00:00
Eike Ziller
07fccfe9f1 Merge remote-tracking branch 'origin/master' into 4.1
Change-Id: I56399e6938a5f5096c0b1a1561a54d34a5c96330
2016-06-27 11:40:35 +02:00
Marco Benelli
8f474cbfbe QmlJs: fixes bug in module import search.
Task-number: QTCREATORBUG-16425
Change-Id: I5fdd1a5882730c0f52dba5edb8cf8ca7092a4409
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
2016-06-23 11:55:42 +00:00
Thomas Hartmann
add3828389 QmlJSEditor: Do not allow child items for states
Task-number: QTCREATORBUG-13003
Change-Id: I30bcee12803d2b3af804625ffdf417316e3d6c32
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-06-22 15:52:56 +00:00
Eike Ziller
0e923c2a75 Merge remote-tracking branch 'origin/4.1'
Change-Id: I5cdc704c827a6f5abf4dc39e2a131d53df328bd2
2016-06-22 11:29:12 +02:00
Thomas Hartmann
89e8fd9088 QmlJS: Remove slow checks
These checks slow down linking for big projects.

Change-Id: I76a8897528b03ae3a31d5919be85c5ae7c3543a8
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-06-21 11:16:35 +00:00
Tim Jenssen
a6d21cc1f7 Qmljs: small QHash improvements
Change-Id: I79a5504c8471b66540aac8047fbcf760ceb6b10f
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2016-06-20 14:08:43 +00:00
Christian Kandeler
e1e203598d qbs build: Final steps to support building plugins "out of source".
- Use the entire Export block when creating a module, not just the
  Depends items. Adapt references to the product source directory
  and the "share" directory so that they point to the respective
  locations in the install tree.
- Install dev headers for some more plugins.
- Bug fixes & polishing.

Create a "dev installation" like this:
$ qbs qtc.make_dev_package:true qbs.installRoot:<install root>

Then build your plugin against it like this:
$ qbs qtc.make_dev_package:true qbs.installRoot:<install root>
project.qbsSearchPaths:<install root>/qbs-resources
(Using qbs from 1.5 branch; 1.5.1 requires a trivial wrapper project.)

That's all. Successfully tested with all commercial plugins on Linux.

Change-Id: Ie39c4717dafcd431c533421a15f2f898783d8521
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-06-15 12:35:55 +00:00
Ulf Hermann
e49b0670c8 QmlJS: Don't crash if the type stack is empty
Change-Id: If4e0155e8167f3edee1890dee5fd8b19623bba17
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
2016-05-31 08:11:25 +00:00
Tim Jenssen
3c2dc15f6d QmlDesigner: allow adding connections in ui.qml files
Change-Id: Ia4d9f01f41ca2bca1eca0df3cf121ae2800e31d4
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
2016-05-27 12:15:46 +00:00
Eike Ziller
0c5bae640b Merge remote-tracking branch 'origin/4.0'
Change-Id: I80bc3371c6d7cf9f2d46cbcf8e79e4761213d8aa
2016-05-27 12:01:36 +02:00
Thomas Hartmann
1628d052fc QmlJS: Ensure linkImports() can be run in standalone test
In standalone tests there is no instance of ExtensionSystem::PluginManager.

Change-Id: I890016c4e0d2fbb41cfc0a5614e936d31e43cd0f
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2016-05-26 16:03:43 +00:00
Victor Heng
11ef0db2fd QmlJS: Keep pragma directive when reformatting QML files
Change-Id: I1f11e95565a90e4fc7b908c03d49f6abbd37b8be
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2016-05-19 09:55:11 +00:00
Nikita Baryshnikov
41cf9d7b33 QmlJsLib: fix compiler warning
this 'else' clause does not guard

Change-Id: Ica781d2fe0d179107ee121badb17e2078420ffba
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2016-05-13 16:50:30 +00:00
Tim Jenssen
7e08363052 qbs build: remove unnecessary script dependency
Change-Id: I0e5764ffc9a6146932c43d96a31138451260c161
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
2016-05-13 11:42:43 +00:00
Marco Benelli
78944e60ba QmlJs: handle the undefined version in module lookup.
The module lookup used to not consider the undefined version (-1.-1) a
valid version number.  This caused QtCreator to crash because of a
failing assertion.  This patch makes the assertion more permissive and
handle the lookup of an undefined version by substituting it with an
empty string.

Task-number: QTCREATORBUG-16220
Change-Id: Iac574cfc04b4718b0d0809352e5c9456e4392e83
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-05-13 07:02:04 +00:00
Ulf Hermann
ca22051303 QmlJS: Avoid infinite loop on empty list of import paths
Change-Id: I1b7bade71226e4181b2643cabb53f934930afc81
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
2016-05-09 08:44:07 +00:00
Thomas Hartmann
cbc5f22b3b QmlJS: Allow version in parent module
Task-number: QTCREATORBUG-16145
Change-Id: I5ddbbab1c808f422ebcec1502f9b50a9bf0babb6
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
2016-05-04 11:33:23 +00:00
Marco Benelli
cc80ba2a7e QmlJS: update importFile and importModule signature.
Update the signatures of importFile and importModule overridden methods
to match the new ones in parent class.

Change-Id: I8c5e7458935f848bc3952d4c388b5385dd9a5da5
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-05-04 08:22:01 +00:00
Marco Benelli
1556a707c3 QmlJs: search for version in parent modules.
Modules used to be searched by name with optionally an attached
version.  Now, if a module with version is not found, the version is
attached to the parent module.

Task-number: QTCREATORBUG-16145
Change-Id: Ie0f30d4df64d13b3ec4c5ee38e9ad9215ae56420
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
2016-05-04 08:08:15 +00:00
Wolfgang Bremer
2f301bc45b CMake: Update qmljs codemodel
With this patch it is possible to specify QML_IMPORT_PATH in
CMake projects and QtCreator will scan those paths.
One only has to make sure that the variable which is set in the
CMakeLists.txt is also added to the CMakeCache.txt

Task-number: QTCREATORBUG-11328
Change-Id: I11c7694806664d3203d855983e7db4a89fac267d
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-04-29 09:08:05 +00:00
Tim Jenssen
c90a356be6 QMLJS: update to qmljsparser from Qt 5.6
Change-Id: I29a8e07b0b34aa5e8466021cbb71450687f7e11c
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-04-29 09:07:58 +00:00
Thomas Hartmann
1ba0e5cdf9 QmlJS.PropertyReader: Allow access to raw ast value
Change-Id: I92f9f241c9780345dd03b931232c4a811356c216
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-04-29 08:15:36 +00:00
Marco Benelli
a2fa0f76f8 qmljs: coding style.
Change-Id: Icd87c56077db1bc9be3e22e5e841ef849e81a3d2
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-04-21 10:46:56 +00:00
Marco Benelli
22acc52d71 Qml code model: handle modules dependencies.
Fix the broken hierarchies between qml objects.

Change-Id: Id36c735cab0129af382fab7b9dd90c228304168c
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
2016-04-19 11:18:21 +00:00
Eike Ziller
8a77eacf8d Merge remote-tracking branch 'origin/4.0'
Change-Id: Ied609608f6b12aa923c67777bc5a273c4d8fbcbb
2016-04-15 10:07:55 +02:00
Thomas Hartmann
354abe5ad8 QmlJS: Fix possible crash
For a valid AST id should be never empty.
A crash has been reported. though. Most likely the parser
injected a UiQualifiedId for an incomplete document.

Change-Id: Id2f1b25cf9d78982524d7aaff2b43210e1ae2a3b
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-04-13 13:13:45 +00:00
Sune Vuorela
55bfa4401f Keep readonly qualifier
Let's not reformat readonly qualifiers away. They are likely there for a
reason.

Task-number: QTCREATORBUG-15745
Change-Id: Iaab7a8edb47fccd0cf36759750500a93be45bbc2
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: Marco Benelli <marco.benelli@theqtcompany.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-04-13 07:59:44 +00:00
Eike Ziller
5c87432260 Merge remote-tracking branch 'origin/4.0'
Conflicts:
	src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp

Change-Id: I6ae2d37290643d69390f679a54f7596782f3d97f
2016-04-12 11:34:46 +02:00
Alessandro Portale
89ada77ea0 qmljs: Remove duplicated icons
This change makes qmljs reuse the equivalent icons from CPlusPlus.

Change-Id: I955fc0dd08282ed0556d804a59108a34e1212521
Reviewed-by: Marco Benelli <marco.benelli@theqtcompany.com>
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
2016-04-07 15:43:46 +00:00
Eike Ziller
1ae483fc83 Merge remote-tracking branch 'origin/4.0'
Conflicts:
	src/libs/utils/tcpportsgatherer.h

Change-Id: I495f3e05789f09efb8b1e84827893423a5b5b60c
2016-04-05 14:11:47 +02:00
Tim Jenssen
3c9a893adc QmlJS: do file name checks with platform independent functions
this fix the polluted output while QtQuickDesigner is opened

Change-Id: Icba0d76ff25ae720b5e3b3ce8cc5cecc45181241
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
2016-04-05 11:29:27 +00:00
Oswald Buddenhagen
e426d08e54 Merge remote-tracking branch 'origin/4.0'
Conflicts:
	qtcreator.pri
	qtcreator.qbs
	src/plugins/debugger/debuggerruncontrol.cpp

Change-Id: I81b43480a1369e3d7be60ae26e812dda6b962b0b
2016-04-01 17:31:39 +02:00
hjk
39a38d5679 Wholesale conversion to #pragma once
Kudos to cgmb and https://github.com/cgmb/guardonce

Change-Id: Ifa8970734b8d43fd08c9260c645bdb0228633791
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-03-30 15:20:19 +00:00
Ulf Hermann
35bafd3952 QmlJS: Fix resolution of "alias" directives in qrc files
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>
2016-03-29 11:20:57 +00:00
Eike Ziller
72af6b7834 runAsync: Remove ResultType template parameter.
It is now deduced from either the type of the
QFutureInterface<ResultType> function argument, or the return type.

Change-Id: Iddab3cc329206c649a6e55a44b2de2d406701dee
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-02-10 10:58:55 +00:00