diff options
Diffstat (limited to 'examples/script')
-rw-r--r-- | examples/script/calculator/calculator.js | 107 | ||||
-rw-r--r-- | examples/script/calculator/calculator.pro | 2 | ||||
-rw-r--r-- | examples/script/calculator/main.cpp | 4 | ||||
-rw-r--r-- | examples/script/context2d/context2d.pro | 9 | ||||
-rw-r--r-- | examples/script/context2d/main.cpp | 3 | ||||
-rw-r--r-- | examples/script/context2d/qcontext2dcanvas.cpp | 5 | ||||
-rw-r--r-- | examples/script/context2d/window.cpp | 27 | ||||
-rw-r--r-- | examples/script/customclass/bytearrayclass.cpp | 11 | ||||
-rw-r--r-- | examples/script/customclass/customclass.pro | 2 | ||||
-rw-r--r-- | examples/script/customclass/main.cpp | 4 | ||||
-rw-r--r-- | examples/script/defaultprototypes/defaultprototypes.pro | 2 | ||||
-rw-r--r-- | examples/script/helloscript/helloscript.pro | 2 | ||||
-rw-r--r-- | examples/script/marshal/marshal.pro | 2 | ||||
-rw-r--r-- | examples/script/qscript/qscript.pro | 2 | ||||
-rw-r--r-- | examples/script/qsdbg/qsdbg.pro | 2 | ||||
-rw-r--r-- | examples/script/qstetrix/main.cpp | 4 | ||||
-rw-r--r-- | examples/script/script.pro | 4 |
17 files changed, 128 insertions, 64 deletions
diff --git a/examples/script/calculator/calculator.js b/examples/script/calculator/calculator.js index 62c2cba..ac3c1b6 100644 --- a/examples/script/calculator/calculator.js +++ b/examples/script/calculator/calculator.js @@ -1,10 +1,19 @@ +Function.prototype.bind = function() { + var func = this; + var thisObject = arguments[0]; + var args = Array.prototype.slice.call(arguments, 1); + return function() { + return func.apply(thisObject, args); + } +} + //! [0] function Calculator(ui) { this.ui = ui; - this.pendingAdditiveOperator = ""; - this.pendingMultiplicativeOperator = ""; + this.pendingAdditiveOperator = Calculator.NO_OPERATOR; + this.pendingMultiplicativeOperator = Calculator.NO_OPERATOR; this.sumInMemory = 0; this.sumSoFar = 0; this.factorSoFar = 0; @@ -13,16 +22,16 @@ function Calculator(ui) with (ui) { display.text = "0"; - zeroButton.clicked.connect(this, this.digitClicked); - oneButton.clicked.connect(this, "digitClicked"); - twoButton.clicked.connect(this, "digitClicked"); - threeButton.clicked.connect(this, "digitClicked"); - fourButton.clicked.connect(this, "digitClicked"); - fiveButton.clicked.connect(this, "digitClicked"); - sixButton.clicked.connect(this, "digitClicked"); - sevenButton.clicked.connect(this, "digitClicked"); - eightButton.clicked.connect(this, "digitClicked"); - nineButton.clicked.connect(this, "digitClicked"); + zeroButton.clicked.connect(this.digitClicked.bind(this, 0)); + oneButton.clicked.connect(this.digitClicked.bind(this, 1)); + twoButton.clicked.connect(this.digitClicked.bind(this, 2)); + threeButton.clicked.connect(this.digitClicked.bind(this, 3)); + fourButton.clicked.connect(this.digitClicked.bind(this, 4)); + fiveButton.clicked.connect(this.digitClicked.bind(this, 5)); + sixButton.clicked.connect(this.digitClicked.bind(this, 6)); + sevenButton.clicked.connect(this.digitClicked.bind(this, 7)); + eightButton.clicked.connect(this.digitClicked.bind(this, 8)); + nineButton.clicked.connect(this.digitClicked.bind(this, 9)); pointButton.clicked.connect(this, "pointClicked"); changeSignButton.clicked.connect(this, "changeSignClicked"); @@ -36,19 +45,28 @@ function Calculator(ui) setMemoryButton.clicked.connect(this, "setMemory"); addToMemoryButton.clicked.connect(this, "addToMemory"); - divisionButton.clicked.connect(this, "multiplicativeOperatorClicked"); - timesButton.clicked.connect(this, "multiplicativeOperatorClicked"); - minusButton.clicked.connect(this, "additiveOperatorClicked"); - plusButton.clicked.connect(this, "additiveOperatorClicked"); - - squareRootButton.clicked.connect(this, "unaryOperatorClicked"); - powerButton.clicked.connect(this, "unaryOperatorClicked"); - reciprocalButton.clicked.connect(this, "unaryOperatorClicked"); + divisionButton.clicked.connect(this.multiplicativeOperatorClicked.bind(this, Calculator.DIVISION_OPERATOR)); + timesButton.clicked.connect(this.multiplicativeOperatorClicked.bind(this, Calculator.TIMES_OPERATOR)); + minusButton.clicked.connect(this.additiveOperatorClicked.bind(this, Calculator.MINUS_OPERATOR)); + plusButton.clicked.connect(this.additiveOperatorClicked.bind(this, Calculator.PLUS_OPERATOR)); + + squareRootButton.clicked.connect(this.unaryOperatorClicked.bind(this, Calculator.SQUARE_OPERATOR)); + powerButton.clicked.connect(this.unaryOperatorClicked.bind(this, Calculator.POWER_OPERATOR)); + reciprocalButton.clicked.connect(this.unaryOperatorClicked.bind(this, Calculator.RECIPROCAL_OPERATOR)); equalButton.clicked.connect(this, "equalClicked"); } } //! [0] +Calculator.NO_OPERATOR = 0; +Calculator.SQUARE_OPERATOR = 1; +Calculator.POWER_OPERATOR = 2; +Calculator.RECIPROCAL_OPERATOR = 3; +Calculator.DIVISION_OPERATOR = 4; +Calculator.TIMES_OPERATOR = 5; +Calculator.MINUS_OPERATOR = 6; +Calculator.PLUS_OPERATOR = 7; + Calculator.prototype.abortOperation = function() { this.clearAll(); @@ -57,24 +75,23 @@ Calculator.prototype.abortOperation = function() Calculator.prototype.calculate = function(rightOperand, pendingOperator) { - if (pendingOperator == "+") { + if (pendingOperator == Calculator.PLUS_OPERATOR) { this.sumSoFar += rightOperand; - } else if (pendingOperator == "-") { + } else if (pendingOperator == Calculator.MINUS_OPERATOR) { this.sumSoFar -= rightOperand; - } else if (pendingOperator == "*") { + } else if (pendingOperator == Calculator.TIMES_OPERATOR) { this.factorSoFar *= rightOperand; - } else if (pendingOperator == "/") { + } else if (pendingOperator == Calculator.DIVISION_OPERATOR) { if (rightOperand == 0) - return false; + return false; this.factorSoFar /= rightOperand; } return true; } //! [1] -Calculator.prototype.digitClicked = function() +Calculator.prototype.digitClicked = function(digitValue) { - var digitValue = __qt_sender__.text - 0; if ((digitValue == 0) && (this.ui.display.text == "0")) return; if (this.waitingForOperand) { @@ -85,19 +102,19 @@ Calculator.prototype.digitClicked = function() } //! [1] -Calculator.prototype.unaryOperatorClicked = function() +Calculator.prototype.unaryOperatorClicked = function(op) { var operand = this.ui.display.text - 0; var result = 0; - if (__qt_sender__.text == "Sqrt") { + if (op == Calculator.SQUARE_OPERATOR) { if (operand < 0) { this.abortOperation(); return; } result = Math.sqrt(operand); - } else if (__qt_sender__.text == "x^2") { + } else if (op == Calculator.POWER_OPERATOR) { result = Math.pow(operand, 2); - } else if (__qt_sender__.text == "1/x") { + } else if (op == Calculator.RECIPROCAL_OPERATOR) { if (operand == 0.0) { this.abortOperation(); return; @@ -108,11 +125,11 @@ Calculator.prototype.unaryOperatorClicked = function() this.waitingForOperand = true; } -Calculator.prototype.additiveOperatorClicked = function() +Calculator.prototype.additiveOperatorClicked = function(op) { var operand = this.ui.display.text - 0; - if (this.pendingMultiplicativeOperator.length != 0) { + if (this.pendingMultiplicativeOperator != Calculator.NO_OPERATOR) { if (!this.calculate(operand, this.pendingMultiplicativeOperator)) { this.abortOperation(); return; @@ -120,10 +137,10 @@ Calculator.prototype.additiveOperatorClicked = function() this.ui.display.text = this.factorSoFar + ""; operand = this.factorSoFar; this.factorSoFar = 0; - this.pendingMultiplicativeOperator = ""; + this.pendingMultiplicativeOperator = Calculator.NO_OPERATOR; } - if (this.pendingAdditiveOperator.length != 0) { + if (this.pendingAdditiveOperator != Calculator.NO_OPERATOR) { if (!this.calculate(operand, this.pendingAdditiveOperator)) { this.abortOperation(); return; @@ -133,15 +150,15 @@ Calculator.prototype.additiveOperatorClicked = function() this.sumSoFar = operand; } - this.pendingAdditiveOperator = __qt_sender__.text; + this.pendingAdditiveOperator = op; this.waitingForOperand = true; } -Calculator.prototype.multiplicativeOperatorClicked = function() +Calculator.prototype.multiplicativeOperatorClicked = function(op) { var operand = this.ui.display.text - 0; - if (this.pendingMultiplicativeOperator.length != 0) { + if (this.pendingMultiplicativeOperator != Calculator.NO_OPERATOR) { if (!this.calculate(operand, this.pendingMultiplicativeOperator)) { this.abortOperation(); return; @@ -151,7 +168,7 @@ Calculator.prototype.multiplicativeOperatorClicked = function() this.factorSoFar = operand; } - this.pendingMultiplicativeOperator = __qt_sender__.text; + this.pendingMultiplicativeOperator = op; this.waitingForOperand = true; } @@ -159,21 +176,21 @@ Calculator.prototype.equalClicked = function() { var operand = this.ui.display.text - 0; - if (this.pendingMultiplicativeOperator.length != 0) { + if (this.pendingMultiplicativeOperator != Calculator.NO_OPERATOR) { if (!this.calculate(operand, this.pendingMultiplicativeOperator)) { this.abortOperation(); return; } operand = this.factorSoFar; this.factorSoFar = 0.0; - this.pendingMultiplicativeOperator = ""; + this.pendingMultiplicativeOperator = Calculator.NO_OPERATOR; } - if (this.pendingAdditiveOperator.length != 0) { + if (this.pendingAdditiveOperator != Calculator.NO_OPERATOR) { if (!this.calculate(operand, this.pendingAdditiveOperator)) { this.abortOperation(); return; } - this.pendingAdditiveOperator = ""; + this.pendingAdditiveOperator = Calculator.NO_OPERATOR; } else { this.sumSoFar = operand; } @@ -234,8 +251,8 @@ Calculator.prototype.clearAll = function() { this.sumSoFar = 0.0; this.factorSoFar = 0.0; - this.pendingAdditiveOperator = ""; - this.pendingMultiplicativeOperator = ""; + this.pendingAdditiveOperator = Calculator.NO_OPERATOR; + this.pendingMultiplicativeOperator = Calculator.NO_OPERATOR; this.ui.display.text = "0"; this.waitingForOperand = true; } diff --git a/examples/script/calculator/calculator.pro b/examples/script/calculator/calculator.pro index 226d5f4..6385d7e 100644 --- a/examples/script/calculator/calculator.pro +++ b/examples/script/calculator/calculator.pro @@ -10,3 +10,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/script/calculator sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro *.js *.ui sources.path = $$[QT_INSTALL_EXAMPLES]/script/calculator INSTALLS += target sources + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) diff --git a/examples/script/calculator/main.cpp b/examples/script/calculator/main.cpp index 2f952bc..97e195e 100644 --- a/examples/script/calculator/main.cpp +++ b/examples/script/calculator/main.cpp @@ -60,7 +60,7 @@ int main(int argc, char **argv) QScriptEngine engine; //! [0a] -#ifndef QT_NO_SCRIPTTOOLS +#if !defined(QT_NO_SCRIPTTOOLS) QScriptEngineDebugger debugger; debugger.attachTo(&engine); QMainWindow *debugWindow = debugger.standardWindow(); @@ -89,7 +89,7 @@ int main(int argc, char **argv) QScriptValue calc = ctor.construct(QScriptValueList() << scriptUi); //! [2] -#ifndef QT_NO_SCRIPTTOOLS +#if !defined(QT_NO_SCRIPTTOOLS) QLineEdit *display = qFindChild<QLineEdit*>(ui, "display"); QObject::connect(display, SIGNAL(returnPressed()), debugWindow, SLOT(show())); diff --git a/examples/script/context2d/context2d.pro b/examples/script/context2d/context2d.pro index 30ec9a7..301c227 100644 --- a/examples/script/context2d/context2d.pro +++ b/examples/script/context2d/context2d.pro @@ -21,3 +21,12 @@ target.path = $$[QT_INSTALL_EXAMPLES]/script/context2d sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS context2d.pro scripts sources.path = $$[QT_INSTALL_EXAMPLES]/script/context2d INSTALLS += target sources + +symbian:{ + include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) + TARGET.UID3 = 0xA000C608 + TARGET.EPOCHEAPSIZE = 0x200000 0xA00000 + contextScripts.path = . + contextScripts.sources = scripts + DEPLOYMENT += contextScripts +} diff --git a/examples/script/context2d/main.cpp b/examples/script/context2d/main.cpp index c9a8898..a61452a 100644 --- a/examples/script/context2d/main.cpp +++ b/examples/script/context2d/main.cpp @@ -48,6 +48,7 @@ int main(int argc, char **argv) QApplication app(argc, argv); Window win; - win.show(); + //win.show(); + win.showFullScreen(); return app.exec(); } diff --git a/examples/script/context2d/qcontext2dcanvas.cpp b/examples/script/context2d/qcontext2dcanvas.cpp index f4f74c4..e1e6a30 100644 --- a/examples/script/context2d/qcontext2dcanvas.cpp +++ b/examples/script/context2d/qcontext2dcanvas.cpp @@ -85,6 +85,11 @@ void QContext2DCanvas::contentsChanged(const QImage &image) void QContext2DCanvas::paintEvent(QPaintEvent *e) { QPainter p(this); +#ifdef Q_WS_S60 +// Draw white rect first since in with some themes the js-file content will produce black-on-black. + QBrush whiteBgBrush(Qt::white); + p.fillRect(e->rect(), whiteBgBrush); +#endif p.setClipRect(e->rect()); p.drawImage(0, 0, m_image); } diff --git a/examples/script/context2d/window.cpp b/examples/script/context2d/window.cpp index f370da9..a6c2203 100644 --- a/examples/script/context2d/window.cpp +++ b/examples/script/context2d/window.cpp @@ -67,6 +67,9 @@ static QString scriptsDir() //! [0] Window::Window(QWidget *parent) : QWidget(parent) +#ifndef QT_NO_SCRIPTTOOLS + , m_debugger(0), m_debugWindow(0) +#endif { m_env = new Environment(this); QObject::connect(m_env, SIGNAL(scriptError(QScriptValue)), @@ -107,14 +110,6 @@ Window::Window(QWidget *parent) this, SLOT(selectScript(QListWidgetItem*))); //! [1] -#ifndef QT_NO_SCRIPTTOOLS - m_debugger = new QScriptEngineDebugger(this); - m_debugger->attachTo(m_env->engine()); - m_debugWindow = m_debugger->standardWindow(); - m_debugWindow->setWindowModality(Qt::ApplicationModal); - m_debugWindow->resize(1280, 704); -#endif - setWindowTitle(tr("Context 2D")); } @@ -156,8 +151,19 @@ void Window::runScript(const QString &fileName, bool debug) m_env->reset(); #ifndef QT_NO_SCRIPTTOOLS - if (debug) + if (debug) { + if (!m_debugger) { + m_debugger = new QScriptEngineDebugger(this); + m_debugWindow = m_debugger->standardWindow(); + m_debugWindow->setWindowModality(Qt::ApplicationModal); + m_debugWindow->resize(1280, 704); + } + m_debugger->attachTo(m_env->engine()); m_debugger->action(QScriptEngineDebugger::InterruptAction)->trigger(); + } else { + if (m_debugger) + m_debugger->detach(); + } #else Q_UNUSED(debug); #endif @@ -165,7 +171,8 @@ void Window::runScript(const QString &fileName, bool debug) QScriptValue ret = m_env->evaluate(contents, fileName); #ifndef QT_NO_SCRIPTTOOLS - m_debugWindow->hide(); + if (m_debugWindow) + m_debugWindow->hide(); #endif if (ret.isError()) diff --git a/examples/script/customclass/bytearrayclass.cpp b/examples/script/customclass/bytearrayclass.cpp index 7400a7c..8dc2033 100644 --- a/examples/script/customclass/bytearrayclass.cpp +++ b/examples/script/customclass/bytearrayclass.cpp @@ -100,7 +100,7 @@ ByteArrayClass::ByteArrayClass(QScriptEngine *engine) QScriptValue global = engine->globalObject(); proto.setPrototype(global.property("Object").property("prototype")); - ctor = engine->newFunction(construct); + ctor = engine->newFunction(construct, proto); ctor.setData(qScriptValueFromValue(engine, this)); } //! [0] @@ -224,7 +224,10 @@ QScriptValue ByteArrayClass::construct(QScriptContext *ctx, QScriptEngine *) ByteArrayClass *cls = qscriptvalue_cast<ByteArrayClass*>(ctx->callee().data()); if (!cls) return QScriptValue(); - int size = ctx->argument(0).toInt32(); + QScriptValue arg = ctx->argument(0); + if (arg.instanceOf(ctx->callee())) + return cls->newInstance(qscriptvalue_cast<QByteArray>(arg)); + int size = arg.toInt32(); return cls->newInstance(size); } //! [2] @@ -240,7 +243,7 @@ QScriptValue ByteArrayClass::toScriptValue(QScriptEngine *eng, const QByteArray void ByteArrayClass::fromScriptValue(const QScriptValue &obj, QByteArray &ba) { - ba = qscriptvalue_cast<QByteArray>(obj.data()); + ba = qvariant_cast<QByteArray>(obj.data().toVariant()); } @@ -294,7 +297,7 @@ void ByteArrayClassPropertyIterator::toBack() QScriptString ByteArrayClassPropertyIterator::name() const { - return QScriptString(); + return object().engine()->toStringHandle(QString::number(m_last)); } uint ByteArrayClassPropertyIterator::id() const diff --git a/examples/script/customclass/customclass.pro b/examples/script/customclass/customclass.pro index ba7f69d..3302d54 100644 --- a/examples/script/customclass/customclass.pro +++ b/examples/script/customclass/customclass.pro @@ -11,3 +11,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/script/customclass sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro *.pri sources.path = $$[QT_INSTALL_EXAMPLES]/script/customclass INSTALLS += target sources + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) diff --git a/examples/script/customclass/main.cpp b/examples/script/customclass/main.cpp index 2ddcfaa..8ccb09a 100644 --- a/examples/script/customclass/main.cpp +++ b/examples/script/customclass/main.cpp @@ -52,6 +52,7 @@ int main(int argc, char **argv) eng.globalObject().setProperty("ByteArray", baClass->constructor()); qDebug() << "ba = new ByteArray(4):" << eng.evaluate("ba = new ByteArray(4)").toString(); + qDebug() << "ba instanceof ByteArray:" << eng.evaluate("ba instanceof ByteArray").toBool(); qDebug() << "ba.length:" << eng.evaluate("ba.length").toNumber(); qDebug() << "ba[1] = 123; ba[1]:" << eng.evaluate("ba[1] = 123; ba[1]").toNumber(); qDebug() << "ba[7] = 224; ba.length:" << eng.evaluate("ba[7] = 224; ba.length").toNumber(); @@ -65,6 +66,9 @@ int main(int argc, char **argv) qDebug() << "ba.toBase64().toLatin1String():" << eng.evaluate("b64.toLatin1String()").toString(); qDebug() << "ba.valueOf():" << eng.evaluate("ba.valueOf()").toString(); qDebug() << "ba.chop(2); ba.length:" << eng.evaluate("ba.chop(2); ba.length").toNumber(); + qDebug() << "ba2 = new ByteArray(ba):" << eng.evaluate("ba2 = new ByteArray(ba)").toString(); + qDebug() << "ba2.equals(ba):" << eng.evaluate("ba2.equals(ba)").toBool(); + qDebug() << "ba2.equals(new ByteArray()):" << eng.evaluate("ba2.equals(new ByteArray())").toBool(); return 0; } diff --git a/examples/script/defaultprototypes/defaultprototypes.pro b/examples/script/defaultprototypes/defaultprototypes.pro index b9a6765..7cf44d2 100644 --- a/examples/script/defaultprototypes/defaultprototypes.pro +++ b/examples/script/defaultprototypes/defaultprototypes.pro @@ -8,3 +8,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/script/defaultprototypes sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.js defaultprototypes.pro sources.path = $$[QT_INSTALL_EXAMPLES]/script/defaultprototypes INSTALLS += target sources + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) diff --git a/examples/script/helloscript/helloscript.pro b/examples/script/helloscript/helloscript.pro index d94a318..850629e 100644 --- a/examples/script/helloscript/helloscript.pro +++ b/examples/script/helloscript/helloscript.pro @@ -7,3 +7,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/script/helloscript sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS helloscript.pro sources.path = $$[QT_INSTALL_EXAMPLES]/script/helloscript INSTALLS += target sources + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) diff --git a/examples/script/marshal/marshal.pro b/examples/script/marshal/marshal.pro index 46b33b9..4a1fc27 100644 --- a/examples/script/marshal/marshal.pro +++ b/examples/script/marshal/marshal.pro @@ -7,3 +7,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/script/marshal sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS marshal.pro sources.path = $$[QT_INSTALL_EXAMPLES]/script/marshal INSTALLS += target sources + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) diff --git a/examples/script/qscript/qscript.pro b/examples/script/qscript/qscript.pro index 759eedf..4f33459 100644 --- a/examples/script/qscript/qscript.pro +++ b/examples/script/qscript/qscript.pro @@ -12,3 +12,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/script/qscript sources.files = $$RESOURCES $$FORMS main.cpp qscript.pro sources.path = $$[QT_INSTALL_EXAMPLES]/script/qscript INSTALLS += target sources + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) diff --git a/examples/script/qsdbg/qsdbg.pro b/examples/script/qsdbg/qsdbg.pro index c199123..77b55a2 100644 --- a/examples/script/qsdbg/qsdbg.pro +++ b/examples/script/qsdbg/qsdbg.pro @@ -16,4 +16,6 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS qsdbg.pro sources.path = $$[QT_INSTALL_EXAMPLES]/script/qsdbg INSTALLS += target sources +include($$QT_SOURCE_TREE/examples/examplebase.pri) + diff --git a/examples/script/qstetrix/main.cpp b/examples/script/qstetrix/main.cpp index c7a9587..87aaae2 100644 --- a/examples/script/qstetrix/main.cpp +++ b/examples/script/qstetrix/main.cpp @@ -96,7 +96,7 @@ int main(int argc, char *argv[]) engine.globalObject().setProperty("Qt", Qt); //! [1] -#ifndef QT_NO_SCRIPTTOOLS +#if !defined(QT_NO_SCRIPTTOOLS) QScriptEngineDebugger debugger; debugger.attachTo(&engine); QMainWindow *debugWindow = debugger.standardWindow(); @@ -122,7 +122,7 @@ int main(int argc, char *argv[]) //! [3] QPushButton *debugButton = qFindChild<QPushButton*>(ui, "debugButton"); -#ifndef QT_NO_SCRIPTTOOLS +#if !defined(QT_NO_SCRIPTTOOLS) QObject::connect(debugButton, SIGNAL(clicked()), debugger.action(QScriptEngineDebugger::InterruptAction), SIGNAL(triggered())); diff --git a/examples/script/script.pro b/examples/script/script.pro index ae3542e..5f3d04a 100644 --- a/examples/script/script.pro +++ b/examples/script/script.pro @@ -4,8 +4,12 @@ SUBDIRS = helloscript context2d defaultprototypes customclass !wince*:SUBDIRS += qscript marshal !wince*:!cross_compile:SUBDIRS += calculator qstetrix +symbian: SUBDIRS = context2d + # install target.path = $$[QT_INSTALL_EXAMPLES]/script sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS script.pro README sources.path = $$[QT_INSTALL_EXAMPLES]/script INSTALLS += target sources + +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) |