Guard the incremental updates with beginResetModel/endResetModel
This gives better overall performance then passing the incremental
updates to the views.
Tested-by: Lasse Holmstedt
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
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
* If possible, create LookupContexts through SemanticInfo; it caches the
linked Context and will be faster.
* Contexts now own their Engine.
Reviewed-by: Lasse Holmstedt
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 ...
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.
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.
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.
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.