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
b373da1b
Commit
b373da1b
authored
Nov 05, 2010
by
hjk
Browse files
debugger: more handler/window refactoring
parent
1dacb9e5
Changes
23
Hide whitespace changes
Inline
Side-by-side
src/plugins/debugger/debuggerconstants.h
View file @
b373da1b
...
...
@@ -214,36 +214,9 @@ enum ModelRoles
LocalsPointerValueRole
,
// Pointer value (address) as quint64
LocalsIsWatchpointAtAddressRole
,
LocalsIsWatchpointAtPointerValueRole
,
RequestShowInEditorRole
,
RequestWatchPointRole
,
RequestToggleWatchRole
,
RequestToolTipByExpressionRole
,
RequestClearCppCodeModelSnapshotRole
,
RequestWatchExpressionRole
,
RequestRemoveWatchExpressionRole
,
// Stack
StackFrameAddressRole
,
RequestActivateFrameRole
,
RequestReloadFullStackRole
,
RequestShowMemoryRole
,
RequestShowDisassemblerRole
,
// Modules
RequestReloadModulesRole
,
RequestExamineModulesRole
,
RequestModuleSymbolsRole
,
RequestAllSymbolsRole
,
RequestOpenFileRole
,
// Snapshots
SnapshotCapabilityRole
,
RequestCreateSnapshotRole
,
RequestActivateSnapshotRole
,
RequestRemoveSnapshotRole
,
// Sources
RequestReloadSourceFilesRole
,
};
enum
DebuggerEngineType
...
...
src/plugins/debugger/debuggerengine.cpp
View file @
b373da1b
...
...
@@ -224,10 +224,10 @@ public:
m_lastGoodState
(
DebuggerNotReady
),
m_targetState
(
DebuggerNotReady
),
m_commandHandler
(
engine
),
m_modulesHandler
(
engine
),
m_modulesHandler
(),
m_registerHandler
(),
m_sourceFilesHandler
(
engine
),
m_stackHandler
(
engine
),
m_sourceFilesHandler
(),
m_stackHandler
(),
m_threadsHandler
(),
m_watchHandler
(
engine
),
m_disassemblerViewAgent
(
engine
),
...
...
@@ -248,25 +248,29 @@ public slots:
void
doInterruptInferior
();
void
doFinishDebugger
();
void
queueRunEngine
()
{
void
queueRunEngine
()
{
m_engine
->
setState
(
EngineRunRequested
);
m_engine
->
showMessage
(
_
(
"QUEUE: RUN ENGINE"
));
QTimer
::
singleShot
(
0
,
this
,
SLOT
(
doRunEngine
()));
}
void
queueShutdownEngine
()
{
void
queueShutdownEngine
()
{
m_engine
->
setState
(
EngineShutdownRequested
);
m_engine
->
showMessage
(
_
(
"QUEUE: SHUTDOWN ENGINE"
));
QTimer
::
singleShot
(
0
,
this
,
SLOT
(
doShutdownEngine
()));
}
void
queueShutdownInferior
()
{
void
queueShutdownInferior
()
{
m_engine
->
setState
(
InferiorShutdownRequested
);
m_engine
->
showMessage
(
_
(
"QUEUE: SHUTDOWN INFERIOR"
));
QTimer
::
singleShot
(
0
,
this
,
SLOT
(
doShutdownInferior
()));
}
void
queueFinishDebugger
()
{
void
queueFinishDebugger
()
{
QTC_ASSERT
(
state
()
==
EngineShutdownOk
||
state
()
==
EngineShutdownFailed
,
qDebug
()
<<
state
());
m_engine
->
setState
(
DebuggerFinished
);
...
...
@@ -274,7 +278,8 @@ public slots:
QTimer
::
singleShot
(
0
,
this
,
SLOT
(
doFinishDebugger
()));
}
void
raiseApplication
()
{
void
raiseApplication
()
{
QTC_ASSERT
(
m_runControl
,
return
);
m_runControl
->
bringApplicationToForeground
(
m_inferiorPid
);
}
...
...
@@ -514,30 +519,9 @@ void DebuggerEngine::removeTooltip()
void
DebuggerEngine
::
handleCommand
(
int
role
,
const
QVariant
&
value
)
{
if
(
role
!=
RequestToolTipByExpressionRole
)
removeTooltip
();
removeTooltip
();
switch
(
role
)
{
case
RequestActivateFrameRole
:
activateFrame
(
value
.
toInt
());
break
;
case
RequestReloadFullStackRole
:
reloadFullStack
();
break
;
case
RequestReloadSourceFilesRole
:
reloadSourceFiles
();
break
;
case
RequestReloadModulesRole
:
reloadModules
();
break
;
//case RequestReloadRegistersRole:
// reloadRegisters();
// break;
case
RequestExecDetachRole
:
detachDebugger
();
break
;
...
...
@@ -590,10 +574,6 @@ void DebuggerEngine::handleCommand(int role, const QVariant &value)
d
->
queueShutdownInferior
();
break
;
case
RequestCreateSnapshotRole
:
createSnapshot
();
break
;
case
RequestActivationRole
:
setActive
(
value
.
toBool
());
break
;
...
...
@@ -614,29 +594,12 @@ void DebuggerEngine::handleCommand(int role, const QVariant &value)
executeDebuggerCommand
(
value
.
toString
());
break
;
case
RequestToolTipByExpressionRole
:
{
QList
<
QVariant
>
list
=
value
.
toList
();
QTC_ASSERT
(
list
.
size
()
==
3
,
break
);
QPoint
point
=
list
.
at
(
0
).
value
<
QPoint
>
();
TextEditor
::
ITextEditor
*
editor
=
// Eeks.
(
TextEditor
::
ITextEditor
*
)(
list
.
at
(
1
).
value
<
quint64
>
());
int
pos
=
list
.
at
(
2
).
toInt
();
setToolTipExpression
(
point
,
editor
,
pos
);
break
;
}
case
RequestContextMenuRole
:
{
QList
<
QVariant
>
list
=
value
.
toList
();
QTC_ASSERT
(
list
.
size
()
==
3
,
break
);
d
->
handleContextMenuRequest
(
list
);
break
;
}
case
RequestShowMemoryRole
:
{
qDebug
()
<<
"CREATING MEMORY VIEW"
;
(
void
)
MemoryViewAgent
(
this
,
"0x0"
);
break
;
}
}
}
...
...
src/plugins/debugger/debuggerplugin.cpp
View file @
b373da1b
...
...
@@ -823,7 +823,7 @@ struct DebuggerActions
QAction
*
jumpToLineAction
;
// in the Debug menu
QAction
*
returnFromFunctionAction
;
QAction
*
nextAction
;
QAction
*
snapshotAction
;
//
QAction *snapshotAction;
QAction
*
watchAction1
;
// in the Debug menu
QAction
*
watchAction2
;
// in the text editor context menu
QAction
*
breakAction
;
...
...
@@ -854,19 +854,29 @@ public:
void
notifyCurrentEngine
(
int
role
,
const
QVariant
&
value
=
QVariant
());
void
connectEngine
(
DebuggerEngine
*
engine
,
bool
notify
=
true
);
void
disconnectEngine
()
{
connectEngine
(
0
);
}
DebuggerEngine
*
currentEngine
()
const
{
return
m_currentEngine
;
}
public
slots
:
void
updateWatchersHeader
(
int
section
,
int
,
int
newSize
)
{
m_watchersWindow
->
header
()
->
resizeSection
(
section
,
newSize
);
}
{
m_watchersWindow
->
header
()
->
resizeSection
(
section
,
newSize
);
}
void
sourceFilesDockToggled
(
bool
on
)
{
if
(
on
)
notifyCurrentEngine
(
RequestReloadSourceFilesRole
);
}
{
if
(
on
)
m_currentEngine
->
reloadSourceFiles
();
}
void
modulesDockToggled
(
bool
on
)
{
if
(
on
)
notifyCurrentEngine
(
RequestReloadModulesRole
);
}
{
if
(
on
)
m_currentEngine
->
reloadModules
();
}
void
registerDockToggled
(
bool
on
)
{
if
(
on
&&
m_currentEngine
)
if
(
on
)
m_currentEngine
->
reloadRegisters
();
}
...
...
@@ -1137,8 +1147,6 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, QString *er
m_registerWindow
=
new
RegisterWindow
;
m_registerWindow
->
setObjectName
(
QLatin1String
(
"CppDebugRegisters"
));
m_snapshotWindow
=
new
SnapshotWindow
;
m_snapshotWindow
->
setObjectName
(
QLatin1String
(
"CppDebugSnapshots"
));
m_stackWindow
=
new
StackWindow
;
m_stackWindow
->
setObjectName
(
QLatin1String
(
"CppDebugStack"
));
m_sourceFilesWindow
=
new
SourceFilesWindow
;
...
...
@@ -1160,6 +1168,8 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, QString *er
// Snapshot
m_snapshotHandler
=
new
SnapshotHandler
;
m_snapshotWindow
=
new
SnapshotWindow
(
m_snapshotHandler
);
m_snapshotWindow
->
setObjectName
(
QLatin1String
(
"CppDebugSnapshots"
));
m_snapshotWindow
->
setModel
(
m_snapshotHandler
->
model
());
// Debug mode setup
...
...
@@ -1227,10 +1237,10 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, QString *er
m_actions
.
watchAction2
=
new
QAction
(
tr
(
"Add to Watch Window"
),
this
);
m_actions
.
watchAction2
->
setProperty
(
Role
,
RequestExecWatchRole
);
m_actions
.
snapshotAction
=
new
QAction
(
tr
(
"Create Snapshot"
),
this
);
m_actions
.
snapshotAction
->
setProperty
(
Role
,
RequestCreateSnapshotRole
);
m_actions
.
snapshotAction
->
setIcon
(
QIcon
(
__
(
":/debugger/images/debugger_snapshot_small.png"
)));
//
m_actions.snapshotAction = new QAction(tr("Create Snapshot"), this);
//
m_actions.snapshotAction->setProperty(Role, RequestCreateSnapshotRole);
//
m_actions.snapshotAction->setIcon(
//
QIcon(__(":/debugger/images/debugger_snapshot_small.png")));
m_actions
.
reverseDirectionAction
=
new
QAction
(
tr
(
"Reverse Direction"
),
this
);
...
...
@@ -1261,7 +1271,7 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, QString *er
connect
(
m_actions
.
returnFromFunctionAction
,
SIGNAL
(
triggered
()),
SLOT
(
onAction
()));
connect
(
m_actions
.
watchAction1
,
SIGNAL
(
triggered
()),
SLOT
(
onAction
()));
connect
(
m_actions
.
watchAction2
,
SIGNAL
(
triggered
()),
SLOT
(
onAction
()));
connect
(
m_actions
.
snapshotAction
,
SIGNAL
(
triggered
()),
SLOT
(
onAction
()));
//
connect(m_actions.snapshotAction, SIGNAL(triggered()), SLOT(onAction()));
connect
(
m_actions
.
frameDownAction
,
SIGNAL
(
triggered
()),
SLOT
(
onAction
()));
connect
(
m_actions
.
frameUpAction
,
SIGNAL
(
triggered
()),
SLOT
(
onAction
()));
connect
(
m_actions
.
stopAction
,
SIGNAL
(
triggered
()),
SLOT
(
onAction
()));
...
...
@@ -1514,11 +1524,11 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, QString *er
m_uiSwitcher
->
addMenuAction
(
cmd
,
CppLanguage
);
cmd
=
am
->
registerAction
(
m_actions
.
snapshotAction
,
Constants
::
SNAPSHOT
,
cppDebuggercontext
);
cmd
->
setDefaultKeySequence
(
QKeySequence
(
Constants
::
SNAPSHOT_KEY
));
cmd
->
setAttribute
(
Command
::
CA_Hide
);
m_uiSwitcher
->
addMenuAction
(
cmd
,
CppLanguage
);
//
cmd = am->registerAction(m_actions.snapshotAction,
//
Constants::SNAPSHOT, cppDebuggercontext);
//
cmd->setDefaultKeySequence(QKeySequence(Constants::SNAPSHOT_KEY));
//
cmd->setAttribute(Command::CA_Hide);
//
m_uiSwitcher->addMenuAction(cmd, CppLanguage);
cmd
=
am
->
registerAction
(
m_actions
.
frameDownAction
,
Constants
::
FRAME_DOWN
,
cppDebuggercontext
);
...
...
@@ -2025,7 +2035,8 @@ void DebuggerPluginPrivate::requestMark(ITextEditor *editor, int lineNumber)
toggleBreakpoint
(
editor
->
file
()
->
fileName
(),
lineNumber
);
}
void
DebuggerPluginPrivate
::
showToolTip
(
ITextEditor
*
editor
,
const
QPoint
&
point
,
int
pos
)
void
DebuggerPluginPrivate
::
showToolTip
(
ITextEditor
*
editor
,
const
QPoint
&
point
,
int
pos
)
{
if
(
!
isDebuggable
(
editor
))
return
;
...
...
@@ -2033,12 +2044,7 @@ void DebuggerPluginPrivate::showToolTip(ITextEditor *editor, const QPoint &point
return
;
if
(
state
()
!=
InferiorStopOk
)
return
;
QList
<
QVariant
>
list
;
list
.
append
(
point
);
list
.
append
(
quint64
(
editor
));
list
.
append
(
pos
);
notifyCurrentEngine
(
RequestToolTipByExpressionRole
,
list
);
currentEngine
()
->
setToolTipExpression
(
point
,
editor
,
pos
);
}
DebuggerRunControl
*
DebuggerPluginPrivate
::
createDebugger
...
...
@@ -2264,7 +2270,7 @@ void DebuggerPluginPrivate::setInitialState()
m_actions
.
watchAction1
->
setEnabled
(
true
);
m_actions
.
watchAction2
->
setEnabled
(
true
);
m_actions
.
breakAction
->
setEnabled
(
true
);
m_actions
.
snapshotAction
->
setEnabled
(
false
);
//
m_actions.snapshotAction->setEnabled(false);
theDebuggerAction
(
OperateByInstruction
)
->
setEnabled
(
false
);
m_actions
.
stopAction
->
setEnabled
(
false
);
...
...
@@ -2393,7 +2399,7 @@ void DebuggerPluginPrivate::updateState(DebuggerEngine *engine)
m_actions
.
watchAction1
->
setEnabled
(
true
);
m_actions
.
watchAction2
->
setEnabled
(
true
);
m_actions
.
breakAction
->
setEnabled
(
true
);
m_actions
.
snapshotAction
->
setEnabled
(
stopped
&&
(
caps
&
SnapshotCapability
));
//
m_actions.snapshotAction->setEnabled(stopped && (caps & SnapshotCapability));
theDebuggerAction
(
OperateByInstruction
)
->
setEnabled
(
stopped
);
...
...
@@ -2562,11 +2568,8 @@ void DebuggerPluginPrivate::scriptExpressionEntered(const QString &expression)
void
DebuggerPluginPrivate
::
openMemoryEditor
()
{
AddressDialog
dialog
;
if
(
dialog
.
exec
()
!=
QDialog
::
Accepted
)
return
;
QTC_ASSERT
(
m_watchersWindow
,
return
);
m_watchersWindow
->
model
()
->
setData
(
QModelIndex
(),
dialog
.
address
(),
RequestShowMemoryRole
);
if
(
dialog
.
exec
()
==
QDialog
::
Accepted
)
(
void
)
new
MemoryViewAgent
(
currentEngine
(),
dialog
.
address
());
}
void
DebuggerPluginPrivate
::
coreShutdown
()
...
...
@@ -2874,6 +2877,11 @@ Internal::BreakHandler *DebuggerPlugin::breakHandler() const
return
d
->
m_breakHandler
;
}
Internal
::
SnapshotHandler
*
DebuggerPlugin
::
snapshotHandler
()
const
{
return
d
->
m_snapshotHandler
;
}
DebuggerEngine
*
DebuggerPlugin
::
currentEngine
()
const
{
return
d
->
m_currentEngine
;
...
...
src/plugins/debugger/debuggerplugin.h
View file @
b373da1b
...
...
@@ -57,6 +57,7 @@ class DebuggerStartParameters;
namespace
Internal
{
class
BreakHandler
;
class
SnapshotHandler
;
}
class
DEBUGGER_EXPORT
DebuggerPlugin
:
public
ExtensionSystem
::
IPlugin
...
...
@@ -91,6 +92,7 @@ public:
void
openTextEditor
(
const
QString
&
titlePattern
,
const
QString
&
contents
);
Internal
::
BreakHandler
*
breakHandler
()
const
;
Internal
::
SnapshotHandler
*
snapshotHandler
()
const
;
DebuggerEngine
*
currentEngine
()
const
;
public
slots
:
...
...
src/plugins/debugger/moduleshandler.cpp
View file @
b373da1b
...
...
@@ -28,7 +28,6 @@
**************************************************************************/
#include
"moduleshandler.h"
#include
"debuggerengine.h"
#include
<utils/qtcassert.h>
...
...
@@ -45,41 +44,8 @@
namespace
Debugger
{
namespace
Internal
{
class
ModulesModel
:
public
QAbstractItemModel
{
// Needs tr - context.
Q_OBJECT
public:
explicit
ModulesModel
(
ModulesHandler
*
parent
,
DebuggerEngine
*
engine
);
// QAbstractItemModel
int
columnCount
(
const
QModelIndex
&
parent
)
const
{
return
parent
.
isValid
()
?
0
:
5
;
}
int
rowCount
(
const
QModelIndex
&
parent
)
const
{
return
parent
.
isValid
()
?
0
:
m_modules
.
size
();
}
QModelIndex
parent
(
const
QModelIndex
&
)
const
{
return
QModelIndex
();
}
QModelIndex
index
(
int
row
,
int
column
,
const
QModelIndex
&
)
const
{
return
createIndex
(
row
,
column
);
}
QVariant
headerData
(
int
section
,
Qt
::
Orientation
orientation
,
int
role
)
const
;
QVariant
data
(
const
QModelIndex
&
index
,
int
role
)
const
;
bool
setData
(
const
QModelIndex
&
index
,
const
QVariant
&
value
,
int
role
);
void
clearModel
();
void
addModule
(
const
Module
&
module
);
void
removeModule
(
const
QString
&
moduleName
);
void
setModules
(
const
Modules
&
modules
);
void
updateModule
(
const
QString
&
moduleName
,
const
Module
&
module
);
const
Modules
&
modules
()
const
{
return
m_modules
;
}
private:
int
indexOfModule
(
const
QString
&
name
)
const
;
DebuggerEngine
*
m_engine
;
Modules
m_modules
;
};
ModulesModel
::
ModulesModel
(
ModulesHandler
*
parent
,
DebuggerEngine
*
engine
)
:
QAbstractItemModel
(
parent
),
m_engine
(
engine
)
ModulesModel
::
ModulesModel
(
ModulesHandler
*
parent
)
:
QAbstractItemModel
(
parent
)
{}
QVariant
ModulesModel
::
headerData
(
int
section
,
...
...
@@ -101,12 +67,6 @@ QVariant ModulesModel::headerData(int section,
QVariant
ModulesModel
::
data
(
const
QModelIndex
&
index
,
int
role
)
const
{
if
(
role
==
EngineCapabilitiesRole
)
return
m_engine
->
debuggerCapabilities
();
if
(
role
==
EngineActionsEnabledRole
)
return
m_engine
->
debuggerActionsEnabled
();
int
row
=
index
.
row
();
if
(
row
<
0
||
row
>=
m_modules
.
size
())
return
QVariant
();
...
...
@@ -153,34 +113,6 @@ QVariant ModulesModel::data(const QModelIndex &index, int role) const
return
QVariant
();
}
bool
ModulesModel
::
setData
(
const
QModelIndex
&
index
,
const
QVariant
&
value
,
int
role
)
{
Q_UNUSED
(
index
);
switch
(
role
)
{
case
RequestReloadModulesRole
:
m_engine
->
reloadModules
();
return
true
;
case
RequestExamineModulesRole
:
m_engine
->
examineModules
();
return
true
;
case
RequestModuleSymbolsRole
:
m_engine
->
loadSymbols
(
value
.
toString
());
return
true
;
case
RequestAllSymbolsRole
:
m_engine
->
loadAllSymbols
();
return
true
;
case
RequestOpenFileRole
:
m_engine
->
openFile
(
value
.
toString
());
return
true
;
}
return
false
;
}
void
ModulesModel
::
addModule
(
const
Module
&
m
)
{
beginInsertRows
(
QModelIndex
(),
m_modules
.
size
(),
m_modules
.
size
());
...
...
@@ -234,9 +166,9 @@ void ModulesModel::updateModule(const QString &moduleName, const Module &module)
//
//////////////////////////////////////////////////////////////////
ModulesHandler
::
ModulesHandler
(
DebuggerEngine
*
engine
)
ModulesHandler
::
ModulesHandler
()
{
m_model
=
new
ModulesModel
(
this
,
engine
);
m_model
=
new
ModulesModel
(
this
);
m_proxyModel
=
new
QSortFilterProxyModel
(
this
);
m_proxyModel
->
setSourceModel
(
m_model
);
}
...
...
@@ -279,4 +211,3 @@ Modules ModulesHandler::modules() const
}
// namespace Internal
}
// namespace Debugger
#include
"moduleshandler.moc"
src/plugins/debugger/moduleshandler.h
View file @
b373da1b
...
...
@@ -32,20 +32,15 @@
#include
<QtCore/QList>
#include
<QtCore/QObject>
QT_BEGIN_NAMESPACE
class
QAbstractItemModel
;
class
QSortFilterProxyModel
;
QT_END_NAMESPACE
#include
<QtGui/QSortFilterProxyModel>
namespace
Debugger
{
class
DebuggerEngine
;
namespace
Internal
{
class
ModulesModel
;
class
ModulesHandler
;
//////////////////////////////////////////////////////////////////
//
...
...
@@ -96,6 +91,45 @@ public:
typedef
QList
<
Module
>
Modules
;
//////////////////////////////////////////////////////////////////
//
// ModulesModel
//
//////////////////////////////////////////////////////////////////
class
ModulesModel
:
public
QAbstractItemModel
{
// Needs tr - context.
Q_OBJECT
public:
ModulesModel
(
ModulesHandler
*
parent
);
// QAbstractItemModel
int
columnCount
(
const
QModelIndex
&
parent
)
const
{
return
parent
.
isValid
()
?
0
:
5
;
}
int
rowCount
(
const
QModelIndex
&
parent
)
const
{
return
parent
.
isValid
()
?
0
:
m_modules
.
size
();
}
QModelIndex
parent
(
const
QModelIndex
&
)
const
{
return
QModelIndex
();
}
QModelIndex
index
(
int
row
,
int
column
,
const
QModelIndex
&
)
const
{
return
createIndex
(
row
,
column
);
}
QVariant
headerData
(
int
section
,
Qt
::
Orientation
orientation
,
int
role
)
const
;
QVariant
data
(
const
QModelIndex
&
index
,
int
role
)
const
;
void
clearModel
();
void
addModule
(
const
Module
&
module
);
void
removeModule
(
const
QString
&
moduleName
);
void
setModules
(
const
Modules
&
modules
);
void
updateModule
(
const
QString
&
moduleName
,
const
Module
&
module
);
const
Modules
&
modules
()
const
{
return
m_modules
;
}
private:
int
indexOfModule
(
const
QString
&
name
)
const
;
Modules
m_modules
;
};
//////////////////////////////////////////////////////////////////
//
// ModulesHandler
...
...
@@ -107,7 +141,7 @@ class ModulesHandler : public QObject
Q_OBJECT
public:
explicit
ModulesHandler
(
DebuggerEngine
*
engine
);
ModulesHandler
();
QAbstractItemModel
*
model
()
const
;
...
...
src/plugins/debugger/moduleswindow.cpp
View file @
b373da1b
...
...
@@ -29,8 +29,10 @@
#include
"moduleswindow.h"
#include
"debuggerconstants.h"
#include
"debuggeractions.h"
#include
"debuggerconstants.h"
#include
"debuggerengine.h"
#include
"debuggerplugin.h"
#include
<utils/qtcassert.h>
#include
<utils/savedaction.h>
...
...
@@ -51,6 +53,11 @@
namespace
Debugger
{
namespace
Internal
{
static
DebuggerEngine
*
currentEngine
()
{
return
DebuggerPlugin
::
instance
()
->
currentEngine
();
}
ModulesWindow
::
ModulesWindow
(
QWidget
*
parent
)
:
QTreeView
(
parent
),
m_alwaysResizeColumnsToContents
(
false
)
{
...
...
@@ -63,16 +70,14 @@ ModulesWindow::ModulesWindow(QWidget *parent)
setIconSize
(
QSize
(
10
,
10
));
connect
(
this
,
SIGNAL
(
activated
(
QModelIndex
)),
this
,
SLOT
(
moduleActivated
(
QModelIndex
)));
SLOT
(
moduleActivated
(
QModelIndex
)));
connect
(
act
,
SIGNAL
(
toggled
(
bool
)),
this
,
SLOT
(
setAlternatingRowColorsHelper
(
bool
)));
SLOT
(
setAlternatingRowColorsHelper
(
bool
)));
}
void
ModulesWindow
::
moduleActivated
(
const
QModelIndex
&
index
)
{
qDebug
()
<<
"ACTIVATED: "
<<
index
.
row
()
<<
index
.
column
()
<<
index
.
data
().
toString
();
setModelData
(
RequestOpenFileRole
,
index
.
data
().
toString
());
currentEngine
()
->
openFile
(
index
.
data
().
toString
());
}
void
ModulesWindow
::
resizeEvent
(
QResizeEvent
*
event
)
...
...
@@ -100,10 +105,9 @@ void ModulesWindow::contextMenuEvent(QContextMenuEvent *ev)
if
(
index
.
isValid
())
name
=
index
.
data
().
toString
();
const
bool
enabled
=
model
()
&&
model
()
->
data
(
index
,
EngineActionsEnabledRole
).
toBool
();
const
unsigned
capabilities
=
model
()
->
data
(
index
,
EngineCapabilitiesRole
).
toInt
();
DebuggerEngine
*
engine
=
currentEngine
();
const
bool
enabled
=
engine
->
debuggerActionsEnabled
();
const
unsigned
capabilities
=
engine
->
debuggerCapabilities
();
QMenu
menu
;
...
...
@@ -168,7 +172,7 @@ void ModulesWindow::contextMenuEvent(QContextMenuEvent *ev)
QAction
*
act
=
menu
.
exec
(
ev
->
globalPos
());
if
(
act
==
actUpdateModuleList
)
{
setModelData
(
RequestR
eloadModules
Role
);
engine
->
r
eloadModules
(
);
}
else
if
(
act
==
actAdjustColumnWidths
)
{
resizeColumnsToContents
();
}
else
if
(
act
==
actAlwaysAdjustColumnWidth
)
{
...
...
@@ -176,15 +180,15 @@ void ModulesWindow::contextMenuEvent(QContextMenuEvent *ev)
//} else if (act == actShowSourceFiles) {
// emit displaySourceRequested(name);
}
else
if
(
act
==
actLoadSymbolsForAllModules
)
{