Skip to content
GitLab
Menu
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
7f3ac461
Commit
7f3ac461
authored
Apr 03, 2009
by
hjk
Browse files
debugger: use a new action for "executing a line"
parent
e3aa9830
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/plugins/debugger/debuggeractions.cpp
View file @
7f3ac461
...
...
@@ -314,6 +314,10 @@ DebuggerSettings *theDebuggerSettings()
item
->
setDefaultValue
(
20
);
instance
->
insertItem
(
MaximalStackDepth
,
item
);
item
=
new
SavedAction
(
instance
);
item
->
setText
(
QObject
::
tr
(
"Execute line"
));
instance
->
insertItem
(
ExecuteCommand
,
item
);
return
instance
;
}
...
...
src/plugins/debugger/debuggeractions.h
View file @
7f3ac461
...
...
@@ -75,6 +75,7 @@ enum DebuggerActionCode
GdbLocation
,
GdbEnvironment
,
GdbScriptFile
,
ExecuteCommand
,
// Stack
MaximalStackDepth
,
...
...
src/plugins/debugger/debuggermanager.cpp
View file @
7f3ac461
...
...
@@ -358,9 +358,6 @@ void DebuggerManager::init()
m_watchAction
->
setText
(
tr
(
"Add to Watch Window"
));
// For usuage hints oin focus{In,Out}
//connect(m_outputWindow, SIGNAL(statusMessageRequested(QString,int)),
// this, SLOT(showStatusMessage(QString,int)));
connect
(
m_continueAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
continueExec
()));
...
...
@@ -401,8 +398,8 @@ void DebuggerManager::init()
connect
(
m_statusTimer
,
SIGNAL
(
timeout
()),
this
,
SLOT
(
clearStatusMessage
()));
connect
(
m_outputWindow
,
SIGNAL
(
commandExecutionRequested
(
QString
)),
this
,
SLOT
(
executeDebuggerCommand
(
QString
)));
connect
(
theDebuggerAction
(
ExecuteCommand
),
SIGNAL
(
triggered
(
)),
this
,
SLOT
(
executeDebuggerCommand
()));
m_breakDock
=
createDockForWidget
(
m_breakWindow
);
...
...
@@ -971,6 +968,7 @@ void DebuggerManager::assignValueInDebugger()
assignValueInDebugger
(
str
.
left
(
i
),
str
.
mid
(
i
+
1
));
}
}
void
DebuggerManager
::
assignValueInDebugger
(
const
QString
&
expr
,
const
QString
&
value
)
{
QTC_ASSERT
(
m_engine
,
return
);
...
...
@@ -1036,6 +1034,12 @@ void DebuggerManager::nextIExec()
m_engine
->
nextIExec
();
}
void
DebuggerManager
::
executeDebuggerCommand
()
{
if
(
QAction
*
action
=
qobject_cast
<
QAction
*>
(
sender
()))
executeDebuggerCommand
(
action
->
data
().
toString
());
}
void
DebuggerManager
::
executeDebuggerCommand
(
const
QString
&
command
)
{
if
(
Debugger
::
Constants
::
Internal
::
debug
)
...
...
src/plugins/debugger/debuggermanager.h
View file @
7f3ac461
...
...
@@ -238,6 +238,8 @@ public slots:
void
assignValueInDebugger
();
void
assignValueInDebugger
(
const
QString
&
expr
,
const
QString
&
value
);
void
executeDebuggerCommand
();
void
executeDebuggerCommand
(
const
QString
&
command
);
void
showStatusMessage
(
const
QString
&
msg
,
int
timeout
=
-
1
);
// -1 forever
...
...
src/plugins/debugger/debuggeroutputwindow.cpp
View file @
7f3ac461
...
...
@@ -84,6 +84,8 @@ public:
menu
->
addAction
(
m_clearContentsAction
);
//menu->addAction(m_saveContentsAction);
addContextActions
(
menu
);
theDebuggerAction
(
ExecuteCommand
)
->
setData
(
textCursor
().
block
().
text
());
menu
->
addAction
(
theDebuggerAction
(
ExecuteCommand
));
menu
->
addSeparator
();
menu
->
addAction
(
theDebuggerAction
(
SettingsDialog
));
menu
->
exec
(
ev
->
globalPos
());
...
...
@@ -101,35 +103,20 @@ class InputPane : public DebuggerPane
{
Q_OBJECT
public:
InputPane
(
QWidget
*
parent
)
:
DebuggerPane
(
parent
)
{
m_commandExecutionAction
=
new
QAction
(
this
);
m_commandExecutionAction
->
setText
(
"Execute line"
);
m_commandExecutionAction
->
setEnabled
(
true
);
//m_commandExecutionAction->setShortcut
// (Qt::ControlModifier + Qt::Key_Return);
connect
(
m_commandExecutionAction
,
SIGNAL
(
triggered
(
bool
)),
this
,
SLOT
(
executeCommand
()));
}
InputPane
(
QWidget
*
parent
)
:
DebuggerPane
(
parent
)
{}
signals:
void
commandExecutionRequested
(
const
QString
&
);
void
clearContentsRequested
();
void
statusMessageRequested
(
const
QString
&
,
int
);
void
commandSelected
(
int
);
private
slots
:
void
executeCommand
()
{
emit
commandExecutionRequested
(
textCursor
().
block
().
text
());
}
private:
void
keyPressEvent
(
QKeyEvent
*
ev
)
{
if
(
ev
->
modifiers
()
==
Qt
::
ControlModifier
&&
ev
->
key
()
==
Qt
::
Key_Return
)
emit
commandExecutionRequested
(
textCursor
().
block
().
text
());
theDebuggerAction
(
ExecuteCommand
)
->
trigger
(
textCursor
().
block
().
text
());
else
if
(
ev
->
modifiers
()
==
Qt
::
ControlModifier
&&
ev
->
key
()
==
Qt
::
Key_R
)
emit
clearContentsRequested
();
else
...
...
@@ -157,7 +144,7 @@ private:
void
addContextActions
(
QMenu
*
menu
)
{
menu
->
addAction
(
m_commandExecutionAction
);
menu
->
addAction
(
theDebuggerAction
(
ExecuteCommand
)
);
}
void
focusInEvent
(
QFocusEvent
*
ev
)
...
...
@@ -171,8 +158,6 @@ private:
emit
statusMessageRequested
(
QString
(),
-
1
);
QPlainTextEdit
::
focusOutEvent
(
ev
);
}
QAction
*
m_commandExecutionAction
;
};
...
...
@@ -252,19 +237,12 @@ DebuggerOutputWindow::DebuggerOutputWindow(QWidget *parent)
aggregate
->
add
(
new
BaseTextFind
(
m_inputText
));
#endif
connect
(
m_inputText
,
SIGNAL
(
commandExecutionRequested
(
QString
)),
this
,
SIGNAL
(
commandExecutionRequested
(
QString
)));
connect
(
m_inputText
,
SIGNAL
(
statusMessageRequested
(
QString
,
int
)),
this
,
SIGNAL
(
statusMessageRequested
(
QString
,
int
)));
connect
(
m_inputText
,
SIGNAL
(
commandSelected
(
int
)),
m_combinedText
,
SLOT
(
gotoResult
(
int
)));
};
void
DebuggerOutputWindow
::
onReturnPressed
()
{
emit
commandExecutionRequested
(
m_commandEdit
->
text
());
}
void
DebuggerOutputWindow
::
showOutput
(
const
QString
&
prefix
,
const
QString
&
output
)
{
if
(
output
.
isEmpty
())
...
...
src/plugins/debugger/debuggeroutputwindow.h
View file @
7f3ac461
...
...
@@ -65,10 +65,6 @@ public slots:
signals:
void
showPage
();
void
statusMessageRequested
(
const
QString
&
msg
,
int
);
void
commandExecutionRequested
(
const
QString
&
cmd
);
private
slots
:
void
onReturnPressed
();
private:
QPlainTextEdit
*
m_combinedText
;
// combined input/output
...
...
Write
Preview
Supports
Markdown
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