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
Marco Bubke
flatpak-qt-creator
Commits
1dacb9e5
Commit
1dacb9e5
authored
Nov 05, 2010
by
hjk
Browse files
debugger: convert threads model
parent
b7796bf3
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/plugins/debugger/debuggerconstants.h
View file @
1dacb9e5
...
...
@@ -229,9 +229,6 @@ enum ModelRoles
RequestShowMemoryRole
,
RequestShowDisassemblerRole
,
// Threads
RequestSelectThreadRole
,
// Modules
RequestReloadModulesRole
,
RequestExamineModulesRole
,
...
...
src/plugins/debugger/debuggerengine.cpp
View file @
1dacb9e5
...
...
@@ -228,7 +228,7 @@ public:
m_registerHandler
(),
m_sourceFilesHandler
(
engine
),
m_stackHandler
(
engine
),
m_threadsHandler
(
engine
),
m_threadsHandler
(),
m_watchHandler
(
engine
),
m_disassemblerViewAgent
(
engine
),
m_isSlaveEngine
(
false
)
...
...
src/plugins/debugger/threadshandler.cpp
View file @
1dacb9e5
...
...
@@ -30,7 +30,6 @@
#include
"threadshandler.h"
#include
"debuggerconstants.h"
#include
"debuggerengine.h"
#include
<QtCore/QDebug>
#include
<QtCore/QTextStream>
...
...
@@ -43,7 +42,8 @@ namespace Internal {
// ThreadsHandler
//
///////////////////////////////////////////////////////////////////////
static
inline
QString
threadToolTip
(
const
ThreadData
&
thread
)
static
QString
threadToolTip
(
const
ThreadData
&
thread
)
{
const
char
tableRowStartC
[]
=
"<tr><td>"
;
const
char
tableRowSeparatorC
[]
=
"</td><td>"
;
...
...
@@ -87,9 +87,8 @@ static inline QString threadToolTip(const ThreadData &thread)
//
///////////////////////////////////////////////////////////////////////
ThreadsHandler
::
ThreadsHandler
(
DebuggerEngine
*
engine
)
:
m_engine
(
engine
),
m_currentIndex
(
0
),
ThreadsHandler
::
ThreadsHandler
()
:
m_currentIndex
(
0
),
m_positionIcon
(
QLatin1String
(
":/debugger/images/location_16.png"
)),
m_emptyIcon
(
QLatin1String
(
":/debugger/images/debugger_empty_14.png"
))
{
...
...
@@ -179,16 +178,6 @@ QVariant ThreadsHandler::headerData
return
QVariant
();
}
bool
ThreadsHandler
::
setData
(
const
QModelIndex
&
index
,
const
QVariant
&
value
,
int
role
)
{
if
(
role
==
RequestSelectThreadRole
)
{
m_engine
->
selectThread
(
value
.
toInt
());
return
true
;
}
return
QAbstractTableModel
::
setData
(
index
,
value
,
role
);
}
int
ThreadsHandler
::
currentThreadId
()
const
{
if
(
m_currentIndex
<
0
||
m_currentIndex
>=
m_threads
.
size
())
...
...
src/plugins/debugger/threadshandler.h
View file @
1dacb9e5
...
...
@@ -38,8 +38,6 @@
#include
"threaddata.h"
namespace
Debugger
{
class
DebuggerEngine
;
namespace
Internal
{
////////////////////////////////////////////////////////////////////////
...
...
@@ -54,7 +52,7 @@ class ThreadsHandler : public QAbstractTableModel
Q_OBJECT
public:
explicit
ThreadsHandler
(
DebuggerEngine
*
engine
);
ThreadsHandler
();
int
currentThread
()
const
{
return
m_currentIndex
;
}
void
setCurrentThread
(
int
index
);
...
...
@@ -75,12 +73,9 @@ private:
int
rowCount
(
const
QModelIndex
&
parent
=
QModelIndex
())
const
;
int
columnCount
(
const
QModelIndex
&
parent
=
QModelIndex
())
const
;
QVariant
data
(
const
QModelIndex
&
index
,
int
role
=
Qt
::
DisplayRole
)
const
;
bool
setData
(
const
QModelIndex
&
index
,
const
QVariant
&
value
,
int
role
);
QVariant
headerData
(
int
section
,
Qt
::
Orientation
orientation
,
int
role
=
Qt
::
DisplayRole
)
const
;
private:
DebuggerEngine
*
m_engine
;
Threads
m_threads
;
int
m_currentIndex
;
const
QIcon
m_positionIcon
;
...
...
src/plugins/debugger/threadswindow.cpp
View file @
1dacb9e5
...
...
@@ -29,8 +29,11 @@
#include
"threadswindow.h"
#include
"threadshandler.h"
#include
"debuggeractions.h"
#include
"debuggerconstants.h"
#include
"debuggerengine.h"
#include
"debuggerplugin.h"
#include
<utils/savedaction.h>
...
...
@@ -107,7 +110,8 @@ void ThreadsWindow::setAlwaysResizeColumnsToContents(bool on)
void
ThreadsWindow
::
selectThread
(
int
index
)
{
model
()
->
setData
(
QModelIndex
(),
index
,
RequestSelectThreadRole
);
DebuggerPlugin
::
instance
()
->
currentEngine
()
->
threadsHandler
()
->
selectThread
(
index
);
}
}
// namespace Internal
...
...
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