Commit Graph

167 Commits

Author SHA1 Message Date
Tobias Hunger
aa2acec14c Fix/add copyright headers
Change-Id: I8b73d583be1ee7183f4074bce49d5390e38631a2
2011-05-06 15:17:05 +02:00
Christian Kamm
d05992d0fa QmlJS: Stop doing significant work in constructors.
To avoid order-of-initialization problems.

Reviewed-by: Thomas Hartmann
2011-05-06 13:48:55 +02:00
Pawel Polanski
d9775a4159 Compilation fix 2011-05-04 12:13:03 +02:00
Christian Kamm
02b7eacf4b QmlJS: Fix type detection for alias properties.
Task-number: QTCREATORBUG-2306
2011-05-04 11:14:35 +02:00
Christian Kamm
a03de5f717 QmlJS: Disable unhelpful warning. 2011-04-26 14:44:53 +02:00
Christian Kamm
e21311132b QmlJS: Fix library-by-path imports.
Fixes the problem 5426c3ac2c and
7b25f438c6 worked around.

Reviewed-by: Erik Verbruggen
2011-04-21 11:16:14 +02:00
hjk
8397663964 Update license. 2011-04-13 11:49:28 +02:00
Kai Koehne
3e07024e10 QmlJS: Don't warn user about imports if static info is available
Don't underline the import if a qmldump fails,
but the typeinfo is available via a .qmltypes file. That should allow
users to 'fix' qmldump issues by shipping a .qmltypes file.

Reviewed-by: Erik Verbruggen
2011-04-12 11:27:17 +02:00
Christian Kamm
106513223d QmlJS: Fix infinite loop for objects that are attached to themselves. 2011-03-11 10:19:45 +01:00
Christian Kamm
b980a9b964 QmlJS: Fix implicit "." import when . has a QML module.
Reviewed-by: Erik Verbruggen
2011-03-10 15:03:36 +01:00
Christian Kamm
1d4cd9b7f2 QmlJS: Remove the strict separation of types and attached types.
The problem was that several lookup calls suddenly failed because
the actual QML types were no longer in the default scope chain. However,
the QML documentation says the type names are in the scope.

Also, 'MyComponent.' in a JS-expression context only showed the attached
properties of MyComponent and missed the enums.

With this change completion now may offers too many options, but that's
better than missing some.

This reverts parts of 490f2797f6

Reviewed-by: Leandro Melo
2011-02-21 15:05:04 +01:00
Christian Kamm
490f2797f6 QmlJS: Completion for attached properties. 2011-02-10 17:04:22 +01:00
Christian Kamm
187ae1e94a QmlJS: Rework FakeMetaObjects to no longer contain pointers.
Having a duplicate prototype chain - once in FakeMetaObjects and once
in QmlObjectValues was unnecessary. Now FMOs don't contain references
which may allow other simplifications.
2011-02-10 17:04:22 +01:00
Christian Kamm
660ae9b28d QmlJS: Update list of Qt object members.
That means createComponent etc. will now be completed.
2011-02-10 11:41:51 +01:00
Christian Kamm
55520a3804 QmlJS: Simplify loading types defined in C++. 2011-02-09 13:40:09 +01:00
Christian Kamm
85444451d9 QmlJS: Use / in fully qualified names to separate package and classname. 2011-02-09 10:42:49 +01:00
Christian Kamm
4fc2032e10 QmlJS: Put types with cpp names into a separate package.
In preparation of relocatable plugin types.
2011-02-09 10:42:49 +01:00
Christian Kamm
2ec429e8ce QmlJS: Switch to new format for QML meta data. 2011-02-09 10:42:49 +01:00
Christian Kamm
dd1de1b82f qmldump: Make Creator able to read qmldump's new output.
Task-number: QTCREATORBUG-3048
2011-02-09 10:42:48 +01:00
con
d1023c7614 It's 2011 now.
Reviewed-by: hjk
2011-01-12 09:46:24 +01:00
Christian Kamm
d3c1dd6a09 C++/Qml: Don't allow exported types to override builtins.
There was trouble when a plugin qmlRegisterType'd something like 'Item'
into the global default module.

Reviewed-by: Roberto Raggi
2011-01-10 14:40:40 +01:00
Christian Kamm
283a3d32cd Qml/C++: Fix performance problem with type extraction.
By moving the offending code into a background thread.

Reviewed-by: Erik Verbruggen
2011-01-06 15:02:06 +01:00
Christian Kamm
ab642bc820 QmlJS: Add refcounting to FakeMetaObjects.
Previously they were leaked when a qmldump or the C++ exported QML
type list updated.

Just deleting the previous FakeMetaObjects is not an option, as they
might still be used in a QmlObjectValue owned by an Engine.

Reviewed-by: Erik Verbruggen
2011-01-06 15:01:09 +01:00
Christian Kamm
0194da7300 Qml-C++: Find C++ qmlRegisterType calls and populate QML code model.
Reviewed-by: Erik Verbruggen
2011-01-04 15:58:22 +01:00
Christian Kamm
5de7be5f91 LanguageUtils: Add FakeMetaObject and ComponentVersion. 2011-01-04 15:58:21 +01:00
con
b1bcf081d8 Merge branch '2.1'
Conflicts:
	src/plugins/coreplugin/basemode.cpp
	src/plugins/coreplugin/basemode.h
	src/plugins/coreplugin/scriptmanager/qworkbench_wrapper.cpp
	src/plugins/coreplugin/scriptmanager/qworkbench_wrapper.h
	src/plugins/debugger/cdb/cdbsymbolpathlisteditor.cpp
	src/plugins/debugger/debuggeragents.cpp
	src/plugins/debugger/debuggeruiswitcher.cpp
	src/plugins/debugger/debuggeruiswitcher.h
	src/plugins/projectexplorer/buildconfigdialog.cpp
	src/plugins/qmldesigner/components/propertyeditor/colorwidget.cpp
	src/plugins/qmldesigner/components/propertyeditor/colorwidget.h
	src/plugins/qmldesigner/designercore/include/enumeratormetainfo.h
	src/plugins/qmldesigner/designercore/include/modelutilities.h
	src/plugins/qmldesigner/designercore/include/nodeinstance.h
	src/plugins/qmldesigner/designercore/include/propertymetainfo.h
	src/plugins/qmldesigner/designercore/instances/graphicsscenenodeinstance.cpp
	src/plugins/qmldesigner/designercore/instances/graphicsscenenodeinstance.h
	src/plugins/qmldesigner/designercore/instances/graphicsviewnodeinstance.cpp
	src/plugins/qmldesigner/designercore/instances/graphicswidgetnodeinstance.cpp
	src/plugins/qmldesigner/designercore/instances/graphicswidgetnodeinstance.h
	src/plugins/qmldesigner/designercore/instances/nodeinstance.cpp
	src/plugins/qmldesigner/designercore/instances/qmlviewnodeinstance.cpp
	src/plugins/qmldesigner/designercore/instances/widgetnodeinstance.cpp
	src/plugins/qmldesigner/designercore/instances/widgetnodeinstance.h
	src/plugins/qmldesigner/designercore/metainfo/enumeratormetainfo.cpp
	src/plugins/qmldesigner/designercore/metainfo/propertymetainfo.cpp
	src/plugins/qmldesigner/designercore/model/modelutilities.cpp
	src/plugins/snippets/inputwidget.cpp
	src/plugins/snippets/snippetscompletion.cpp
	src/plugins/snippets/snippetscompletion.h
	src/plugins/snippets/snippetspec.cpp
	src/plugins/snippets/snippetsplugin.cpp
	src/plugins/snippets/snippetswindow.cpp
	src/plugins/snippets/snippetswindow.h
	src/plugins/texteditor/snippetsparser.cpp
	src/tools/qml/qmldom/main.cpp
	tests/manual/trk/runner.cpp
	tests/manual/trk/trkolddevice.cpp
	tests/manual/trk/trkolddevice.h
	tests/manual/trk/trkserver.cpp
2010-12-17 17:00:53 +01:00
con
04e32b0049 License headers. 2010-12-17 16:03:42 +01:00
Thomas Hartmann
4ce19d4bde QmlJSInterpreter: adding public API to ASTObjectValue
Those are needed for the Visual Editor

Reviewed-by: Christian Kamm
2010-12-01 17:01:02 +01:00
Thomas Hartmann
2bb6ad4193 QmlJSInterpreter: specifying detailed types for QFont/QVector3D
We should differentiate between int and real

Reviewed-by:  Christian Kamm
2010-12-01 17:01:02 +01:00
Christian Kamm
93967104f3 QmlJS: Reactivate instantiating component scope detection.
* Bind::usesQmlPrototype is now significantly more performant
* type environments are no longer hashed by filename, but rather
  by Document *
* duplicate scope builds are avoided

Task-number: QTCREATORBUG-2835
Reviewed-by: Erik Verbruggen
2010-11-25 15:06:44 +01:00
Christian Kamm
aa2d9e6dd6 QmlJS: Return owning object from lookupMember. 2010-11-17 14:50:13 +01:00
Christian Kamm
6c9f32ba60 QmlJS: Also bind FunctionExpressions.
Reviewed-by: Erik Verbruggen
2010-11-16 15:27:26 +01:00
Christian Kamm
f7a077b1fa QmlJS: Avoid infinite loop with recursive prototypes. 2010-11-15 10:36:22 +01:00
Christian Kamm
83e7d7c350 QmlJS: Add a UrlValue.
This will allow distinguishing mere strings from urls and allow
different completion.

Reviewed-by: Erik Verbruggen
2010-11-12 10:35:41 +01:00
Thomas Hartmann
bb9a9d060f QmlObjectValue: bugifx for QmlObjectValue::propertyType()
We have to follow the prototype chain

Reviewed-by: Christian Kamm
2010-11-11 11:49:11 +01:00
Thomas Hartmann
d63199ca13 QmlJS: Resolve property types within package.
Reviewed-by: Christian Kamm
2010-11-11 11:49:11 +01:00
Christian Kamm
806c8a563d QmlObjectValue: Add convenience functionality.
Added
hasLocalProperty()
hasProperty()
keysForEnum()

Reviewed-by: Christian Kamm
2010-11-11 11:49:11 +01:00
Thomas Hartmann
ba39234627 QmlJS: Adding IntValue and RealValue
This allows to distinguish between int an real numbers

Reviewed-by: Christian Kamm
2010-11-11 11:49:11 +01:00
Thomas Hartmann
f7e7de44cb QmlJS: Dump isWritable and isPointer for types.
Reviewed-by: Christian Kamm
2010-11-11 11:49:11 +01:00
Thomas Hartmann
4255220c35 QmlJS: Fixing type hierarchy for holes (non exported types)
Done-with: Christian Kamm
2010-11-11 11:49:10 +01:00
Christian Kamm
8cd68b3b06 QmlJS: Fix completion for 'anchors.' and similar properties.
The detection of whether a type or one of its children is exported was
broken when we fixed the type information for the QtQuick module.

Reviewed-by: Erik Verbruggen
2010-10-27 18:19:45 +02:00
Christian Kamm
872f7eb459 QmlJS: Fix completion for enums on the global Qt object.
Reviewed-by: Erik Verbruggen
2010-10-19 11:08:09 +02:00
Christian Kamm
4751d92df4 QmlJS: Always register C++ based components with their C++ name.
This is the name that other components will refer to it by. For
instance, MouseArea has a 'drag' property with type 'QDeclarativeDrag',
since QDeclarativeDrag was only exported as Qt.Drag and QtQuick.Drag,
the type lookup didn't manage to resolve the name.
(cherry picked from commit b53ba61248)
2010-10-08 13:09:31 +02:00
Christian Kamm
6f1c1af833 QmlJS: Prepare qmldump for multiply exported C++ objects.
In the future, builtin objects are going to be exported in Qt 4.7 and
QtQuick 1.0.

Reviewed-by: Roberto Raggi
2010-10-01 10:14:29 +02:00
Christian Kamm
3f505e9982 QmlJS: Add initial 'Find Usages' support. 2010-09-24 14:11:06 +02:00
Christian Kamm
6755edc351 QmlJS: Cache some commonly used QML specific objects. 2010-09-24 14:11:06 +02:00
Christian Kamm
bfd7fd464e QmlJS: Synchronize Engine::registerValue.
When multiple threads share the Bind instance in a Document and do
lookup on the objects contained inside, that may trigger a new object
creation in some situations - which needs to be synchronized.
2010-09-24 14:11:06 +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
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
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