diff options
author | Kent Hansen <khansen@trolltech.com> | 2009-06-12 18:27:24 (GMT) |
---|---|---|
committer | Kent Hansen <khansen@trolltech.com> | 2009-06-12 18:29:13 (GMT) |
commit | 10c093e56c82254d545e9d698934a2cfb9121a59 (patch) | |
tree | 4c7a5c27fab93bc6a5962ed032db5c4461d61c25 /src/scripttools/debugging/qscriptdebugger.cpp | |
parent | 2f4ca8e06be0477503acf2a4bf38a1c76f52e5b1 (diff) | |
download | Qt-10c093e56c82254d545e9d698934a2cfb9121a59.zip Qt-10c093e56c82254d545e9d698934a2cfb9121a59.tar.gz Qt-10c093e56c82254d545e9d698934a2cfb9121a59.tar.bz2 |
refactor some script debugger internals
Make it possible to reuse more code in remote debugger.
Diffstat (limited to 'src/scripttools/debugging/qscriptdebugger.cpp')
-rw-r--r-- | src/scripttools/debugging/qscriptdebugger.cpp | 116 |
1 files changed, 116 insertions, 0 deletions
diff --git a/src/scripttools/debugging/qscriptdebugger.cpp b/src/scripttools/debugging/qscriptdebugger.cpp index 5626a4b..454d051 100644 --- a/src/scripttools/debugging/qscriptdebugger.cpp +++ b/src/scripttools/debugging/qscriptdebugger.cpp @@ -1337,6 +1337,122 @@ void QScriptDebugger::setFrontend(QScriptDebuggerFrontend *frontend) } } +QAction *QScriptDebugger::action(DebuggerAction action, QObject *parent) +{ + switch (action) { + case InterruptAction: + return interruptAction(parent); + case ContinueAction: + return continueAction(parent); + case StepIntoAction: + return stepIntoAction(parent); + case StepOverAction: + return stepOverAction(parent); + case StepOutAction: + return stepOutAction(parent); + case RunToCursorAction: + return runToCursorAction(parent); + case RunToNewScriptAction: + return runToNewScriptAction(parent); + case ToggleBreakpointAction: + return toggleBreakpointAction(parent); + case ClearDebugOutputAction: + return clearDebugOutputAction(parent); + case ClearErrorLogAction: + return clearErrorLogAction(parent); + case ClearConsoleAction: + return clearConsoleAction(parent); + case FindInScriptAction: + return findInScriptAction(parent); + case FindNextInScriptAction: + return findNextInScriptAction(parent); + case FindPreviousInScriptAction: + return findPreviousInScriptAction(parent); + case GoToLineAction: + return goToLineAction(parent); + } + return 0; +} + +QWidget *QScriptDebugger::widget(DebuggerWidget widget) +{ + switch (widget) { + case ConsoleWidget: { + QScriptDebuggerConsoleWidgetInterface *w = consoleWidget(); + if (!w && widgetFactory()) { + w = widgetFactory()->createConsoleWidget(); + setConsoleWidget(w); + } + return w; + } + case StackWidget: { + QScriptDebuggerStackWidgetInterface *w = stackWidget(); + if (!w && widgetFactory()) { + w = widgetFactory()->createStackWidget(); + setStackWidget(w); + } + return w; + } + case ScriptsWidget: { + QScriptDebuggerScriptsWidgetInterface *w = scriptsWidget(); + if (!w && widgetFactory()) { + w = widgetFactory()->createScriptsWidget(); + setScriptsWidget(w); + } + return w; + } + case LocalsWidget: { + QScriptDebuggerLocalsWidgetInterface *w = localsWidget(); + if (!w && widgetFactory()) { + w = widgetFactory()->createLocalsWidget(); + setLocalsWidget(w); + } + return w; + } + case CodeWidget: { + QScriptDebuggerCodeWidgetInterface *w = codeWidget(); + if (!w && widgetFactory()) { + w = widgetFactory()->createCodeWidget(); + setCodeWidget(w); + } + return w; + } + case CodeFinderWidget: { + QScriptDebuggerCodeFinderWidgetInterface *w = codeFinderWidget(); + if (!w && widgetFactory()) { + w = widgetFactory()->createCodeFinderWidget(); + setCodeFinderWidget(w); + } + return w; + } + case BreakpointsWidget: { + QScriptBreakpointsWidgetInterface *w = breakpointsWidget(); + if (!w && widgetFactory()) { + w = widgetFactory()->createBreakpointsWidget(); + setBreakpointsWidget(w); + } + return w; + } + case DebugOutputWidget: { + QScriptDebugOutputWidgetInterface *w = debugOutputWidget(); + if (!w && widgetFactory()) { + w = widgetFactory()->createDebugOutputWidget(); + setDebugOutputWidget(w); + } + return w; + } + case ErrorLogWidget: { + QScriptErrorLogWidgetInterface *w = errorLogWidget(); + if (!w && widgetFactory()) { + w = widgetFactory()->createErrorLogWidget(); + setErrorLogWidget(w); + } + return w; + } + } + return 0; +} + QScriptDebuggerConsoleWidgetInterface *QScriptDebugger::consoleWidget() const { Q_D(const QScriptDebugger); |