Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-updates > by-pkgid > 32e951f007f30f654c2e19437a4aa0ce > files > 124

qtscript5-doc-5.12.6-1.mga7.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qscriptenginedebugger.cpp -->
  <title>QScriptEngineDebugger Class | Qt Script Tools</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td >Qt 5.12</td><td ><a href="qtscripttools-index.html">Qt Script Tools</a></td><td ><a href="qtscripttools-module.html">C++ Classes</a></td><td >QScriptEngineDebugger</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qtscripttools-index.html">Qt 5.12.6 Reference Documentation</a></td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#signals">Signals</a></li>
<li class="level1"><a href="#static-public-members">Static Public Members</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QScriptEngineDebugger Class</h1>
<!-- $$$QScriptEngineDebugger-brief -->
<p>The <a href="qscriptenginedebugger.html">QScriptEngineDebugger</a> class provides a QScriptEngine debugger. <a href="#details">More...</a></p>
<!-- @@@QScriptEngineDebugger -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QScriptEngineDebugger&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += scripttools</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Since:</td><td class="memItemRight bottomAlign">  Qt 4.5</td></tr></table></div><ul>
<li><a href="qscriptenginedebugger-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h2 id="public-types">Public Types</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qscriptenginedebugger.html#DebuggerAction-enum">DebuggerAction</a></b> { InterruptAction, ContinueAction, StepIntoAction, StepOverAction, ..., GoToLineAction }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qscriptenginedebugger.html#DebuggerState-enum">DebuggerState</a></b> { RunningState, SuspendedState }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qscriptenginedebugger.html#DebuggerWidget-enum">DebuggerWidget</a></b> { ConsoleWidget, StackWidget, ScriptsWidget, LocalsWidget, ..., ErrorLogWidget }</td></tr>
</table></div>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qscriptenginedebugger.html#QScriptEngineDebugger">QScriptEngineDebugger</a></b>(QObject *<i>parent</i> = nullptr)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="qscriptenginedebugger.html#dtor.QScriptEngineDebugger">~QScriptEngineDebugger</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QAction *</td><td class="memItemRight bottomAlign"><b><a href="qscriptenginedebugger.html#action">action</a></b>(QScriptEngineDebugger::DebuggerAction <i>action</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qscriptenginedebugger.html#attachTo">attachTo</a></b>(QScriptEngine *<i>engine</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qscriptenginedebugger.html#autoShowStandardWindow">autoShowStandardWindow</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QMenu *</td><td class="memItemRight bottomAlign"><b><a href="qscriptenginedebugger.html#createStandardMenu">createStandardMenu</a></b>(QWidget *<i>parent</i> = nullptr)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QToolBar *</td><td class="memItemRight bottomAlign"><b><a href="qscriptenginedebugger.html#createStandardToolBar">createStandardToolBar</a></b>(QWidget *<i>parent</i> = nullptr)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qscriptenginedebugger.html#detach">detach</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qscriptenginedebugger.html#setAutoShowStandardWindow">setAutoShowStandardWindow</a></b>(bool <i>autoShow</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QMainWindow *</td><td class="memItemRight bottomAlign"><b><a href="qscriptenginedebugger.html#standardWindow">standardWindow</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QScriptEngineDebugger::DebuggerState </td><td class="memItemRight bottomAlign"><b><a href="qscriptenginedebugger.html#state">state</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QWidget *</td><td class="memItemRight bottomAlign"><b><a href="qscriptenginedebugger.html#widget">widget</a></b>(QScriptEngineDebugger::DebuggerWidget <i>widget</i>) const</td></tr>
</table></div>
<a name="signals"></a>
<h2 id="signals">Signals</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qscriptenginedebugger.html#evaluationResumed">evaluationResumed</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qscriptenginedebugger.html#evaluationSuspended">evaluationSuspended</a></b>()</td></tr>
</table></div>
<a name="static-public-members"></a>
<h2 id="static-public-members">Static Public Members</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> const QMetaObject </td><td class="memItemRight bottomAlign"><b><a href="qscriptenginedebugger.html#staticMetaObject-var">staticMetaObject</a></b></td></tr>
</table></div>
<a name="details"></a>
<!-- $$$QScriptEngineDebugger-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qscriptenginedebugger.html">QScriptEngineDebugger</a> class provides a QScriptEngine debugger.</p>
<p>The <a href="qscriptenginedebugger.html">QScriptEngineDebugger</a> class provides a debugger that can be embedded into Qt applications that use Qt Script. The debugger enables the application user to inspect the state of the script environment and control script execution.</p>
<p>To attach the debugger to a script engine, call the <a href="qscriptenginedebugger.html#attachTo">attachTo</a>() function.</p>
<pre class="cpp">

      <span class="type">QScriptEngine</span> engine;
      <span class="type"><a href="qscriptenginedebugger.html#QScriptEngineDebugger">QScriptEngineDebugger</a></span> debugger;
      debugger<span class="operator">.</span>attachTo(<span class="operator">&amp;</span>engine);

</pre>
<p>Once the debugger has been attached to a script engine, you can proceed to evaluate scripts as usual, e.g&#x2e; by calling QScriptEngine::evaluate(). The debugger will be triggered when an uncaught exception occurs, or when a <code>debugger</code> statement is encountered in a script. It is also possible to interrupt script evaluation at an arbitrary time by triggering the <a href="qscriptenginedebugger.html#DebuggerAction-enum">InterruptAction</a>. For instance, to start the debugger when script evaluation starts, you trigger the action before you begin to evaluate() the script.</p>
<pre class="cpp">

       debugger<span class="operator">-</span><span class="operator">&gt;</span>action(<span class="type"><a href="qscriptenginedebugger.html#QScriptEngineDebugger">QScriptEngineDebugger</a></span><span class="operator">::</span>InterruptAction)<span class="operator">-</span><span class="operator">&gt;</span>trigger();
       engine<span class="operator">-</span><span class="operator">&gt;</span>evaluate(contents<span class="operator">,</span> fileName);

</pre>
<p>By default, the <a href="qscriptenginedebugger.html#standardWindow">standard debugger window</a> is shown when evaluation is suspended. This can be changed by calling the <a href="qscriptenginedebugger.html#setAutoShowStandardWindow">setAutoShowStandardWindow</a>() function.</p>
<p>The debugger defines a set of <a href="qscriptenginedebugger.html#DebuggerAction-enum">actions</a> that are available, such as stopping execution or printing the contents of a variable. It also provides a set of widgets (components) that display the information available from the debugger and that trigger the actions on request. The actions available are identified by the <a href="qscriptenginedebugger.html#DebuggerAction-enum">DebuggerAction</a> enum, and the widgets are identified by the <a href="qscriptenginedebugger.html#DebuggerWidget-enum">DebuggerWidget</a> enum.</p>
<p>Access to the individual debugger widgets is provided by the <a href="qscriptenginedebugger.html#widget">widget</a>() function. This makes it possible to arrange the widgets in a custom manner. Similarly, the <a href="qscriptenginedebugger.html#action">action</a>() function provides access to the various debugger actions.</p>
<p>The <a href="qscriptenginedebugger.html#createStandardToolBar">createStandardToolBar</a>() function creates a standard toolbar, and the <a href="qscriptenginedebugger.html#createStandardMenu">createStandardMenu</a>() function creates a standard menu; these functions can be useful if you are creating a custom debugger configuration.</p>
<p>The <a href="qscriptenginedebugger.html#evaluationSuspended">evaluationSuspended</a>() signal is emitted when the debugger has suspended script evaluation and entered interactive mode, i.e&#x2e;, the mode in which it accepts input from the user. The <a href="qscriptenginedebugger.html#evaluationResumed">evaluationResumed</a>() signal is emitted when script evaluation is resumed, i.e, when execution control is given back to the script engine. The <a href="qscriptenginedebugger.html#state">state</a>() function returns the debugger's current state.</p>
<p>When calling QScriptEngine::evaluate() it is useful to pass a descriptive script name (file name) as second argument, as this is the name that will be displayed by the debugger in the <a href="qscriptenginedebugger.html#DebuggerWidget-enum">ScriptsWidget</a>; if a name is not passed, the script will be labelled &quot;anonymous&quot;.</p>
<p>When evaluation is suspended, the debugger will also suspend the event loop of the script. In the following snippet, the call to QScriptEngine::evaluate() causes the debugger to be triggered, and the function call does not return until the user has finished interacting with the debugger.</p>
<pre class="cpp">

      engine<span class="operator">.</span>evaluate(<span class="string">&quot;debugger&quot;</span>);

</pre>
<p>When the Qt Script debugger is running, the C++ application itself is not &quot;frozen&quot;. This means that it is possible that more scripts are evaluated, even though the debugger has suspended evaluation of the <b>current</b> script evaluation. For example, a C++ timer might trigger that causes a script function to be called, or the user might click on a button in the main application user interface whose clicked() signal is connected to a script function. This kind of nested evaluation is permitted. The debugger will enter interactive mode for the new script if an exception is thrown or a breakpoint is reached. Note that it will not stop when encountering <code>debugger</code> statements.</p>
<p>Nested evaluation requires some thought when deciding how the debugger is presented to the user; for example, whether a modal dialog is suitable, or whether some parts of the main application user interface should be disabled while the debugger is running.</p>
<p>Debugging inside of a paintEvent() is currently not supported. If you need to debug painting-related script code, that code should be evaluated outside of the C++ paintEvent(), e.g&#x2e; by rendering to an image, like the Context2D and Tetrix Qt Script examples do. This will make the code safe for debugging.</p>
<p>The debugger adds some special properties to the script engine: <code>__FILE__</code> holds the name of the script in which the current evaluation occurs, and <code>__LINE__</code> holds the current line number. These are useful when doing print()-style debugging (the messages appear in the debugger's debug output widget).</p>
<p>The Qt Script Debugger Manual describes how to use the debugger. The Context2D example shows how to integrate the debugger in applications.</p>
</div>
<p><b>See also </b>QScriptEngine and Context2D Example.</p>
<!-- @@@QScriptEngineDebugger -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$DebuggerAction$$$InterruptAction$$$ContinueAction$$$StepIntoAction$$$StepOverAction$$$StepOutAction$$$RunToCursorAction$$$RunToNewScriptAction$$$ToggleBreakpointAction$$$ClearDebugOutputAction$$$ClearErrorLogAction$$$ClearConsoleAction$$$FindInScriptAction$$$FindNextInScriptAction$$$FindPreviousInScriptAction$$$GoToLineAction -->
<h3 class="fn" id="DebuggerAction-enum"><a name="DebuggerAction-enum"></a>enum QScriptEngineDebugger::<span class="name">DebuggerAction</span></h3>
<p>This enum specifies the action that the <a href="qscriptenginedebugger.html#action">action</a>() function should retrieve. The actions retrieved can be connected to any slot and connected to any widget. Please see the Qt Script Debugger Manual's Console Command Reference for a detailed description of these actions.</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QScriptEngineDebugger::InterruptAction</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">Suspends script execution as soon as the next script statement is reached.</td></tr>
<tr><td class="topAlign"><code>QScriptEngineDebugger::ContinueAction</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">Gives the execution control back to the script engine.</td></tr>
<tr><td class="topAlign"><code>QScriptEngineDebugger::StepIntoAction</code></td><td class="topAlign tblval"><code>2</code></td><td class="topAlign">Performs a step action.</td></tr>
<tr><td class="topAlign"><code>QScriptEngineDebugger::StepOverAction</code></td><td class="topAlign tblval"><code>3</code></td><td class="topAlign">Performs a next action.</td></tr>
<tr><td class="topAlign"><code>QScriptEngineDebugger::StepOutAction</code></td><td class="topAlign tblval"><code>4</code></td><td class="topAlign">Executes the script until the current function returns.</td></tr>
<tr><td class="topAlign"><code>QScriptEngineDebugger::RunToCursorAction</code></td><td class="topAlign tblval"><code>5</code></td><td class="topAlign">Continues execution to the selected line (which contains the cursor) in the <a href="qscriptenginedebugger.html#DebuggerWidget-enum">CodeWidget</a>.</td></tr>
<tr><td class="topAlign"><code>QScriptEngineDebugger::RunToNewScriptAction</code></td><td class="topAlign tblval"><code>6</code></td><td class="topAlign">Returns control to the script engine until a new script is executed.</td></tr>
<tr><td class="topAlign"><code>QScriptEngineDebugger::ToggleBreakpointAction</code></td><td class="topAlign tblval"><code>7</code></td><td class="topAlign">Toggles a breakpoint at the selected line in the <a href="qscriptenginedebugger.html#DebuggerWidget-enum">CodeWidget</a>.</td></tr>
<tr><td class="topAlign"><code>QScriptEngineDebugger::ClearDebugOutputAction</code></td><td class="topAlign tblval"><code>8</code></td><td class="topAlign">Clears the contents of the <a href="qscriptenginedebugger.html#DebuggerWidget-enum">DebugOutputWidget</a>.</td></tr>
<tr><td class="topAlign"><code>QScriptEngineDebugger::ClearErrorLogAction</code></td><td class="topAlign tblval"><code>9</code></td><td class="topAlign">Clears the contents of the <a href="qscriptenginedebugger.html#DebuggerWidget-enum">ErrorLogWidget</a>.</td></tr>
<tr><td class="topAlign"><code>QScriptEngineDebugger::ClearConsoleAction</code></td><td class="topAlign tblval"><code>10</code></td><td class="topAlign">Clears the contents of the <a href="qscriptenginedebugger.html#DebuggerWidget-enum">ConsoleWidget</a>.</td></tr>
<tr><td class="topAlign"><code>QScriptEngineDebugger::FindInScriptAction</code></td><td class="topAlign tblval"><code>11</code></td><td class="topAlign">Displays the <a href="qscriptenginedebugger.html#DebuggerWidget-enum">CodeFinderWidget</a>.</td></tr>
<tr><td class="topAlign"><code>QScriptEngineDebugger::FindNextInScriptAction</code></td><td class="topAlign tblval"><code>12</code></td><td class="topAlign">Finds next occurrence in the <a href="qscriptenginedebugger.html#DebuggerWidget-enum">CodeWidget</a>.</td></tr>
<tr><td class="topAlign"><code>QScriptEngineDebugger::FindPreviousInScriptAction</code></td><td class="topAlign tblval"><code>13</code></td><td class="topAlign">Finds previous occurrence in the <a href="qscriptenginedebugger.html#DebuggerWidget-enum">CodeWidget</a>.</td></tr>
<tr><td class="topAlign"><code>QScriptEngineDebugger::GoToLineAction</code></td><td class="topAlign tblval"><code>14</code></td><td class="topAlign">Shows the &quot;Go to Line&quot; dialog.</td></tr>
</table></div>
<!-- @@@DebuggerAction -->
<!-- $$$DebuggerState$$$RunningState$$$SuspendedState -->
<h3 class="fn" id="DebuggerState-enum"><a name="DebuggerState-enum"></a>enum QScriptEngineDebugger::<span class="name">DebuggerState</span></h3>
<p>This enum specifies the current state of the debugger.</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QScriptEngineDebugger::RunningState</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">The debugger is running. (Script evaluation is allowed.)</td></tr>
<tr><td class="topAlign"><code>QScriptEngineDebugger::SuspendedState</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">The debugger has suspended script evaluation.</td></tr>
</table></div>
<p>This enum was introduced or modified in  Qt 4.6.</p>
<!-- @@@DebuggerState -->
<!-- $$$DebuggerWidget$$$ConsoleWidget$$$StackWidget$$$ScriptsWidget$$$LocalsWidget$$$CodeWidget$$$CodeFinderWidget$$$BreakpointsWidget$$$DebugOutputWidget$$$ErrorLogWidget -->
<h3 class="fn" id="DebuggerWidget-enum"><a name="DebuggerWidget-enum"></a>enum QScriptEngineDebugger::<span class="name">DebuggerWidget</span></h3>
<p>This enum decides the widget that the <a href="qscriptenginedebugger.html#widget">widget</a>() function should retrieve. We treat these widgets in more detail in the Qt Script Debugger Manual.</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QScriptEngineDebugger::ConsoleWidget</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">Provides a command-line interface to the debugger.</td></tr>
<tr><td class="topAlign"><code>QScriptEngineDebugger::StackWidget</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">Shows a backtrace of the script's execution state.</td></tr>
<tr><td class="topAlign"><code>QScriptEngineDebugger::ScriptsWidget</code></td><td class="topAlign tblval"><code>2</code></td><td class="topAlign">Displays a list of currently loaded scripts.</td></tr>
<tr><td class="topAlign"><code>QScriptEngineDebugger::LocalsWidget</code></td><td class="topAlign tblval"><code>3</code></td><td class="topAlign">Shows the local variables of the current stack frame.</td></tr>
<tr><td class="topAlign"><code>QScriptEngineDebugger::CodeWidget</code></td><td class="topAlign tblval"><code>4</code></td><td class="topAlign">Displays the code of the current script.</td></tr>
<tr><td class="topAlign"><code>QScriptEngineDebugger::CodeFinderWidget</code></td><td class="topAlign tblval"><code>5</code></td><td class="topAlign">Provides a widget that can search for text in the script shown in the CodeWidget.</td></tr>
<tr><td class="topAlign"><code>QScriptEngineDebugger::BreakpointsWidget</code></td><td class="topAlign tblval"><code>6</code></td><td class="topAlign">Shows breakpoints that have been set.</td></tr>
<tr><td class="topAlign"><code>QScriptEngineDebugger::DebugOutputWidget</code></td><td class="topAlign tblval"><code>7</code></td><td class="topAlign">Contains output from the <code>print()</code> script function.</td></tr>
<tr><td class="topAlign"><code>QScriptEngineDebugger::ErrorLogWidget</code></td><td class="topAlign tblval"><code>8</code></td><td class="topAlign">Shows error messages that have been generated.</td></tr>
</table></div>
<!-- @@@DebuggerWidget -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QScriptEngineDebugger[overload1]$$$QScriptEngineDebuggerQObject* -->
<h3 class="fn" id="QScriptEngineDebugger"><a name="QScriptEngineDebugger"></a>QScriptEngineDebugger::<span class="name">QScriptEngineDebugger</span>(<span class="type">QObject</span> *<i>parent</i> = nullptr)</h3>
<p>Constructs a new <a href="qscriptenginedebugger.html">QScriptEngineDebugger</a> object with the given <i>parent</i>.</p>
<p>To attach a QScriptEngine to the debugger, use <a href="qscriptenginedebugger.html#attachTo">attachTo</a>() function.</p>
<!-- @@@QScriptEngineDebugger -->
<!-- $$$~QScriptEngineDebugger[overload1]$$$~QScriptEngineDebugger -->
<h3 class="fn" id="dtor.QScriptEngineDebugger"><a name="dtor.QScriptEngineDebugger"></a><code>[virtual] </code>QScriptEngineDebugger::<span class="name">~QScriptEngineDebugger</span>()</h3>
<p>Destroys this <a href="qscriptenginedebugger.html">QScriptEngineDebugger</a>.</p>
<!-- @@@~QScriptEngineDebugger -->
<!-- $$$action[overload1]$$$actionQScriptEngineDebugger::DebuggerAction -->
<h3 class="fn" id="action"><a name="action"></a><span class="type">QAction</span> *QScriptEngineDebugger::<span class="name">action</span>(<span class="type"><a href="qscriptenginedebugger.html#DebuggerAction-enum">QScriptEngineDebugger::DebuggerAction</a></span> <i>action</i>) const</h3>
<p>Returns a pointer to the specified <i>action</i>. The actions available are given by the <a href="qscriptenginedebugger.html#DebuggerAction-enum">DebuggerAction</a> enum.</p>
<p>With this function, you can add the actions to your own widgets, toolbars, and menus. It is also convenient if you, for example, wish to spice things up with your own groovy icons. The code example below shows how to add actions to a QToolBar.</p>
<pre class="cpp">

      <span class="type">QAction</span> <span class="operator">*</span>continueAction <span class="operator">=</span> debugger<span class="operator">-</span><span class="operator">&gt;</span>action(<span class="type"><a href="qscriptenginedebugger.html#QScriptEngineDebugger">QScriptEngineDebugger</a></span><span class="operator">::</span>ContinueAction);
      <span class="type">QAction</span> <span class="operator">*</span>stepOverAction <span class="operator">=</span> debugger<span class="operator">-</span><span class="operator">&gt;</span>action(<span class="type"><a href="qscriptenginedebugger.html#QScriptEngineDebugger">QScriptEngineDebugger</a></span><span class="operator">::</span>StepOverAction);
      <span class="type">QAction</span> <span class="operator">*</span>stepIntoAction <span class="operator">=</span> debugger<span class="operator">-</span><span class="operator">&gt;</span>action(<span class="type"><a href="qscriptenginedebugger.html#QScriptEngineDebugger">QScriptEngineDebugger</a></span><span class="operator">::</span>StepIntoAction);

      <span class="type">QToolBar</span> <span class="operator">*</span>toolBar <span class="operator">=</span> <span class="keyword">new</span> <span class="type">QToolBar</span>;
      toolBar<span class="operator">-</span><span class="operator">&gt;</span>addAction(continueAction);

</pre>
<p>Note that <a href="qscriptenginedebugger.html">QScriptEngineDebugger</a> has already added the actions to its <a href="qscriptenginedebugger.html#DebuggerWidget-enum">standard widgets</a> and <a href="qscriptenginedebugger.html#standardWindow">standard window</a>.</p>
<p><b>See also </b><a href="qscriptenginedebugger.html#widget">widget</a>(), <a href="qscriptenginedebugger.html#createStandardMenu">createStandardMenu</a>(), <a href="qscriptenginedebugger.html#createStandardToolBar">createStandardToolBar</a>(), and <a href="qscriptenginedebugger.html#standardWindow">standardWindow</a>().</p>
<!-- @@@action -->
<!-- $$$attachTo[overload1]$$$attachToQScriptEngine* -->
<h3 class="fn" id="attachTo"><a name="attachTo"></a><span class="type">void</span> QScriptEngineDebugger::<span class="name">attachTo</span>(<span class="type">QScriptEngine</span> *<i>engine</i>)</h3>
<p>Attaches to the given <i>engine</i>.</p>
<p>The debugger will install a custom agent (using QScriptEngine::setAgent()) to monitor the engine. While the debugger is attached, you should not change the agent; however, if you do have to perform additional monitoring, you must set a proxy agent that forwards all events to the debugger's agent.</p>
<p><b>See also </b><a href="qscriptenginedebugger.html#detach">detach</a>().</p>
<!-- @@@attachTo -->
<!-- $$$autoShowStandardWindow[overload1]$$$autoShowStandardWindow -->
<h3 class="fn" id="autoShowStandardWindow"><a name="autoShowStandardWindow"></a><span class="type">bool</span> QScriptEngineDebugger::<span class="name">autoShowStandardWindow</span>() const</h3>
<p>Returns whether the standard debugger window is automatically shown when evaluation is suspended.</p>
<p>The default is true.</p>
<p><b>See also </b><a href="qscriptenginedebugger.html#setAutoShowStandardWindow">setAutoShowStandardWindow</a>().</p>
<!-- @@@autoShowStandardWindow -->
<!-- $$$createStandardMenu[overload1]$$$createStandardMenuQWidget* -->
<h3 class="fn" id="createStandardMenu"><a name="createStandardMenu"></a><span class="type">QMenu</span> *QScriptEngineDebugger::<span class="name">createStandardMenu</span>(<span class="type">QWidget</span> *<i>parent</i> = nullptr)</h3>
<p>Creates a standard debugger menu with the given <i>parent</i>. Returns the new menu object.</p>
<p><b>See also </b><a href="qscriptenginedebugger.html#createStandardToolBar">createStandardToolBar</a>().</p>
<!-- @@@createStandardMenu -->
<!-- $$$createStandardToolBar[overload1]$$$createStandardToolBarQWidget* -->
<h3 class="fn" id="createStandardToolBar"><a name="createStandardToolBar"></a><span class="type">QToolBar</span> *QScriptEngineDebugger::<span class="name">createStandardToolBar</span>(<span class="type">QWidget</span> *<i>parent</i> = nullptr)</h3>
<p>Creates a standard debugger toolbar with the given <i>parent</i>. Returns the new toolbar object.</p>
<p><b>See also </b><a href="qscriptenginedebugger.html#createStandardMenu">createStandardMenu</a>().</p>
<!-- @@@createStandardToolBar -->
<!-- $$$detach[overload1]$$$detach -->
<h3 class="fn" id="detach"><a name="detach"></a><span class="type">void</span> QScriptEngineDebugger::<span class="name">detach</span>()</h3>
<p>Detaches from the current script engine, if any.</p>
<p><b>See also </b><a href="qscriptenginedebugger.html#attachTo">attachTo</a>().</p>
<!-- @@@detach -->
<!-- $$$evaluationResumed[overload1]$$$evaluationResumed -->
<h3 class="fn" id="evaluationResumed"><a name="evaluationResumed"></a><code>[signal] </code><span class="type">void</span> QScriptEngineDebugger::<span class="name">evaluationResumed</span>()</h3>
<p>This signal is emitted when the debugger has resumed script evaluation (e.g&#x2e; the user gave the &quot;continue&quot; command).</p>
<p><b>See also </b><a href="qscriptenginedebugger.html#evaluationSuspended">evaluationSuspended</a>().</p>
<!-- @@@evaluationResumed -->
<!-- $$$evaluationSuspended[overload1]$$$evaluationSuspended -->
<h3 class="fn" id="evaluationSuspended"><a name="evaluationSuspended"></a><code>[signal] </code><span class="type">void</span> QScriptEngineDebugger::<span class="name">evaluationSuspended</span>()</h3>
<p>This signal is emitted when the debugger has suspended script evaluation for whatever reason (e.g&#x2e; due to an uncaught script exception, or due to a breakpoint being triggered).</p>
<p><b>See also </b><a href="qscriptenginedebugger.html#evaluationResumed">evaluationResumed</a>().</p>
<!-- @@@evaluationSuspended -->
<!-- $$$setAutoShowStandardWindow[overload1]$$$setAutoShowStandardWindowbool -->
<h3 class="fn" id="setAutoShowStandardWindow"><a name="setAutoShowStandardWindow"></a><span class="type">void</span> QScriptEngineDebugger::<span class="name">setAutoShowStandardWindow</span>(<span class="type">bool</span> <i>autoShow</i>)</h3>
<p>Sets whether the standard debugger window is automatically shown when evaluation is suspended. If <i>autoShow</i> is true, the window will be automatically shown, otherwise it will not.</p>
<p><b>See also </b><a href="qscriptenginedebugger.html#autoShowStandardWindow">autoShowStandardWindow</a>().</p>
<!-- @@@setAutoShowStandardWindow -->
<!-- $$$standardWindow[overload1]$$$standardWindow -->
<h3 class="fn" id="standardWindow"><a name="standardWindow"></a><span class="type">QMainWindow</span> *QScriptEngineDebugger::<span class="name">standardWindow</span>() const</h3>
<p>Returns a main window with a standard configuration of the debugger's components.</p>
<p><b>See also </b><a href="qscriptenginedebugger.html#createStandardMenu">createStandardMenu</a>() and <a href="qscriptenginedebugger.html#createStandardToolBar">createStandardToolBar</a>().</p>
<!-- @@@standardWindow -->
<!-- $$$state[overload1]$$$state -->
<h3 class="fn" id="state"><a name="state"></a><span class="type"><a href="qscriptenginedebugger.html#DebuggerState-enum">QScriptEngineDebugger::DebuggerState</a></span> QScriptEngineDebugger::<span class="name">state</span>() const</h3>
<p>Returns the current state of the debugger.</p>
<p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qscriptenginedebugger.html#evaluationResumed">evaluationResumed</a>() and <a href="qscriptenginedebugger.html#evaluationSuspended">evaluationSuspended</a>().</p>
<!-- @@@state -->
<!-- $$$widget[overload1]$$$widgetQScriptEngineDebugger::DebuggerWidget -->
<h3 class="fn" id="widget"><a name="widget"></a><span class="type">QWidget</span> *QScriptEngineDebugger::<span class="name">widget</span>(<span class="type"><a href="qscriptenginedebugger.html#DebuggerWidget-enum">QScriptEngineDebugger::DebuggerWidget</a></span> <i>widget</i>) const</h3>
<p>Returns a pointer to the instance of the specified standard <i>widget</i>. The widgets available are defined by the <a href="qscriptenginedebugger.html#DebuggerWidget-enum">DebuggerWidget</a> enum.</p>
<p>A main window containing all widgets is returned by <a href="qscriptenginedebugger.html#standardWindow">standardWindow</a>(). If you do not want to use this window, you can fetch the individual widgets with this function. For instance, the code example below shows how to set up a layout containing a <a href="qscriptenginedebugger.html#DebuggerWidget-enum">code window</a> and a <a href="qscriptenginedebugger.html#DebuggerWidget-enum">stack widget</a>.</p>
<pre class="cpp">

      <span class="type">QWidget</span> <span class="operator">*</span>codeWindow <span class="operator">=</span> debugger<span class="operator">-</span><span class="operator">&gt;</span>widget(<span class="type"><a href="qscriptenginedebugger.html#QScriptEngineDebugger">QScriptEngineDebugger</a></span><span class="operator">::</span>CodeWidget);
      <span class="type">QWidget</span> <span class="operator">*</span>stackWidget <span class="operator">=</span> debugger<span class="operator">-</span><span class="operator">&gt;</span>widget(<span class="type"><a href="qscriptenginedebugger.html#QScriptEngineDebugger">QScriptEngineDebugger</a></span><span class="operator">::</span>StackWidget);

      <span class="type">QLayout</span> <span class="operator">*</span>layout <span class="operator">=</span> <span class="keyword">new</span> <span class="type">QHBoxLayout</span>;
      layout<span class="operator">-</span><span class="operator">&gt;</span>addWidget(codeWindow);
      layout<span class="operator">-</span><span class="operator">&gt;</span>addWidget(stackWidget);

</pre>
<p>Note that you need to set <a href="qscriptenginedebugger.html#setAutoShowStandardWindow">setAutoShowStandardWindow</a>() to false; if not, the standard window will be shown regardless.</p>
<p><b>See also </b><a href="qscriptenginedebugger.html#action">action</a>(), <a href="qscriptenginedebugger.html#standardWindow">standardWindow</a>(), and <a href="qscriptenginedebugger.html#setAutoShowStandardWindow">setAutoShowStandardWindow</a>().</p>
<!-- @@@widget -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2019 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br/>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br/>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>