Commit Graph

42 Commits

Author SHA1 Message Date
Kai Koehne
5e6496f664 QmlJsEditor: Add copyright header 2011-02-18 11:50:28 +01:00
Kai Koehne
be1f662104 QmlOutline: Make QTC_ASSERT more meaningful
Split up QTC_ASSERT to maybe find out why, from times to times,
the original assert fails.
2010-12-16 13:22:19 +01:00
Christian Kamm
f366754462 Move shared code to a new QmlJSTools plugin.
Reviewed-by: Thomas Hartmann
2010-11-11 11:49:10 +01:00
Kai Koehne
ac263ef261 QmlOutline: Speed up updates
Guard the incremental updates with beginResetModel/endResetModel

This gives better overall performance then passing the incremental
updates to the views.

Tested-by: Lasse Holmstedt
2010-10-29 09:41:07 +02:00
Kai Koehne
c7e47f53bc QmlOutline: Don't use LookupContext due to performance issues
Creating a LookupContext can be sloooow for large projects. We create
one instance for every update in the Outline to get the right icons.

Take a shortcut here and just use the element name directly, ignoring
packages names etc.

This is a hot fix for 2.1, a following patch will change the Icon
retrieval API accordingly.

Reviewed-by: Roberto Raggi
Task-number: QTCREATORBUG-2859
2010-10-22 13:51:22 +02:00
Kai Koehne
87ed874600 QmlOutline: Don't allow drag&drop when outline is out of sync
The Outline is only updated (with a delay) if the current text is syntactically valid.
Prevent the outline from changing the text underneath via drag&drop if
the outline model is 'behind'.

Reviewed-by: Christian Kamm
2010-10-08 15:51:56 +02:00
Christian Kamm
70c189e2bd QmlJS: Fix instances of using lookupContext() on invalid info.
Task-number: QTCREATORBUG-2594
Done-with: Thomas Hartmann
2010-10-04 14:36:09 +02:00
Kai Koehne
1a2e16aebd QmlOutline: Show functions in outline
Reviewed-by: Christiaan Janssen
(cherry picked from commit e871b7e330)
2010-09-28 09:25:06 +02:00
Kai Koehne
b8f6156b83 QmlOutline: Fix QTC_ASSERTs (finally)
Make sure all internal hashes for an item are initialized before
inserting it into the tree.
2010-09-14 10:09:43 +02:00
Roberto Raggi
e33767205b Introduced SemanticInfo::isValid(). 2010-09-08 11:39:24 +02:00
Friedemann Kleint
444e2fd4ce Quieten gcc compiler warnings. 2010-09-07 14:34:38 +02:00
Kai Koehne
55b6cb0a96 QmlOutline: Show annotation in filtered mode
Fixes a regression.
2010-09-03 15:26:34 +02:00
Kai Koehne
1019d38944 QmlOutline: Fix QTC_ASSERTs
Initialize e.g. m_itemToNode before the view calls back to the model.
2010-08-31 10:58:08 +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
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
Kai Koehne
6cf563bb25 QmlOutline: Cut down update times considerably
Cut down update times of Outline by a magnitude by only emitting
itemChanged signal if absolutely needed. This doesn't include the change
of the icon, because QIcon is missing a comparison operator ...
2010-08-25 13:28:04 +02:00
Kai Koehne
8346e354ee QmlOutline: Always reset views
The incremental update is not working as expected.
2010-08-25 12:25:22 +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
Kai Koehne
6321ccee9e QmlOutline: Support reparenting into object array 2010-08-12 18:06:21 +02:00
Kai Koehne
d8b6fb2282 QmlOutline: Also show values of bindings in outline 2010-08-12 15:10:53 +02:00
Kai Koehne
0783b1e40a QmlOutline: Show non-leaf bindings even when filter is active
Otherwise we would filter out also e.g. all States elements.
2010-08-12 15:10:53 +02:00
Christian Kamm
0355e37e53 QuickFix: Migrate to a nicer API for cross-file quick fixes. 2010-08-12 14:21:35 +02:00
Kai Koehne
745d16b47d QmlOutline: Add support UiArrayBinding, UiObjectBinding 2010-08-10 16:34:11 +02:00
Kai Koehne
f72a080da4 QmlOutline: Also show 'name', 'target' in addition to 'id'
Search also for 'name', or 'target' properties and show them beside
the type name.
2010-08-10 15:12:09 +02:00
Kai Koehne
fe3bfad766 QmlOutline: Show id beside type name
Show id in addition to type string, but with a lighter text color
2010-08-10 14:34:56 +02:00
Kai Koehne
7a1c1a373a QmlOutline: Store relative path instead of pointer in mimetype
Don't store pointers in the drag document, but the path to the item.
2010-08-10 14:34:17 +02:00
Roberto Raggi
bf877d0aae Fixed possible crash in the outline view when processing incomplete documents.
Task-number: QTCREATORBUG-1948
2010-08-02 15:57:42 +02:00
Kai Koehne
40e36e0cd0 QmlOutline: Treat grouped property items as properties
E.g. "anchors {}" is represented in the AST as a UiObjectDefinition.
Treat it nevertheless like a property in the outline, such that it
isn't shown in the outline if you deactivate showing bindings.
2010-07-22 10:14:05 +02:00
Kai Koehne
39b1bb8bd4 QmlOutline: Replace dynamic_casts by specific AST casts 2010-07-22 10:14:05 +02:00
Kai Koehne
e708eb3d83 Qml Outline: Support rearrangement of the items via drag&drop 2010-07-21 14:14:11 +02:00
Kai Koehne
6eadeb052c QmlOutline: Show sensible tooltips
Show the same tooltips as in the text editor. To accomplish this
I refactored the QmlOutlineModel quite a bit ...
2010-07-19 14:29:55 +02:00
Kai Koehne
ef82e1db21 Show e.g. 'anchors' again in the Outline
This reverts commit 62b83fcfd, which was about filtering 'ghost'
elements out like "Rectangle { id }", where id was parsed as a
UiObjectDefinition. Unfortunately, "anchors" also is represented as
an ObjectDefinition ... Anyhow, the original problem does not
occur any more, so we can just revert this.
2010-07-16 14:10:03 +02:00
Kai Koehne
ff5506f3b9 QmlJSOutline: Optimize performance of QmlOutlineModel
Previously we're setting the properties of the items one by one, each
time potentially triggering an update of the view. Actually this
uncovered an error in the Filter, which was only reacting to the first
change and therefore didn't take the item type into account on first
load.

Instead, we now use our own QStandardItem class which can be used to
assign all values at once.
2010-07-16 14:10:02 +02:00
Kai Koehne
679ccc3b74 QmlOutline: Add filter for hiding bindings (properties) 2010-07-14 16:56:14 +02:00
Kai Koehne
3809327a68 QmlOutline: Disable debugging output
Disable output accidentally enabled in f00225a0f
2010-07-14 13:36:18 +02:00
Kai Koehne
f00225a0f5 QmlOutline: Also show custom properties
Also show properties defined in the component, e.g. by 'property x',
in the outline.
2010-07-14 13:34:19 +02:00
Kai Koehne
ce32f25ba3 QmlOutline: Show icons for known types 2010-07-14 11:40:11 +02:00
Kai Koehne
62b83fcfd2 QmlOutline: Filter out 'ghost' elements
The parser represents incomplete script bindings as element definitions,
e.g. for 'Item { id }', 'id' is represented as an UiObjectDefinition.

Catch this in the outline model by explicitly checking whether a
UiObjectDefinition starts with a capital letter.
2010-07-14 08:09:50 +02:00
Kai Koehne
8d48c51175 QmlJSEditor: Delay update of outline by 150 ms 2010-07-13 11:45:10 +02:00
Kai Koehne
9c12ef51fb QmlOutline: Show id instead of element name if available 2010-07-12 15:51:26 +02:00
Kai Koehne
94264617bf QmlJSEditor: Use QmlOutline model also in combo box
The drop down combo box and the Outline in the sidebar now share
the same model.
2010-07-12 14:46:29 +02:00
Kai Koehne
ecf2a703e2 QmlJSEditor: Moving QmlOutlineModel to it's own class 2010-07-12 14:46:29 +02:00