From b547bca5bc4f33adf7f9b241ad56b3ed573d11a8 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Wed, 17 Dec 2008 12:17:03 +0100 Subject: 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 --- qtbindings/qs_eval/main.cpp | 11 ++++++++++- qtbindings/qs_eval/qs_eval.pro | 2 ++ 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'qtbindings') 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 - +#if QT_VERSION >= 0x040500 +#include +#endif #include #include #include @@ -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 -- cgit v1.2.3