<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                # QScriptEngineDebugger Class Reference ## [[QtScriptTools](index.htm) module] 該QScriptEngineDebugger類提供了一個[QScriptEngine](qscriptengine.html)調試器。[More...](#details) 繼承[QObject](qobject.html)。 ### Types * `enum DebuggerAction { InterruptAction, ContinueAction, StepIntoAction, StepOverAction, ..., GoToLineAction }` * `enum DebuggerState { RunningState, SuspendedState }` * `enum DebuggerWidget { ConsoleWidget, StackWidget, ScriptsWidget, LocalsWidget, ..., ErrorLogWidget }` ### Methods * `__init__ (self, QObject?parent?=?None)` * `QAction action (self, DebuggerAction?action)` * `attachTo (self, QScriptEngine?engine)` * `bool autoShowStandardWindow (self)` * `QMenu createStandardMenu (self, QWidget?parent?=?None)` * `QToolBar createStandardToolBar (self, QWidget?parent?=?None)` * `detach (self)` * `setAutoShowStandardWindow (self, bool?autoShow)` * `QMainWindow standardWindow (self)` * `DebuggerState state (self)` * `QWidget widget (self, DebuggerWidget?widget)` ### Qt Signals * `void evaluationResumed ()` * `void evaluationSuspended ()` * * * ## Detailed Description 該QScriptEngineDebugger類提供了一個[QScriptEngine](qscriptengine.html)調試器。 該QScriptEngineDebugger類提供了一個可以嵌入到使用Qt腳本Qt應用程序調試器。調試器允許應用程序用戶能夠檢查腳本環境的狀態和控制腳本的執行。 為了將調試器附加到一個腳本引擎,調用[attachTo](qscriptenginedebugger.html#attachTo)()函數。 ``` [QScriptEngine](qscriptengine.html) engine; QScriptEngineDebugger debugger; debugger.attachTo(&engine); ``` 一旦調試器已附加到一個腳本引擎,你可以繼續執行腳本像往常一樣,例如:通過調用[QScriptEngine.evaluate](qscriptengine.html#evaluate)( ) 。當一個未捕獲的異常發生時,調試器將被觸發,或當`debugger`語句在腳本中遇到的問題。它也可以通過觸發中斷腳本評估在任意時間[InterruptAction](qscriptenginedebugger.html#DebuggerAction-enum)。例如,當腳本評估開始啟動調試器,你觸發動作開始之前,你[evaluate()](qscriptengine.html#evaluate)該腳本。 ``` debugger->action(QScriptEngineDebugger.InterruptAction)->trigger(); engine->evaluate(contents, fileName); ``` 默認情況下,[standard debugger window](qscriptenginedebugger.html#standardWindow)如圖評估時暫停。這可以通過調用被改變[setAutoShowStandardWindow](qscriptenginedebugger.html#setAutoShowStandardWindow)()函數。 調試器定義了一組[actions](qscriptenginedebugger.html#DebuggerAction-enum)可用,例如停止執行或打印變量的內容。它還提供了一組小部件(組件)的顯示可以從調試器和觸發器要求的操作的信息。可用的操作是由所識別的[DebuggerAction](qscriptenginedebugger.html#DebuggerAction-enum)枚舉和小部件是由所識別的[DebuggerWidget](qscriptenginedebugger.html#DebuggerWidget-enum)枚舉。 訪問各個調試窗口小部件是由提供[widget](qscriptenginedebugger.html#widget)()函數。這使得它可以安排在一個自定義的方式在窗口小部件。類似地,[action](qscriptenginedebugger.html#action)( )函數提供了訪問各種調試操作。 該[createStandardToolBar](qscriptenginedebugger.html#createStandardToolBar)( )函數創建一個標準工具欄,以及[createStandardMenu](qscriptenginedebugger.html#createStandardMenu)( )函數創建一個標準的菜單,如果要創建一個自定義的調試器配置這些功能可能是有用的。 該[evaluationSuspended](qscriptenginedebugger.html#evaluationSuspended)()信號被發射時,調試器已經暫停腳本的評價和輸入的交互模式下,即,在它接受來自用戶的輸入的方式。該[evaluationResumed](qscriptenginedebugger.html#evaluationResumed)當腳本執行恢復( )信號被發射,即當執行控制權還回給腳本引擎。該[state](qscriptenginedebugger.html#state)( )函數返回調試器的當前狀態。 當調用[QScriptEngine.evaluate](qscriptengine.html#evaluate)( ),它通過一個描述性的腳本名稱(文件名)作為第二個參數是非常有用的,因為這是將被調試器中顯示的名稱[ScriptsWidget](qscriptenginedebugger.html#DebuggerWidget-enum),如果一個名字不獲通過,該腳本將被標記為“匿名” 。 當評估被暫停,調試器也將暫停腳本的事件循環。在下面的片段中,調用[QScriptEngine.evaluate](qscriptengine.html#evaluate)( )使得調試器被觸發,該函數調用不會返回,直到用戶完成與調試器進行交互。 ``` engine.evaluate("debugger"); ``` 當Qt的腳本調試器運行時,C + +應用程序本身并沒有“凍結” 。這意味著,有可能是多個腳本進行評估,盡管調試器已暫停的評價**current**腳本的評價。例如,一個C + +計時器可能引發導致被調用的腳本函數,或者用戶可能會在主應用程序用戶界面的點擊( )信號連接到一個腳本功能,點擊一個按鈕。這種嵌套的評價是允許的。調試器將進入交互模式為新的腳本,如果有異常拋出,或到達斷點。需要注意的是,當遇到它不會停止`debugger`語句。 嵌套的評價需要一些思考決定調試器是如何呈現給用戶時,例如,一個模態對話框是否適合,還是主應用程序用戶界面的某些部分應在調試器運行時被禁用。 調試的內[paintEvent](qwidget.html#paintEvent)( )目前不支持。如果你需要調試繪畫相關的腳本代碼,該代碼應在C + +中的paintEvent (外部評價) ,如通過繪制一個圖像,像Context2D和蚱[QtScript](index.htm)例子做。這將使得代碼安全進行調試。 調試器添加了一些特殊性能的腳本引擎:`__FILE__`保存在其中的當前評估產生的腳本的名稱,并`__LINE__`保持當前的行號。這些做的print()風格的調試(該消息出現在調試器的調試輸出窗口小部件)時是有用的。 該[Qt Script Debugger Manual](index.htm)介紹如何使用調試器。該[Context2D example](index.htm)顯示了如何將調試器集成在應用程序中。 * * * ## Type Documentation ``` QScriptEngineDebugger.DebuggerAction ``` 這個枚舉變量指定動作的[action](qscriptenginedebugger.html#action)( )函數應該找回。檢索到的動作可以被連接到任何槽,并連接到任何插件。請參閱[Qt Script Debugger Manual](index.htm)的[Console Command Reference](index.htm#console-command-reference)這些動作的詳細描述。 | Constant | Value | Description | | --- | --- | --- | | `QScriptEngineDebugger.InterruptAction` | `0` | 只要下一個腳本語句達到暫停腳本的執行。 | | `QScriptEngineDebugger.ContinueAction` | `1` | 給人的執行控制權交還給腳本引擎。 | | `QScriptEngineDebugger.StepIntoAction` | `2` | 執行步驟操作。 | | `QScriptEngineDebugger.StepOverAction` | `3` | 進行下一個動作。 | | `QScriptEngineDebugger.StepOutAction` | `4` | 執行腳本,直到當前函數返回。 | | `QScriptEngineDebugger.RunToCursorAction` | `5` | 繼續執行到所選擇的行(其中包含光標)在[CodeWidget](qscriptenginedebugger.html#DebuggerWidget-enum)。 | | `QScriptEngineDebugger.RunToNewScriptAction` | `6` | 將控制返回給腳本引擎,直到一個新的腳本被執行。 | | `QScriptEngineDebugger.ToggleBreakpointAction` | `7` | 切換斷點在選定的線路[CodeWidget](qscriptenginedebugger.html#DebuggerWidget-enum)。 | | `QScriptEngineDebugger.ClearDebugOutputAction` | `8` | 清除的內容[DebugOutputWidget](qscriptenginedebugger.html#DebuggerWidget-enum)。 | | `QScriptEngineDebugger.ClearErrorLogAction` | `9` | 清除的內容[ErrorLogWidget](qscriptenginedebugger.html#DebuggerWidget-enum)。 | | `QScriptEngineDebugger.ClearConsoleAction` | `10` | 清除的內容[ConsoleWidget](qscriptenginedebugger.html#DebuggerWidget-enum)。 | | `QScriptEngineDebugger.FindInScriptAction` | `11` | 顯示[CodeFinderWidget](qscriptenginedebugger.html#DebuggerWidget-enum)。 | | `QScriptEngineDebugger.FindNextInScriptAction` | `12` | 查找下一個出現在[CodeWidget](qscriptenginedebugger.html#DebuggerWidget-enum)。 | | `QScriptEngineDebugger.FindPreviousInScriptAction` | `13` | 查找以前發生在[CodeWidget](qscriptenginedebugger.html#DebuggerWidget-enum)。 | | `QScriptEngineDebugger.GoToLineAction` | `14` | 顯示“轉至行”對話框。 | ``` QScriptEngineDebugger.DebuggerState ``` 這個枚舉指定調試器的當前狀態。 | Constant | Value | Description | | --- | --- | --- | | `QScriptEngineDebugger.RunningState` | `0` | 在調試器運行。 (腳本的評價是允許的。 ) | | `QScriptEngineDebugger.SuspendedState` | `1` | 該調試器已暫停腳本的評價。 | 這個枚舉被引入或修改的Qt 4.6 。 ``` QScriptEngineDebugger.DebuggerWidget ``` 這個枚舉變量決定了小部件的[widget](qscriptenginedebugger.html#widget)( )函數應該找回。我們在詳細對待這些小部件[Qt Script Debugger Manual](index.htm)。 | Constant | Value | Description | | --- | --- | --- | | `QScriptEngineDebugger.ConsoleWidget` | `0` | 提供了一個命令行界面的調試器。 | | `QScriptEngineDebugger.StackWidget` | `1` | 顯示腳本的執行狀態的回溯。 | | `QScriptEngineDebugger.ScriptsWidget` | `2` | 顯示當前加載的腳本列表。 | | `QScriptEngineDebugger.LocalsWidget` | `3` | 顯示當前堆棧幀的局部變量。 | | `QScriptEngineDebugger.CodeWidget` | `4` | 顯示當前腳本的代碼。 | | `QScriptEngineDebugger.CodeFinderWidget` | `5` | 提供可搜索在CodeWidget所示的腳本文本的小工具。 | | `QScriptEngineDebugger.BreakpointsWidget` | `6` | 顯示已設置的斷點。 | | `QScriptEngineDebugger.DebugOutputWidget` | `7` | 包含從輸出`print()`腳本函數。 | | `QScriptEngineDebugger.ErrorLogWidget` | `8` | 顯示已生成的錯誤消息。 | * * * ## Method Documentation ``` QScriptEngineDebugger.__init__ (self, QObject?parent?=?None) ``` 該_parent_的說法,如果不是沒有,原因_self_通過Qt的,而不是PyQt的擁有。 構造一個新的[QScriptEngineDebugger](qscriptenginedebugger.html)與給定對象_parent_。 要附加[QScriptEngine](qscriptengine.html)到調試器,使用[attachTo](qscriptenginedebugger.html#attachTo)()函數。 ``` QAction QScriptEngineDebugger.action (self, DebuggerAction?action) ``` [](qaction.html) [返回一個指向指定的_action_。可用的操作是由給定的](qaction.html)[DebuggerAction](qscriptenginedebugger.html#DebuggerAction-enum)枚舉。 有了這個功能,你可以添加動作,將自己的小部件,工具欄和菜單。這也是方便的,如果你,例如,希望香料的東西用自己的常規圖標。下面的代碼示例演示如何將動作添加到[QToolBar](qtoolbar.html)。 ``` [QAction](qaction.html) *continueAction = debugger->action([QScriptEngineDebugger](qscriptenginedebugger.html).ContinueAction); [QAction](qaction.html) *stepOverAction = debugger->action([QScriptEngineDebugger](qscriptenginedebugger.html).StepOverAction); [QAction](qaction.html) *stepIntoAction = debugger->action([QScriptEngineDebugger](qscriptenginedebugger.html).StepIntoAction); [QToolBar](qtoolbar.html) *toolBar = new [QToolBar](qtoolbar.html); toolBar->addAction(continueAction); ``` 需要注意的是[QScriptEngineDebugger](qscriptenginedebugger.html)已經添加了行動,其[standard widgets](qscriptenginedebugger.html#DebuggerWidget-enum)和[standard window](qscriptenginedebugger.html#standardWindow)。 **See also** [widget](qscriptenginedebugger.html#widget)( )[createStandardMenu](qscriptenginedebugger.html#createStandardMenu)( )[createStandardToolBar](qscriptenginedebugger.html#createStandardToolBar)()和[standardWindow](qscriptenginedebugger.html#standardWindow)( ) 。 ``` QScriptEngineDebugger.attachTo (self, QScriptEngine?engine) ``` 附加到給定的_engine_。 調試器將安裝一個自定義代理(使用[QScriptEngine.setAgent](qscriptengine.html#setAgent)())來監測發動機。雖然附加調試器,你不應該改變的代理,但是,如果你必須執行額外的監控,你必須設置一個代理程序,它會將所有事件到調試器的代理。 **See also** [detach](qscriptenginedebugger.html#detach)( ) 。 ``` bool QScriptEngineDebugger.autoShowStandardWindow (self) ``` 返回是否評估時被掛起的標準調試器窗口會自動顯示。 默認值為True 。 **See also** [setAutoShowStandardWindow](qscriptenginedebugger.html#setAutoShowStandardWindow)( ) 。 ``` QMenu QScriptEngineDebugger.createStandardMenu (self, QWidget?parent?=?None) ``` [ 該_parent_的說法,如果不是沒有,原因_self_通過Qt的,而不是PyQt的擁有。 創建具有給定一個標準的調試器菜單_parent_。返回新的菜單對象。 ](qmenu.html) [**See also**](qmenu.html) [createStandardToolBar](qscriptenginedebugger.html#createStandardToolBar)( ) 。 ``` QToolBar QScriptEngineDebugger.createStandardToolBar (self, QWidget?parent?=?None) ``` [ 該_parent_的說法,如果不是沒有,原因_self_通過Qt的,而不是PyQt的擁有。 建立一個標準的調試器工具欄與給定_parent_。返回新的工具欄對象。 ](qtoolbar.html) [**See also**](qtoolbar.html) [createStandardMenu](qscriptenginedebugger.html#createStandardMenu)( ) 。 ``` QScriptEngineDebugger.detach (self) ``` 分離從目前的腳本引擎,如果有的話。 **See also** [attachTo](qscriptenginedebugger.html#attachTo)( ) 。 ``` QScriptEngineDebugger.setAutoShowStandardWindow (self, bool?autoShow) ``` 設置是否在評估被暫停的標準調試器窗口會自動顯示。如果_autoShow_為True,則窗口會自動顯示,否則不會。 **See also** [autoShowStandardWindow](qscriptenginedebugger.html#autoShowStandardWindow)( ) 。 ``` QMainWindow QScriptEngineDebugger.standardWindow (self) ``` [ 返回主窗口與調試器的組件的標準配置。 ](qmainwindow.html) [**See also**](qmainwindow.html) [createStandardMenu](qscriptenginedebugger.html#createStandardMenu)()和[createStandardToolBar](qscriptenginedebugger.html#createStandardToolBar)( ) 。 ``` DebuggerState QScriptEngineDebugger.state (self) ``` [ 返回調試器的當前狀態。 此功能被引入Qt的4.6 。 ](qscriptenginedebugger.html#DebuggerState-enum) [**See also**](qscriptenginedebugger.html#DebuggerState-enum) [evaluationResumed](qscriptenginedebugger.html#evaluationResumed)()和[evaluationSuspended](qscriptenginedebugger.html#evaluationSuspended)( ) 。 ``` QWidget QScriptEngineDebugger.widget (self, DebuggerWidget?widget) ``` [](qwidget.html) [返回一個指向指定標準的實例_widget_。可用的窗口小部件是由定義](qwidget.html)[DebuggerWidget](qscriptenginedebugger.html#DebuggerWidget-enum)枚舉。 通過返回一個包含所有小部件的主窗口[standardWindow](qscriptenginedebugger.html#standardWindow)( ) 。如果你不想使用這個窗口中,您可以獲取各個部件使用此功能。例如,下面的代碼示例顯示了如何設置包含布局[code window](qscriptenginedebugger.html#DebuggerWidget-enum)和[stack widget](qscriptenginedebugger.html#DebuggerWidget-enum)。 ``` [QWidget](qwidget.html) *codeWindow = debugger->widget([QScriptEngineDebugger](qscriptenginedebugger.html).CodeWidget); [QWidget](qwidget.html) *stackWidget = debugger->widget([QScriptEngineDebugger](qscriptenginedebugger.html).StackWidget); [QLayout](qlayout.html) *layout = new [QHBoxLayout](qhboxlayout.html); layout->addWidget(codeWindow); layout->addWidget(stackWidget); ``` 請注意,您需要設置[setAutoShowStandardWindow](qscriptenginedebugger.html#setAutoShowStandardWindow)( )為False ;若否,標準的窗口將不分顯示。 **See also** [action](qscriptenginedebugger.html#action)( )[standardWindow](qscriptenginedebugger.html#standardWindow)()和[setAutoShowStandardWindow](qscriptenginedebugger.html#setAutoShowStandardWindow)( ) 。 * * * ## Qt Signal Documentation ``` void evaluationResumed () ``` 這是該信號的默認超載。 當調試器已經恢復腳本的評價(如用戶給予“繼續”命令),這個信號被發射。 **See also** [evaluationSuspended](qscriptenginedebugger.html#evaluationSuspended)( ) 。 ``` void evaluationSuspended () ``` 這是該信號的默認超載。 這個信號被發射時,調試器已因任何原因而暫停腳本執行(例如由于未捕獲到腳本異常,或由于斷點被觸發) 。 **See also** [evaluationResumed](qscriptenginedebugger.html#evaluationResumed)( ) 。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看