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
fd66f686
Commit
fd66f686
authored
Feb 23, 2011
by
Christiaan Janssen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
QmlDebugger: Watchers
Reviewed-by: hjk
parent
6b123c98
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
6 deletions
+40
-6
src/plugins/debugger/debuggerplugin.cpp
src/plugins/debugger/debuggerplugin.cpp
+1
-0
src/plugins/debugger/qml/qmlengine.cpp
src/plugins/debugger/qml/qmlengine.cpp
+15
-6
src/plugins/debugger/qml/qmlengine.h
src/plugins/debugger/qml/qmlengine.h
+2
-0
src/plugins/debugger/watchhandler.cpp
src/plugins/debugger/watchhandler.cpp
+21
-0
src/plugins/debugger/watchhandler.h
src/plugins/debugger/watchhandler.h
+1
-0
No files found.
src/plugins/debugger/debuggerplugin.cpp
View file @
fd66f686
...
...
@@ -1844,6 +1844,7 @@ void DebuggerPluginPrivate::connectEngine(DebuggerEngine *engine)
m_threadBox
->
setModel
(
engine
->
threadsModel
());
m_threadBox
->
setModelColumn
(
ThreadData
::
NameColumn
);
m_watchersWindow
->
setModel
(
engine
->
watchersModel
());
engine
->
watchHandler
()
->
rebuildModel
();
}
static
void
changeFontSize
(
QWidget
*
widget
,
qreal
size
)
...
...
src/plugins/debugger/qml/qmlengine.cpp
View file @
fd66f686
...
...
@@ -231,6 +231,8 @@ void QmlEngine::connectionEstablished()
showMessage
(
tr
(
"QML Debugger connected."
),
StatusBar
);
synchronizeWatchers
();
notifyEngineRunAndInferiorRunOk
();
}
...
...
@@ -687,22 +689,29 @@ void QmlEngine::updateWatchData(const WatchData &data,
}
if
(
!
data
.
name
.
isEmpty
()
&&
data
.
isChildrenNeeded
()
&&
watchHandler
()
->
isExpandedIName
(
data
.
iname
))
&&
watchHandler
()
->
isExpandedIName
(
data
.
iname
))
{
expandObject
(
data
.
iname
,
data
.
id
);
}
synchronizeWatchers
();
{
if
(
!
data
.
isSomethingNeeded
())
watchHandler
()
->
insertData
(
data
);
}
void
QmlEngine
::
synchronizeWatchers
()
{
if
(
!
watchHandler
()
->
watcherNames
().
isEmpty
())
{
// send watchers list
QByteArray
reply
;
QDataStream
rs
(
&
reply
,
QIODevice
::
WriteOnly
);
QByteArray
cmd
=
"WATCH_EXPRESSIONS"
;
rs
<<
cmd
;
rs
<<
watchHandler
()
->
watchedExpressions
();
logMessage
(
LogSend
,
QString
(
"%1 %2"
).
arg
(
QString
(
cmd
),
watchHandler
()
->
watchedExpressions
().
join
(
", "
)));
QString
(
cmd
),
watchHandler
()
->
watchedExpressions
().
join
(
", "
)));
sendMessage
(
reply
);
}
if
(
!
data
.
isSomethingNeeded
())
watchHandler
()
->
insertData
(
data
);
}
void
QmlEngine
::
expandObject
(
const
QByteArray
&
iname
,
quint64
objectId
)
...
...
src/plugins/debugger/qml/qmlengine.h
View file @
fd66f686
...
...
@@ -146,6 +146,8 @@ private:
const
QString
&
oldBasePath
,
const
QString
&
newBasePath
)
const
;
QString
qmlImportPath
()
const
;
void
synchronizeWatchers
();
enum
LogDirection
{
LogSend
,
LogReceive
...
...
src/plugins/debugger/watchhandler.cpp
View file @
fd66f686
...
...
@@ -1656,5 +1656,26 @@ void WatchHandler::removeTooltip()
m_tooltips
->
emitAllChanged
();
}
void
WatchHandler
::
rebuildModel
()
{
beginCycle
();
const
QList
<
WatchItem
*>
watches
=
m_watchers
->
rootItem
()
->
children
;
for
(
int
i
=
watches
.
size
()
-
1
;
i
>=
0
;
i
--
)
m_watchers
->
destroyItem
(
watches
.
at
(
i
));
foreach
(
const
QString
&
exp
,
watchedExpressions
())
{
WatchData
data
;
data
.
exp
=
exp
.
toLatin1
();
data
.
name
=
exp
;
data
.
iname
=
watcherName
(
data
.
exp
);
data
.
setAllUnneeded
();
insertData
(
data
);
}
endCycle
();
}
}
// namespace Internal
}
// namespace Debugger
src/plugins/debugger/watchhandler.h
View file @
fd66f686
...
...
@@ -163,6 +163,7 @@ public:
void
loadSessionData
();
void
saveSessionData
();
void
removeTooltip
();
void
rebuildModel
();
bool
isExpandedIName
(
const
QByteArray
&
iname
)
const
{
return
m_expandedINames
.
contains
(
iname
);
}
...
...
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