Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
f8fc9084
Commit
f8fc9084
authored
Jul 14, 2010
by
Lasse Holmstedt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updating selection after new tree is fetched & code cleanup
parent
032e7dc4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
19 deletions
+39
-19
src/plugins/qmljsinspector/qmljsclientproxy.cpp
src/plugins/qmljsinspector/qmljsclientproxy.cpp
+27
-16
src/plugins/qmljsinspector/qmljsclientproxy.h
src/plugins/qmljsinspector/qmljsclientproxy.h
+1
-0
src/plugins/qmljsinspector/qmljsdesigndebugclient.cpp
src/plugins/qmljsinspector/qmljsdesigndebugclient.cpp
+8
-3
src/plugins/qmljsinspector/qmljsdesigndebugclient.h
src/plugins/qmljsinspector/qmljsdesigndebugclient.h
+3
-0
No files found.
src/plugins/qmljsinspector/qmljsclientproxy.cpp
View file @
f8fc9084
...
...
@@ -128,20 +128,22 @@ void ClientProxy::onCurrentObjectsChanged(const QList<int> &debugIds)
// So the only choice that remains is to update the complete tree when we have an unknown debug id.
if
(
!
m_objectTreeQuery
)
{
m_objectTreeQuery
=
m_client
->
queryObjectRecursive
(
m_rootObject
,
this
);
if
(
!
m_objectTreeQuery
->
isWaiting
())
{
objectTreeFetched
();
}
else
{
connect
(
m_objectTreeQuery
,
SIGNAL
(
stateChanged
(
QDeclarativeDebugQuery
::
State
)),
SLOT
(
objectTreeFetched
(
QDeclarativeDebugQuery
::
State
)));
}
}
}
}
emit
selectedItemsChanged
(
selectedItems
);
if
(
m_objectTreeQuery
)
{
if
(
!
m_objectTreeQuery
->
isWaiting
())
{
objectTreeFetched
();
}
else
{
connect
(
m_objectTreeQuery
,
SIGNAL
(
stateChanged
(
QDeclarativeDebugQuery
::
State
)),
SLOT
(
objectTreeFetched
(
QDeclarativeDebugQuery
::
State
)));
}
}
else
{
emit
selectedItemsChanged
(
selectedItems
);
}
}
void
ClientProxy
::
disconnectFromViewer
()
...
...
@@ -358,49 +360,58 @@ void ClientProxy::objectTreeFetched(QDeclarativeDebugQuery::State state)
m_objectTreeQuery
=
0
;
emit
objectTreeUpdated
(
m_rootObject
);
if
(
isDesignClientConnected
()
&&
!
m_designClient
->
selectedItemIds
().
isEmpty
())
{
onCurrentObjectsChanged
(
m_designClient
->
selectedItemIds
());
}
}
void
ClientProxy
::
reloadQmlViewer
()
{
if
(
m_d
esignClient
&&
m_conn
->
is
Connected
())
if
(
isD
esignClientConnected
())
m_designClient
->
reloadViewer
();
}
void
ClientProxy
::
setDesignModeBehavior
(
bool
inDesignMode
)
{
if
(
m_d
esignClient
&&
m_conn
->
is
Connected
())
if
(
isD
esignClientConnected
())
m_designClient
->
setDesignModeBehavior
(
inDesignMode
);
}
void
ClientProxy
::
setAnimationSpeed
(
qreal
slowdownFactor
)
{
if
(
m_d
esignClient
&&
m_conn
->
is
Connected
())
if
(
isD
esignClientConnected
())
m_designClient
->
setAnimationSpeed
(
slowdownFactor
);
}
void
ClientProxy
::
changeToColorPickerTool
()
{
if
(
m_d
esignClient
&&
m_conn
->
is
Connected
())
if
(
isD
esignClientConnected
())
m_designClient
->
changeToColorPickerTool
();
}
void
ClientProxy
::
changeToZoomTool
()
{
if
(
m_d
esignClient
&&
m_conn
->
is
Connected
())
if
(
isD
esignClientConnected
())
m_designClient
->
changeToZoomTool
();
}
void
ClientProxy
::
changeToSelectTool
()
{
if
(
m_d
esignClient
&&
m_conn
->
is
Connected
())
if
(
isD
esignClientConnected
())
m_designClient
->
changeToSelectTool
();
}
void
ClientProxy
::
changeToSelectMarqueeTool
()
{
if
(
m_d
esignClient
&&
m_conn
->
is
Connected
())
if
(
isD
esignClientConnected
())
m_designClient
->
changeToSelectMarqueeTool
();
}
bool
ClientProxy
::
isDesignClientConnected
()
const
{
return
(
m_designClient
&&
m_conn
->
isConnected
());
}
void
ClientProxy
::
reloadEngines
()
{
...
...
src/plugins/qmljsinspector/qmljsclientproxy.h
View file @
f8fc9084
...
...
@@ -117,6 +117,7 @@ private slots:
void
objectTreeFetched
(
QDeclarativeDebugQuery
::
State
state
=
QDeclarativeDebugQuery
::
Completed
);
private:
bool
isDesignClientConnected
()
const
;
void
reloadEngines
();
QList
<
QDeclarativeDebugObjectReference
>
objectReferences
(
const
QUrl
&
url
,
const
QDeclarativeDebugObjectReference
&
objectRef
)
const
;
QDeclarativeDebugObjectReference
objectReferenceForId
(
int
debugId
,
const
QDeclarativeDebugObjectReference
&
ref
)
const
;
...
...
src/plugins/qmljsinspector/qmljsdesigndebugclient.cpp
View file @
f8fc9084
...
...
@@ -64,17 +64,17 @@ void QmlJSDesignDebugClient::messageReceived(const QByteArray &message)
if
(
type
==
"CURRENT_OBJECTS_CHANGED"
)
{
int
objectCount
;
ds
>>
objectCount
;
QList
<
int
>
debugIds
;
m_selectedItemIds
.
clear
()
;
for
(
int
i
=
0
;
i
<
objectCount
;
++
i
)
{
int
debugId
;
ds
>>
debugId
;
if
(
debugId
!=
-
1
)
{
debug
Ids
<<
debugId
;
m_selectedItem
Ids
<<
debugId
;
}
}
emit
currentObjectsChanged
(
debug
Ids
);
emit
currentObjectsChanged
(
m_selectedItem
Ids
);
}
else
if
(
type
==
"TOOL_CHANGED"
)
{
int
toolId
;
ds
>>
toolId
;
...
...
@@ -99,6 +99,11 @@ void QmlJSDesignDebugClient::messageReceived(const QByteArray &message)
}
}
QList
<
int
>
QmlJSDesignDebugClient
::
selectedItemIds
()
const
{
return
m_selectedItemIds
;
}
void
QmlJSDesignDebugClient
::
setSelectedItemsByObjectId
(
const
QList
<
QDeclarativeDebugObjectReference
>
&
objects
)
{
if
(
!
m_connection
||
!
m_connection
->
isConnected
())
...
...
src/plugins/qmljsinspector/qmljsdesigndebugclient.h
View file @
f8fc9084
...
...
@@ -67,6 +67,8 @@ public:
void
applyChangesToQmlFile
();
void
applyChangesFromQmlFile
();
QList
<
int
>
selectedItemIds
()
const
;
signals:
void
currentObjectsChanged
(
const
QList
<
int
>
&
debugIds
);
void
colorPickerActivated
();
...
...
@@ -80,6 +82,7 @@ protected:
virtual
void
messageReceived
(
const
QByteArray
&
);
private:
QList
<
int
>
m_selectedItemIds
;
QDeclarativeDebugConnection
*
m_connection
;
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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