summaryrefslogtreecommitdiffstats
path: root/src/scripttools/debugging
diff options
context:
space:
mode:
authorJoel Nordell <joel.nordell@chloridepower.com>2009-06-17 10:48:53 (GMT)
committerKent Hansen <khansen@trolltech.com>2009-06-17 10:48:53 (GMT)
commite97b1187391e16208a2da0e4c7f9e6daa540aa93 (patch)
tree479306f67f4b66ac1ea926ad1755ae32de8613b1 /src/scripttools/debugging
parent3a55f0eab402a72a0f98fdfe5505614fed5d19ed (diff)
downloadQt-e97b1187391e16208a2da0e4c7f9e6daa540aa93.zip
Qt-e97b1187391e16208a2da0e4c7f9e6daa540aa93.tar.gz
Qt-e97b1187391e16208a2da0e4c7f9e6daa540aa93.tar.bz2
add a state() function to QScriptEngineDebugger for determining whether the debu
gger is suspended or not Merge-request: 555 Reviewed-by: Kent Hansen <khansen@trolltech.com>
Diffstat (limited to 'src/scripttools/debugging')
-rw-r--r--src/scripttools/debugging/qscriptdebugger.cpp6
-rw-r--r--src/scripttools/debugging/qscriptdebugger_p.h2
-rw-r--r--src/scripttools/debugging/qscriptenginedebugger.cpp21
-rw-r--r--src/scripttools/debugging/qscriptenginedebugger.h7
4 files changed, 36 insertions, 0 deletions
diff --git a/src/scripttools/debugging/qscriptdebugger.cpp b/src/scripttools/debugging/qscriptdebugger.cpp
index 9cca8ad..003121f 100644
--- a/src/scripttools/debugging/qscriptdebugger.cpp
+++ b/src/scripttools/debugging/qscriptdebugger.cpp
@@ -1946,6 +1946,12 @@ QToolBar *QScriptDebugger::createStandardToolBar(QWidget *widgetParent, QObject
return tb;
}
+bool QScriptDebugger::isInteractive() const
+{
+ Q_D(const QScriptDebugger);
+ return d->interactive;
+}
+
/*!
\reimp
*/
diff --git a/src/scripttools/debugging/qscriptdebugger_p.h b/src/scripttools/debugging/qscriptdebugger_p.h
index 9ed7e0a..ba27200 100644
--- a/src/scripttools/debugging/qscriptdebugger_p.h
+++ b/src/scripttools/debugging/qscriptdebugger_p.h
@@ -172,6 +172,8 @@ public:
bool eventFilter(QObject *, QEvent *e);
+ bool isInteractive() const;
+
Q_SIGNALS:
void stopped() const;
void started() const;
diff --git a/src/scripttools/debugging/qscriptenginedebugger.cpp b/src/scripttools/debugging/qscriptenginedebugger.cpp
index 948a01a..ae58c89 100644
--- a/src/scripttools/debugging/qscriptenginedebugger.cpp
+++ b/src/scripttools/debugging/qscriptenginedebugger.cpp
@@ -226,6 +226,15 @@ public:
\value GoToLineAction Shows the "Go to Line" dialog.
*/
+/*!
+ \enum QScriptEngineDebugger::DebuggerState
+
+ This enum specifies the current state of the debugger.
+
+ \value RunningState The debugger is running. (Script evaluation is allowed.)
+ \value SuspendedState The debugger has suspended script evaluation.
+*/
+
class QScriptEngineDebuggerPrivate
: public QObjectPrivate
{
@@ -387,6 +396,18 @@ void QScriptEngineDebugger::detach()
}
/*!
+ Returns the current state of the debugger.
+
+ \sa evaluationResumed()
+ \sa evaluationSuspended()
+*/
+QScriptEngineDebugger::DebuggerState QScriptEngineDebugger::state() const
+{
+ Q_D(const QScriptEngineDebugger);
+ return (d->debugger && d->debugger->isInteractive() ? SuspendedState : RunningState);
+}
+
+/*!
Returns a pointer to the instance of the specified standard \a
widget. The widgets available are defined by the DebuggerWidget
diff --git a/src/scripttools/debugging/qscriptenginedebugger.h b/src/scripttools/debugging/qscriptenginedebugger.h
index 0fd4963..b9061a2 100644
--- a/src/scripttools/debugging/qscriptenginedebugger.h
+++ b/src/scripttools/debugging/qscriptenginedebugger.h
@@ -92,6 +92,11 @@ public:
GoToLineAction
};
+ enum DebuggerState {
+ RunningState,
+ SuspendedState
+ };
+
QScriptEngineDebugger(QObject *parent = 0);
~QScriptEngineDebugger();
@@ -108,6 +113,8 @@ public:
QWidget *widget(DebuggerWidget widget) const;
QAction *action(DebuggerAction action) const;
+ DebuggerState state() const;
+
Q_SIGNALS:
void evaluationSuspended();
void evaluationResumed();