Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Hunger
qt-creator
Commits
bb596688
Commit
bb596688
authored
Jul 15, 2010
by
Lasse Holmstedt
Browse files
fixed singleselection for states qml file
parent
0cfcb27a
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/qmljseditor/qmljseditor.cpp
View file @
bb596688
...
...
@@ -1002,6 +1002,11 @@ protected:
return
(
cursorPositionEnd
>=
begin
&&
cursorPositionStart
<=
end
);
}
bool
isRangeSelected
()
const
{
return
(
cursorPositionStart
!=
cursorPositionEnd
);
}
virtual
void
postVisit
(
Node
*
ast
)
{
if
((
cursorPositionStart
==
cursorPositionEnd
&&
!
selectedMembers
.
isEmpty
()))
...
...
@@ -1011,12 +1016,13 @@ protected:
unsigned
begin
=
member
->
firstSourceLocation
().
begin
();
unsigned
end
=
member
->
lastSourceLocation
().
end
();
if
((
cursorPositionStart
!=
cursorPositionEnd
&&
intersectsCursor
(
begin
,
end
))
||
(
cursorPositionStart
==
cursorPositionEnd
&&
containsCursor
(
begin
,
end
)))
if
((
isRangeSelected
()
&&
intersectsCursor
(
begin
,
end
))
||
(
!
isRangeSelected
()
&&
containsCursor
(
begin
,
end
)))
{
if
(
UiObjectInitializer
*
init
=
initializer
(
member
))
{
for
(
UiObjectMemberList
*
it
=
init
->
members
;
it
;
it
=
it
->
next
)
{
if
(
isAcceptableParent
(
member
))
{
if
((
isRangeSelected
()
&&
isAcceptableParent
(
member
))
||
(
!
isRangeSelected
()
&&
isIdBinding
(
it
->
member
)))
{
selectedMembers
<<
member
;
// move start towards end; this facilitates multiselection so that root is usually ignored.
cursorPositionStart
=
qMin
(
end
,
cursorPositionEnd
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment