Commit Graph

789 Commits

Author SHA1 Message Date
Christian Kamm
13faf49322 QmlJS: Fix segfault during import resolution. 2010-09-24 13:28:01 +02:00
hjk
7504887377 compilation fix with namespaces 2010-09-23 15:41:20 +02:00
Christian Kamm
f8c5001382 Remove the QmlJSEditor dependency from Qt4ProjectManager.
The Qt4ProjectManager now uses metacalls to inform the QmlJSModelManager
about the project data.

Done-with: hjk
2010-09-23 14:16:46 +02:00
Christiaan Janssen
0bc0a2df5a QmlObserver: showing a warning when changes cannot be synchronized
Reviewed by:  Thomas Hartmann
2010-09-22 16:30:21 +02:00
Christian Kamm
c7b3e3c81c QmlJS: Speed up Link significantly, provide more info on imports.
Link now caches imports. That means importing the same library (say, Qt)
from more than one file no longer creates an importing namespace for
each one. Instead, a single one is created for the instance of Link.

To make this work, the type environment in ScopeChain has been given its
own type: Interpreter::TypeEnvironment. That has the added benefit of
being able to carry meta-information about imports. You can use
TypeEnvironment::importInfo(qmlComponentName) to get information about
the import node that caused the import of the component.
2010-09-16 15:51:21 +02:00
Christian Kamm
97c07292aa Qml: Make import classification in Bind less verbose. 2010-09-16 15:51:21 +02:00
Christian Kamm
8df6dd6d7d QmlJS: Add initial documentation for the base classes of the code model. 2010-09-15 15:26:34 +02:00
Roberto Raggi
ba03239749 Concate strings instead of using the QDir API to speed up the linking phase.
Reviewed-by: Christian Kamm
2010-09-08 15:13:12 +02:00
Christian Kamm
f3f3b96c85 QmlJS: Improve performance by avoiding two links in SemanticHighlighter.
Reviewed-by: Roberto Raggi
2010-08-31 10:39:07 +02:00
Christian Kamm
2e8ec2f9e6 QmlJS: Fix performance problem in Snapshot.
Don't use QMultiHash::values(key), it rebuilds the values list from
scratch for each lookup.

Reviewed-by: Roberto Raggi
2010-08-31 10:25:02 +02:00
Christian Kamm
88601712c6 QmlJS: Make ScopeChain more const-correct.
We don't want people modifying the shared component chain on a
const Context *.
2010-08-30 14:12:06 +02:00
Christian Kamm
32bb7bffc0 QmlJS: Add missing null checks before using scopeChain().qmlTypes. 2010-08-30 13:35:35 +02:00
Olivier Goffart
af01698cfc qmljsdelta: Fix updating property on UiObjectBinding 2010-08-27 17:15:21 +02:00
Tobias Hunger
715796b48a Fix krazy issues: Use explicit constructors
* Fix all warnings about non-explicit constructors except for those
   in 3rdparty code.
2010-08-27 12:10:29 +02:00
Christian Kamm
1a9c69ddb0 QmlJS: Fix crash when opening JS files.
Now that Contexts are cached, it needs to be copyable. However, the
ScopeChain has a QmlComponentChain member that owns resources and didn't
have a correct copy constructor or copy assignment operator.

I've made QmlComponentChain non-copyable and store a shared pointer to
an instance instead, as it will generally not change for a given
context.

Reviewed-by: Lasse Holmstedt
2010-08-27 09:42:07 +02:00
Christiaan Janssen
7d9056953e QmlInspector: Added reparenting of items in the Qml Live Preview. Reviewed by: Lasse Holmstedt 2010-08-26 17:38:42 +02:00
Christian Kamm
cea32d6467 QmlJS: Fix possible segfaults with null documents. 2010-08-26 11:34:29 +02:00
Christian Kamm
87e04df257 QmlJS: Refactor LookupContext creation for speed.
* If possible, create LookupContexts through SemanticInfo; it caches the
  linked Context and will be faster.
* Contexts now own their Engine.

Reviewed-by: Lasse Holmstedt
2010-08-26 11:34:29 +02:00
Christian Kamm
7a8c07a1f8 QmlJS: The Script type is no longer implicitly available. 2010-08-25 14:55:16 +02:00
Christian Kamm
36e8b65d59 QmlJS: Fix running qmldump on plugins that require a specific uri.
The builtin QML plugins require to be imported with the full uri, i.e.
import Qt.labs.particles 1.0
so setting the import path to imports/Qt/labs and doing
import particles 1.0
is not supposed to work. (see QTBUG-11139)

This change adjusts qmldump to take an import path *and* the import uri,
so it will be able to dump the type information for these plugins.

Reviewed-by: Erik Verbruggen
2010-08-25 14:19:44 +02:00
Christian Kamm
898098c1f2 QmlJS: Allow lookups on const Contexts. Pass const Contexts where ok.
In preparation for caching Contexts.

Reviewed-by: Erik Verbruggen
2010-08-25 11:53:23 +02:00
Olivier Goffart
4dadefc858 Compile on windows
Apparently, it did not like ::label
2010-08-19 12:51:04 +02:00
Olivier Goffart
6b2d8118c5 qmljsdelta: little cleanup and documentation of the code 2010-08-19 11:35:39 +02:00
Thomas Hartmann
2c160a9b2a QmlJSEditor: extending IContextPane with a signal
closed() is emitted when the pane is hidden/closed.
2010-08-13 17:22:19 +02:00
Christian Kamm
6ec2174791 QmlJS: Use QmlJS::toQColor to convert a string to a QColor.
The QColor constructor prints a warning if the string it gets passed
isn't a known color name. Also, it doesn't know about the alpha value
in strings like "#ff00ff00".

Reviewed-by: Thomas Hartmann
2010-08-13 13:28:45 +02:00
Kai Koehne
6321ccee9e QmlOutline: Support reparenting into object array 2010-08-12 18:06:21 +02:00
Friedemann Kleint
1f60ac7ba0 Compile Windows. 2010-08-10 15:06:37 +02:00
Christian Kamm
822de6c17a QmlJS: Introduce a new indenter that works similarly to the new C++ one.
Done-with: Thomas Hartmann
2010-08-10 14:27:08 +02:00
Christian Kamm
f6232260c2 QmlJS: Adjust scanner to treat ++ and -- as a single delimiter token.
Reviewed-by: Roberto Raggi
2010-08-10 14:14:17 +02:00
Lasse Holmstedt
714a266cbe QML JS Inspector: Improve warning messages
When a change is done to an element that cannot be changed due to
debugger/qdeclarative limitations, a warning is shown to the user in QML
JS Editor.

Reviewed-by: Olivier Goffart
2010-08-05 16:31:13 +02:00
Thomas Hartmann
bb64cc7005 QtQuickToolbar: adds isAvailable() to IContextPane
isAvailable() returns true if a Quick ToolBar is available
for that node
2010-08-05 10:51:31 +02:00
Thomas Hartmann
0624d6ec05 QtQuickToolbar: Changes abstract interface of IContextPane
The parameter force now forces the activation of the Quick
ToolBar even if it is not shown by default (enabled).
2010-08-04 14:03:10 +02:00
Leandro Melo
e8ac7ead06 Make QML color validation code reusable.
Reviewed-by: ckamm
2010-08-02 14:56:55 +02:00
Leandro Melo
9946711166 QmlJS: Don't detect type from expression if the type is given explicitly.
To make sure
property color foo: "white"
is of type color, not string.

Done-with: ckamm
2010-07-27 13:43:51 +02:00
Leandro Melo
302e93d67f QmlJS: Set type correctly for color properties.
Done-with: ckamm
2010-07-27 13:43:50 +02:00
Olivier Goffart
713e4c2621 QmlJsDelta: give a valid label to the UiScriptBinding 2010-07-27 11:56:59 +02:00
Olivier Goffart
0ba5dc8d58 QmlJsDelta: Fix the fact that sometimes, when inserting items, the new item could match the next item 2010-07-26 13:09:56 +02:00
Kai Koehne
be777c647e QmlJS: Fix compilation warning 2010-07-23 07:46:05 +02:00
Olivier Goffart
f24216bdbb QmlJsDelta: moved to the QMLJS library
Also used 'int' instead of QDeclarativeDebugObjectReference for
the debug id in order not to use the private API from QMLJS
2010-07-21 14:27:38 +02:00
Kai Koehne
2e949c7015 QmlJS Rewriter: Remove empty grouped properties
Also remove grouped properties if the last member is removed via removeObjectMember
(removeBindingByName already takes care of this).
2010-07-21 14:14:10 +02:00
Kai Koehne
35e787e61c QmlJS Rewriter: Unify method names
changeProperty->changeBinding
removeProperty->removeBindingByName
2010-07-21 14:14:10 +02:00
Kai Koehne
74e8027a7b QmlJS Rewriter: Return ranges for addX methods
This way one can reindent afterwards.

Reviewed-by: Erik Verbruggen
2010-07-21 14:14:10 +02:00
Kai Koehne
715aafaba5 QmlJS Rewriter: Allow disambiguation of where ObjectMember should be added to
With 700975ade3 one could specify that a UiObjectMember should be inserted
after another one. But 0 'the default parameter' was ambiguous in that
either you want to have it inserted at the beginning of the member list,
or the heuristics should be applied.

Make this explicit by providing two methods.
2010-07-21 14:14:09 +02:00
Thomas Hartmann
4b863d554e QmlJS.propertyReader: check for bindings in gradients 2010-07-21 13:00:10 +02:00
Kai Koehne
7f01593b94 Compile fix 2010-07-20 15:26:57 +02:00
Kai Koehne
700975ade3 QmlJS: ALlow users of the Rewriter to specify where to insert stuff 2010-07-20 15:23:16 +02:00
Kai Koehne
3b48da9391 QmlJs: Fix corner case in Rewriter (whitespace handling)
Done by erikv
2010-07-20 15:06:28 +02:00
Kai Koehne
f0912bfe23 QmlJS: Make rewriter methods static
Done by erikv
2010-07-20 12:48:19 +02:00
Kai Koehne
7f5c790358 Compilation fix (MSVC) 2010-07-16 11:34:01 +02:00
Christian Kamm
8519ca11c3 QmlJS: Allow 'follow symbol' to jump to the target of a file import.
Task-number: QTCREATORBUG-1736
2010-07-16 11:17:10 +02:00