diff options
author | Kent Hansen <khansen@trolltech.com> | 2008-12-17 12:17:03 +0100 |
---|---|---|
committer | Kent Hansen <khansen@trolltech.com> | 2008-12-17 12:17:03 +0100 |
commit | b547bca5bc4f33adf7f9b241ad56b3ed573d11a8 (patch) | |
tree | f3eea3597f4e97e8abf59be18b8608ebbbb51826 | |
parent | 15385814bc8d533089ae92136fdd8a24c38a974c (diff) |
Fixes: integrate the qtscript debugger into the script runner
Details: the debugger will pop up if there is an uncaught exception,
or if the debugger keyword is encountered
-rw-r--r-- | qtbindings/qs_eval/main.cpp | 11 | ||||
-rw-r--r-- | qtbindings/qs_eval/qs_eval.pro | 2 |
2 files changed, 12 insertions, 1 deletions
diff --git a/qtbindings/qs_eval/main.cpp b/qtbindings/qs_eval/main.cpp index 6837d9a..47dca65 100644 --- a/qtbindings/qs_eval/main.cpp +++ b/qtbindings/qs_eval/main.cpp @@ -23,7 +23,9 @@ #include <QtScript> - +#if QT_VERSION >= 0x040500 +#include <QtScriptTools> +#endif #include <QtCore/QFile> #include <QtCore/QTextStream> #include <QtCore/QStringList> @@ -136,6 +138,10 @@ int main(int argc, char *argv[]) app->setLibraryPaths(paths); QScriptEngine *eng = new QScriptEngine(); +#if QT_VERSION >= 0x040500 + QScriptEngineDebugger *dbg = new QScriptEngineDebugger(); + dbg->attachTo(eng); +#endif eng->importExtension("qt.core"); eng->importExtension("qt.gui"); @@ -206,6 +212,9 @@ int main(int argc, char *argv[]) } delete eng; +#if QT_VERSION >= 0x040500 + delete dbg; +#endif delete app; return EXIT_SUCCESS; diff --git a/qtbindings/qs_eval/qs_eval.pro b/qtbindings/qs_eval/qs_eval.pro index c0e016a..0d47e6e 100644 --- a/qtbindings/qs_eval/qs_eval.pro +++ b/qtbindings/qs_eval/qs_eval.pro @@ -2,3 +2,5 @@ QT = core gui script win32: CONFIG += console mac:CONFIG -= app_bundle SOURCES += main.cpp +TOO_OLD_LIST=$$find(QT_VERSION, ^4\.[0-4]) +count(TOO_OLD_LIST, 0): QT += scripttools |