Changeset 561 for trunk/src/scripttools/debugging/qscriptdebugger.cpp
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/src/scripttools/debugging/qscriptdebugger.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtSCriptTools module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 76 76 #include "qscriptxmlparser_p.h" 77 77 78 #include "qscriptenginedebuggerfrontend_p.h"79 #include "qscriptdebuggerbackend_p.h"80 #include <QtScript/qscriptengine.h>81 82 78 #include "private/qobject_p.h" 83 79 … … 95 91 #include <QtGui/qicon.h> 96 92 #include <QtGui/qinputdialog.h> 93 #include <QtGui/qmenu.h> 94 #include <QtGui/qtoolbar.h> 95 #include <QtGui/qtooltip.h> 97 96 98 97 QT_BEGIN_NAMESPACE … … 138 137 \brief The QScriptDebugger class provides a Qt Script debugger. 139 138 140 \ingroup script tools141 \mainclass 139 \ingroup script 140 142 141 */ 143 142 … … 172 171 const QString &contents, int cursorPosition, int frameIndex, int options); 173 172 174 QString toolTip(int frameIndex, int lineNumber,175 const QStringList &path);173 void showToolTip(const QPoint &pos, int frameIndex, 174 int lineNumber, const QStringList &path); 176 175 177 176 static QPixmap pixmap(const QString &path); … … 634 633 } 635 634 635 class QScriptToolTipJob : public QScriptDebuggerCommandSchedulerJob 636 { 637 public: 638 QScriptToolTipJob(const QPoint &pos, int frameIndex, 639 int lineNumber, const QStringList &path, 640 QScriptDebuggerCommandSchedulerInterface *scheduler) 641 : QScriptDebuggerCommandSchedulerJob(scheduler), m_pos(pos), 642 m_frameIndex(frameIndex), m_lineNumber(lineNumber), m_path(path) 643 {} 644 645 void start() 646 { 647 QScriptDebuggerCommandSchedulerFrontend frontend(commandScheduler(), this); 648 frontend.scheduleGetPropertyExpressionValue(m_frameIndex, m_lineNumber, m_path); 649 } 650 void handleResponse(const QScriptDebuggerResponse &response, int /*commandId*/) 651 { 652 QString tip = response.result().toString(); 653 if (tip.indexOf(QLatin1Char('\n')) != -1) { 654 QStringList lines = tip.split(QLatin1Char('\n')); 655 int lineCount = lines.size(); 656 if (lineCount > 5) { 657 lines = lines.mid(0, 5); 658 lines.append(QString::fromLatin1("(... %0 more lines ...)").arg(lineCount - 5)); 659 } 660 tip = lines.join(QLatin1String("\n")); 661 } 662 QToolTip::showText(m_pos, tip); 663 finish(); 664 } 665 666 private: 667 QPoint m_pos; 668 int m_frameIndex; 669 int m_lineNumber; 670 QStringList m_path; 671 }; 672 636 673 /*! 637 674 \reimp 638 675 */ 639 QString QScriptDebuggerPrivate::toolTip(int frameIndex, int lineNumber,640 const QStringList &path)676 void QScriptDebuggerPrivate::showToolTip(const QPoint &pos, int frameIndex, 677 int lineNumber, const QStringList &path) 641 678 { 642 679 if (frameIndex == -1) { … … 646 683 frameIndex = console->currentFrameIndex(); 647 684 } 648 // ### cheating for now, need to use async API 649 QScriptEngineDebuggerFrontend *edf = static_cast<QScriptEngineDebuggerFrontend*>(frontend); 650 QScriptDebuggerBackend *backend = edf->backend(); 651 QScriptContext *ctx = backend->context(frameIndex); 652 if (!ctx || path.isEmpty()) 653 return QString(); 654 QScriptContextInfo ctxInfo(ctx); 655 if (ctx->callee().isValid() 656 && ((lineNumber < ctxInfo.functionStartLineNumber()) 657 || (lineNumber > ctxInfo.functionEndLineNumber()))) { 658 return QString(); 659 } 660 QScriptValueList objects; 661 int pathIndex = 0; 662 if (path.at(0) == QLatin1String("this")) { 663 objects.append(ctx->thisObject()); 664 ++pathIndex; 665 } else { 666 #if QT_VERSION >= 0x040500 667 objects << ctx->scopeChain(); 668 #else 669 objects.append(ctx->activationObject()); 670 #endif 671 } 672 for (int i = 0; i < objects.size(); ++i) { 673 QScriptValue val = objects.at(i); 674 for (int j = pathIndex; val.isValid() && (j < path.size()); ++j) { 675 val = val.property(path.at(j)); 676 } 677 if (val.isValid()) { 678 bool hadException = (ctx->state() == QScriptContext::ExceptionState); 679 QString str = val.toString(); 680 if (!hadException && backend->engine()->hasUncaughtException()) 681 backend->engine()->clearExceptions(); 682 return str; 683 } 684 } 685 return QString(); 685 QScriptDebuggerJob *job = new QScriptToolTipJob(pos, frameIndex, lineNumber, path, this); 686 scheduleJob(job); 686 687 } 687 688 … … 693 694 { 694 695 return new QScriptCompletionTask( 695 contents, cursorPosition, frameIndex, frontend,696 contents, cursorPosition, frameIndex, this, this, 696 697 (options & QScriptCompletionProviderInterface::ConsoleCommandCompletion) ? console : 0); 697 698 } … … 882 883 return; 883 884 bool ok = false; 884 int lineNumber = QInputDialog::getInteger(0, Q Object::tr("Go to Line"),885 Q Object::tr("Line:"),885 int lineNumber = QInputDialog::getInteger(0, QScriptDebugger::tr("Go to Line"), 886 QScriptDebugger::tr("Line:"), 886 887 view->cursorLineNumber(), 887 888 1, INT_MAX, 1, &ok); … … 992 993 m_debugger->scriptsModel->addScript(scriptId, data); 993 994 994 #if QT_VERSION >= 0x040500995 995 // ### could be slow, might want to do this in a separate thread 996 QString xml = qt_scriptToXml(data.contents(), data.baseLineNumber()); 996 // Q_ASSERT_X(false, Q_FUNC_INFO, "implement me"); 997 QString xml; // = qt_scriptToXml(data.contents(), data.baseLineNumber()); 997 998 QScriptXmlParser::Result extraInfo = QScriptXmlParser::parse(xml); 998 999 m_debugger->scriptsModel->addExtraScriptInfo( 999 1000 scriptId, extraInfo.functionsInfo, extraInfo.executableLineNumbers); 1000 #endif1001 1001 1002 1002 if (++m_index < m_added.size()) … … 1020 1020 SyncBreakpointsJob(QScriptDebuggerPrivate *debugger) 1021 1021 : QScriptDebuggerCommandSchedulerJob(debugger), 1022 m_debugger(debugger) {}1022 m_debugger(debugger), m_index(-1) {} 1023 1023 void start() 1024 1024 { … … 1079 1079 LoadLocalsJob(QScriptDebuggerPrivate *debugger, int frameIndex) 1080 1080 : QScriptDebuggerCommandSchedulerJob(debugger), 1081 m_debugger(debugger), m_frameIndex(frameIndex) , m_state(0){}1081 m_debugger(debugger), m_frameIndex(frameIndex) {} 1082 1082 1083 1083 void start() … … 1111 1111 QScriptDebuggerPrivate *m_debugger; 1112 1112 int m_frameIndex; 1113 int m_state;1114 1113 }; 1115 1114 … … 1338 1337 } 1339 1338 1339 QAction *QScriptDebugger::action(DebuggerAction action, QObject *parent) 1340 { 1341 switch (action) { 1342 case InterruptAction: 1343 return interruptAction(parent); 1344 case ContinueAction: 1345 return continueAction(parent); 1346 case StepIntoAction: 1347 return stepIntoAction(parent); 1348 case StepOverAction: 1349 return stepOverAction(parent); 1350 case StepOutAction: 1351 return stepOutAction(parent); 1352 case RunToCursorAction: 1353 return runToCursorAction(parent); 1354 case RunToNewScriptAction: 1355 return runToNewScriptAction(parent); 1356 case ToggleBreakpointAction: 1357 return toggleBreakpointAction(parent); 1358 case ClearDebugOutputAction: 1359 return clearDebugOutputAction(parent); 1360 case ClearErrorLogAction: 1361 return clearErrorLogAction(parent); 1362 case ClearConsoleAction: 1363 return clearConsoleAction(parent); 1364 case FindInScriptAction: 1365 return findInScriptAction(parent); 1366 case FindNextInScriptAction: 1367 return findNextInScriptAction(parent); 1368 case FindPreviousInScriptAction: 1369 return findPreviousInScriptAction(parent); 1370 case GoToLineAction: 1371 return goToLineAction(parent); 1372 } 1373 return 0; 1374 } 1375 1376 QWidget *QScriptDebugger::widget(DebuggerWidget widget) 1377 { 1378 switch (widget) { 1379 case ConsoleWidget: { 1380 QScriptDebuggerConsoleWidgetInterface *w = consoleWidget(); 1381 if (!w && widgetFactory()) { 1382 w = widgetFactory()->createConsoleWidget(); 1383 setConsoleWidget(w); 1384 } 1385 return w; 1386 } 1387 case StackWidget: { 1388 QScriptDebuggerStackWidgetInterface *w = stackWidget(); 1389 if (!w && widgetFactory()) { 1390 w = widgetFactory()->createStackWidget(); 1391 setStackWidget(w); 1392 } 1393 return w; 1394 } 1395 case ScriptsWidget: { 1396 QScriptDebuggerScriptsWidgetInterface *w = scriptsWidget(); 1397 if (!w && widgetFactory()) { 1398 w = widgetFactory()->createScriptsWidget(); 1399 setScriptsWidget(w); 1400 } 1401 return w; 1402 } 1403 case LocalsWidget: { 1404 QScriptDebuggerLocalsWidgetInterface *w = localsWidget(); 1405 if (!w && widgetFactory()) { 1406 w = widgetFactory()->createLocalsWidget(); 1407 setLocalsWidget(w); 1408 } 1409 return w; 1410 } 1411 case CodeWidget: { 1412 QScriptDebuggerCodeWidgetInterface *w = codeWidget(); 1413 if (!w && widgetFactory()) { 1414 w = widgetFactory()->createCodeWidget(); 1415 setCodeWidget(w); 1416 } 1417 return w; 1418 } 1419 case CodeFinderWidget: { 1420 QScriptDebuggerCodeFinderWidgetInterface *w = codeFinderWidget(); 1421 if (!w && widgetFactory()) { 1422 w = widgetFactory()->createCodeFinderWidget(); 1423 setCodeFinderWidget(w); 1424 } 1425 return w; 1426 } 1427 case BreakpointsWidget: { 1428 QScriptBreakpointsWidgetInterface *w = breakpointsWidget(); 1429 if (!w && widgetFactory()) { 1430 w = widgetFactory()->createBreakpointsWidget(); 1431 setBreakpointsWidget(w); 1432 } 1433 return w; 1434 } 1435 case DebugOutputWidget: { 1436 QScriptDebugOutputWidgetInterface *w = debugOutputWidget(); 1437 if (!w && widgetFactory()) { 1438 w = widgetFactory()->createDebugOutputWidget(); 1439 setDebugOutputWidget(w); 1440 } 1441 return w; 1442 } 1443 case ErrorLogWidget: { 1444 QScriptErrorLogWidgetInterface *w = errorLogWidget(); 1445 if (!w && widgetFactory()) { 1446 w = widgetFactory()->createErrorLogWidget(); 1447 setErrorLogWidget(w); 1448 } 1449 return w; 1450 } 1451 } 1452 return 0; 1453 } 1454 1340 1455 QScriptDebuggerConsoleWidgetInterface *QScriptDebugger::consoleWidget() const 1341 1456 { … … 1560 1675 interruptIcon.addPixmap(d->pixmap(QString::fromLatin1("d_interrupt.png")), QIcon::Disabled); 1561 1676 QScriptDebugger *that = const_cast<QScriptDebugger*>(this); 1562 that->d_func()->interruptAction = new QAction(interruptIcon, Q Object::tr("Interrupt"), parent);1677 that->d_func()->interruptAction = new QAction(interruptIcon, QScriptDebugger::tr("Interrupt"), parent); 1563 1678 d->interruptAction->setEnabled(!d->interactive); 1564 d->interruptAction->setShortcut(Q Object::tr("Shift+F5"));1679 d->interruptAction->setShortcut(QScriptDebugger::tr("Shift+F5")); 1565 1680 QObject::connect(d->interruptAction, SIGNAL(triggered()), 1566 1681 that, SLOT(_q_interrupt())); … … 1577 1692 continueIcon.addPixmap(d->pixmap(QString::fromLatin1("d_play.png")), QIcon::Disabled); 1578 1693 QScriptDebugger *that = const_cast<QScriptDebugger*>(this); 1579 that->d_func()->continueAction = new QAction(continueIcon, Q Object::tr("Continue"), parent);1694 that->d_func()->continueAction = new QAction(continueIcon, QScriptDebugger::tr("Continue"), parent); 1580 1695 d->continueAction->setEnabled(d->interactive); 1581 d->continueAction->setShortcut(Q Object::tr("F5"));1696 d->continueAction->setShortcut(QScriptDebugger::tr("F5")); 1582 1697 QObject::connect(d->continueAction, SIGNAL(triggered()), 1583 1698 that, SLOT(_q_continue())); … … 1594 1709 stepIntoIcon.addPixmap(d->pixmap(QString::fromLatin1("d_stepinto.png")), QIcon::Disabled); 1595 1710 QScriptDebugger *that = const_cast<QScriptDebugger*>(this); 1596 that->d_func()->stepIntoAction = new QAction(stepIntoIcon, Q Object::tr("Step Into"), parent);1711 that->d_func()->stepIntoAction = new QAction(stepIntoIcon, QScriptDebugger::tr("Step Into"), parent); 1597 1712 d->stepIntoAction->setEnabled(d->interactive); 1598 d->stepIntoAction->setShortcut(Q Object::tr("F11"));1713 d->stepIntoAction->setShortcut(QScriptDebugger::tr("F11")); 1599 1714 QObject::connect(d->stepIntoAction, SIGNAL(triggered()), 1600 1715 that, SLOT(_q_stepInto())); … … 1611 1726 stepOverIcon.addPixmap(d->pixmap(QString::fromLatin1("d_stepover.png")), QIcon::Disabled); 1612 1727 QScriptDebugger *that = const_cast<QScriptDebugger*>(this); 1613 that->d_func()->stepOverAction = new QAction(stepOverIcon, Q Object::tr("Step Over"), parent);1728 that->d_func()->stepOverAction = new QAction(stepOverIcon, QScriptDebugger::tr("Step Over"), parent); 1614 1729 d->stepOverAction->setEnabled(d->interactive); 1615 d->stepOverAction->setShortcut(Q Object::tr("F10"));1730 d->stepOverAction->setShortcut(QScriptDebugger::tr("F10")); 1616 1731 QObject::connect(d->stepOverAction, SIGNAL(triggered()), 1617 1732 that, SLOT(_q_stepOver())); … … 1628 1743 stepOutIcon.addPixmap(d->pixmap(QString::fromLatin1("d_stepout.png")), QIcon::Disabled); 1629 1744 QScriptDebugger *that = const_cast<QScriptDebugger*>(this); 1630 that->d_func()->stepOutAction = new QAction(stepOutIcon, Q Object::tr("Step Out"), parent);1745 that->d_func()->stepOutAction = new QAction(stepOutIcon, QScriptDebugger::tr("Step Out"), parent); 1631 1746 d->stepOutAction->setEnabled(d->interactive); 1632 d->stepOutAction->setShortcut(Q Object::tr("Shift+F11"));1747 d->stepOutAction->setShortcut(QScriptDebugger::tr("Shift+F11")); 1633 1748 QObject::connect(d->stepOutAction, SIGNAL(triggered()), 1634 1749 that, SLOT(_q_stepOut())); … … 1645 1760 runToCursorIcon.addPixmap(d->pixmap(QString::fromLatin1("d_runtocursor.png")), QIcon::Disabled); 1646 1761 QScriptDebugger *that = const_cast<QScriptDebugger*>(this); 1647 that->d_func()->runToCursorAction = new QAction(runToCursorIcon, Q Object::tr("Run to Cursor"), parent);1762 that->d_func()->runToCursorAction = new QAction(runToCursorIcon, QScriptDebugger::tr("Run to Cursor"), parent); 1648 1763 d->runToCursorAction->setEnabled(d->interactive); 1649 d->runToCursorAction->setShortcut(Q Object::tr("Ctrl+F10"));1764 d->runToCursorAction->setShortcut(QScriptDebugger::tr("Ctrl+F10")); 1650 1765 QObject::connect(d->runToCursorAction, SIGNAL(triggered()), 1651 1766 that, SLOT(_q_runToCursor())); … … 1663 1778 QScriptDebugger *that = const_cast<QScriptDebugger*>(this); 1664 1779 that->d_func()->runToNewScriptAction = new QAction(runToNewScriptIcon, 1665 Q Object::tr("Run to New Script"), parent);1780 QScriptDebugger::tr("Run to New Script"), parent); 1666 1781 d->runToNewScriptAction->setEnabled(d->interactive); 1667 1782 QObject::connect(d->runToNewScriptAction, SIGNAL(triggered()), … … 1678 1793 QScriptDebugger *that = const_cast<QScriptDebugger*>(this); 1679 1794 that->d_func()->toggleBreakpointAction = new QAction(toggleBreakpointIcon, 1680 Q Object::tr("Toggle Breakpoint"), parent);1681 d->toggleBreakpointAction->setShortcut(Q Object::tr("F9"));1795 QScriptDebugger::tr("Toggle Breakpoint"), parent); 1796 d->toggleBreakpointAction->setShortcut(QScriptDebugger::tr("F9")); 1682 1797 d->toggleBreakpointAction->setEnabled((d->codeWidget != 0) && (d->codeWidget->currentView() != 0)); 1683 1798 QObject::connect(d->toggleBreakpointAction, SIGNAL(triggered()), … … 1693 1808 QIcon clearDebugOutputIcon; 1694 1809 QScriptDebugger *that = const_cast<QScriptDebugger*>(this); 1695 that->d_func()->clearDebugOutputAction = new QAction(clearDebugOutputIcon, Q Object::tr("Clear Debug Output"), parent);1810 that->d_func()->clearDebugOutputAction = new QAction(clearDebugOutputIcon, QScriptDebugger::tr("Clear Debug Output"), parent); 1696 1811 QObject::connect(d->clearDebugOutputAction, SIGNAL(triggered()), 1697 1812 that, SLOT(_q_clearDebugOutput())); … … 1706 1821 QIcon clearErrorLogIcon; 1707 1822 QScriptDebugger *that = const_cast<QScriptDebugger*>(this); 1708 that->d_func()->clearErrorLogAction = new QAction(clearErrorLogIcon, Q Object::tr("Clear Error Log"), parent);1823 that->d_func()->clearErrorLogAction = new QAction(clearErrorLogIcon, QScriptDebugger::tr("Clear Error Log"), parent); 1709 1824 QObject::connect(d->clearErrorLogAction, SIGNAL(triggered()), 1710 1825 that, SLOT(_q_clearErrorLog())); … … 1719 1834 QIcon clearConsoleIcon; 1720 1835 QScriptDebugger *that = const_cast<QScriptDebugger*>(this); 1721 that->d_func()->clearConsoleAction = new QAction(clearConsoleIcon, Q Object::tr("Clear Console"), parent);1836 that->d_func()->clearConsoleAction = new QAction(clearConsoleIcon, QScriptDebugger::tr("Clear Console"), parent); 1722 1837 QObject::connect(d->clearConsoleAction, SIGNAL(triggered()), 1723 1838 that, SLOT(_q_clearConsole())); … … 1733 1848 findInScriptIcon.addPixmap(d->pixmap(QString::fromLatin1("find.png")), QIcon::Normal); 1734 1849 QScriptDebugger *that = const_cast<QScriptDebugger*>(this); 1735 that->d_func()->findInScriptAction = new QAction(findInScriptIcon, Q Object::tr("&Find in Script..."), parent);1736 d->findInScriptAction->setShortcut(Q Object::tr("Ctrl+F"));1850 that->d_func()->findInScriptAction = new QAction(findInScriptIcon, QScriptDebugger::tr("&Find in Script..."), parent); 1851 d->findInScriptAction->setShortcut(QScriptDebugger::tr("Ctrl+F")); 1737 1852 d->findInScriptAction->setEnabled( 1738 1853 (d->codeFinderWidget != 0) … … 1751 1866 QIcon findNextInScriptIcon; 1752 1867 QScriptDebugger *that = const_cast<QScriptDebugger*>(this); 1753 that->d_func()->findNextInScriptAction = new QAction(findNextInScriptIcon, Q Object::tr("Find &Next"), parent);1868 that->d_func()->findNextInScriptAction = new QAction(findNextInScriptIcon, QScriptDebugger::tr("Find &Next"), parent); 1754 1869 d->findNextInScriptAction->setEnabled(d->codeFinderWidget && !d->codeFinderWidget->text().isEmpty()); 1755 d->findNextInScriptAction->setShortcut(Q Object::tr("F3"));1870 d->findNextInScriptAction->setShortcut(QScriptDebugger::tr("F3")); 1756 1871 QObject::connect(d->findNextInScriptAction, SIGNAL(triggered()), 1757 1872 that, SLOT(_q_findNextInScript())); … … 1766 1881 QIcon findPreviousInScriptIcon; 1767 1882 QScriptDebugger *that = const_cast<QScriptDebugger*>(this); 1768 that->d_func()->findPreviousInScriptAction = new QAction(findPreviousInScriptIcon, Q Object::tr("Find &Previous"), parent);1883 that->d_func()->findPreviousInScriptAction = new QAction(findPreviousInScriptIcon, QScriptDebugger::tr("Find &Previous"), parent); 1769 1884 d->findPreviousInScriptAction->setEnabled(d->codeFinderWidget && !d->codeFinderWidget->text().isEmpty()); 1770 d->findPreviousInScriptAction->setShortcut(Q Object::tr("Shift+F3"));1885 d->findPreviousInScriptAction->setShortcut(QScriptDebugger::tr("Shift+F3")); 1771 1886 QObject::connect(d->findPreviousInScriptAction, SIGNAL(triggered()), 1772 1887 that, SLOT(_q_findPreviousInScript())); … … 1781 1896 QIcon goToLineIcon; 1782 1897 QScriptDebugger *that = const_cast<QScriptDebugger*>(this); 1783 that->d_func()->goToLineAction = new QAction(goToLineIcon, Q Object::tr("Go to Line"), parent);1784 d->goToLineAction->setShortcut(Q Object::tr("Ctrl+G"));1898 that->d_func()->goToLineAction = new QAction(goToLineIcon, QScriptDebugger::tr("Go to Line"), parent); 1899 d->goToLineAction->setShortcut(QScriptDebugger::tr("Ctrl+G")); 1785 1900 d->goToLineAction->setEnabled((d->codeWidget != 0) && (d->codeWidget->currentView() != 0)); 1786 1901 QObject::connect(d->goToLineAction, SIGNAL(triggered()), … … 1788 1903 } 1789 1904 return d->goToLineAction; 1905 } 1906 1907 QMenu *QScriptDebugger::createStandardMenu(QWidget *widgetParent, QObject *actionParent) 1908 { 1909 QMenu *menu = new QMenu(widgetParent); 1910 menu->setTitle(QScriptDebugger::tr("Debug")); 1911 menu->addAction(action(ContinueAction, actionParent)); 1912 menu->addAction(action(InterruptAction, actionParent)); 1913 menu->addAction(action(StepIntoAction, actionParent)); 1914 menu->addAction(action(StepOverAction, actionParent)); 1915 menu->addAction(action(StepOutAction, actionParent)); 1916 menu->addAction(action(RunToCursorAction, actionParent)); 1917 menu->addAction(action(RunToNewScriptAction, actionParent)); 1918 1919 menu->addSeparator(); 1920 menu->addAction(action(ToggleBreakpointAction, actionParent)); 1921 1922 menu->addSeparator(); 1923 menu->addAction(action(ClearDebugOutputAction, actionParent)); 1924 menu->addAction(action(ClearErrorLogAction, actionParent)); 1925 menu->addAction(action(ClearConsoleAction, actionParent)); 1926 1927 return menu; 1928 } 1929 1930 #ifndef QT_NO_TOOLBAR 1931 QToolBar *QScriptDebugger::createStandardToolBar(QWidget *widgetParent, QObject *actionParent) 1932 { 1933 QToolBar *tb = new QToolBar(widgetParent); 1934 tb->setObjectName(QLatin1String("qtscriptdebugger_standardToolBar")); 1935 tb->addAction(action(ContinueAction, actionParent)); 1936 tb->addAction(action(InterruptAction, actionParent)); 1937 tb->addAction(action(StepIntoAction, actionParent)); 1938 tb->addAction(action(StepOverAction, actionParent)); 1939 tb->addAction(action(StepOutAction, actionParent)); 1940 tb->addAction(action(RunToCursorAction, actionParent)); 1941 tb->addAction(action(RunToNewScriptAction, actionParent)); 1942 tb->addSeparator(); 1943 tb->addAction(action(FindInScriptAction, actionParent)); 1944 return tb; 1945 } 1946 #endif 1947 1948 bool QScriptDebugger::isInteractive() const 1949 { 1950 Q_D(const QScriptDebugger); 1951 return d->interactive; 1790 1952 } 1791 1953
Note:
See TracChangeset
for help on using the changeset viewer.