From 77fd77d601263662904a376bb89202b9a36fcb51 Mon Sep 17 00:00:00 2001 From: Geir Vattekar Date: Mon, 7 Sep 2009 14:05:12 +0200 Subject: Doc: Some animation examples had no docs in qtdemo. Task-number: 260779 Reviewed-by: Morten Engvoldsen --- demos/qtdemo/xml/examples.xml | 2 +- doc/src/examples/animatedtiles.qdoc | 50 +++++++++++++++++++++++++++++ doc/src/examples/appchooser.qdoc | 52 +++++++++++++++++++++++++++++++ doc/src/examples/easing.qdoc | 51 ++++++++++++++++++++++++++++++ doc/src/examples/states.qdoc | 50 +++++++++++++++++++++++++++++ doc/src/getting-started/examples.qdoc | 4 +++ doc/src/images/animatedtiles-example.png | Bin 0 -> 148019 bytes doc/src/images/appchooser-example.png | Bin 0 -> 29447 bytes doc/src/images/easing-example.png | Bin 0 -> 23843 bytes doc/src/images/states-example.png | Bin 0 -> 34844 bytes 10 files changed, 208 insertions(+), 1 deletion(-) create mode 100644 doc/src/examples/animatedtiles.qdoc create mode 100644 doc/src/examples/appchooser.qdoc create mode 100644 doc/src/examples/easing.qdoc create mode 100644 doc/src/examples/states.qdoc create mode 100644 doc/src/images/animatedtiles-example.png create mode 100644 doc/src/images/appchooser-example.png create mode 100644 doc/src/images/easing-example.png create mode 100644 doc/src/images/states-example.png diff --git a/demos/qtdemo/xml/examples.xml b/demos/qtdemo/xml/examples.xml index 77006c2..b545e1d 100644 --- a/demos/qtdemo/xml/examples.xml +++ b/demos/qtdemo/xml/examples.xml @@ -25,7 +25,7 @@ - + diff --git a/doc/src/examples/animatedtiles.qdoc b/doc/src/examples/animatedtiles.qdoc new file mode 100644 index 0000000..87f1f95 --- /dev/null +++ b/doc/src/examples/animatedtiles.qdoc @@ -0,0 +1,50 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \example animation/animatedtiles + \title Animated Tiles Example + + The Animated Tiles example animates items in a graphics scene. + + \image animatedtiles-example.png +*/ + diff --git a/doc/src/examples/appchooser.qdoc b/doc/src/examples/appchooser.qdoc new file mode 100644 index 0000000..540291e --- /dev/null +++ b/doc/src/examples/appchooser.qdoc @@ -0,0 +1,52 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \example animation/appchooser + \title Application Chooser Example + + The Application Chooser example shows how to use the Qt state + machine and the animation framework to select between + applications. + + \image appchooser-example.png + +*/ diff --git a/doc/src/examples/easing.qdoc b/doc/src/examples/easing.qdoc new file mode 100644 index 0000000..20cccd2 --- /dev/null +++ b/doc/src/examples/easing.qdoc @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \example animation/easing + \title Easing Curves Example + + The Easing Curves example shows how to use easing curves to + control the speed of an animation. + + \image easing-example.png + +*/ diff --git a/doc/src/examples/states.qdoc b/doc/src/examples/states.qdoc new file mode 100644 index 0000000..c17abd0 --- /dev/null +++ b/doc/src/examples/states.qdoc @@ -0,0 +1,50 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \example animation/states + \title States Example + + The States example shows how to use the Qt state machine to play + animations. + + \image states-example.png +*/ diff --git a/doc/src/getting-started/examples.qdoc b/doc/src/getting-started/examples.qdoc index b2a9997..0639bf0 100644 --- a/doc/src/getting-started/examples.qdoc +++ b/doc/src/getting-started/examples.qdoc @@ -1045,7 +1045,11 @@ \image animation-examples.png Animation \list + \o \l{animation/animatedtiles}{Animated Tiles} + \o \l{animation/appchooser}{Application Chooser} + \o \l{animation/easing}{Easing Curves} \o \l{animation/moveblocks}{Move Blocks}\raisedaster + \o \l{animation/states}{States} \o \l{animation/stickman}{Stick man}\raisedaster \endlist */ diff --git a/doc/src/images/animatedtiles-example.png b/doc/src/images/animatedtiles-example.png new file mode 100644 index 0000000..082ac57 Binary files /dev/null and b/doc/src/images/animatedtiles-example.png differ diff --git a/doc/src/images/appchooser-example.png b/doc/src/images/appchooser-example.png new file mode 100644 index 0000000..885476e Binary files /dev/null and b/doc/src/images/appchooser-example.png differ diff --git a/doc/src/images/easing-example.png b/doc/src/images/easing-example.png new file mode 100644 index 0000000..de48667 Binary files /dev/null and b/doc/src/images/easing-example.png differ diff --git a/doc/src/images/states-example.png b/doc/src/images/states-example.png new file mode 100644 index 0000000..f87b99b Binary files /dev/null and b/doc/src/images/states-example.png differ -- cgit v0.12 From c41e03887ca8fb749b6edd12cdb04dbc6590328a Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Mon, 7 Sep 2009 15:22:16 +0300 Subject: Re-added Symbian specific plugins documentation that had gotten lost. Documentation structure changes had caused Symbian plugin documentation to be lost, so revised and re-added it to plugins-howto.qdoc. Reviewed-by: Janne Anttila --- doc/src/frameworks-technologies/plugins-howto.qdoc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/doc/src/frameworks-technologies/plugins-howto.qdoc b/doc/src/frameworks-technologies/plugins-howto.qdoc index 78e5c20..43bc695 100644 --- a/doc/src/frameworks-technologies/plugins-howto.qdoc +++ b/doc/src/frameworks-technologies/plugins-howto.qdoc @@ -226,6 +226,20 @@ located to your applications root folder (i.e., do not include the \c plugins directory). + \note In Symbian all binaries must be located in the directory \\sys\\bin, + so each Qt plugin has a stub with the same basename as the plugin dll + and suffix ".qtplugin" to make Qt extension plugins work similarly to + other platforms. + When trying to locate the plugin, Qt actually looks for the stub + instead of the plugin binary. While plugin stub files have the + suffix ".qtplugin", they can still be loaded also by specifying a filename + with the normal library suffix ".dll" for QPluginLoader, so normally application + developer doesn't need to care about the different suffix of the stub. + Because of the way applications can be installed + on ROM or various other drives in Symbian, Qt looks for the stub from + the same directory on all available drives if it is not located in the given + directory when loading a plugin. + For more information about deployment, see the \l {Deploying Qt Applications} and \l {Deploying Plugins} documentation. -- cgit v0.12 From f868eae7d0cd3297e2512b5651747fda689cc848 Mon Sep 17 00:00:00 2001 From: Kim Motoyoshi Kalland Date: Mon, 7 Sep 2009 14:28:44 +0200 Subject: Fixed crash in print preview dialog with graphicssystem OpenGL. Avoid crashing when framebuffer object created in one context is used in a shared context after the original context is destroyed. Task-number: 260874 Reviewed-by: Samuel --- src/opengl/qglframebufferobject.cpp | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp index 94e3930..c50608c 100644 --- a/src/opengl/qglframebufferobject.cpp +++ b/src/opengl/qglframebufferobject.cpp @@ -63,7 +63,7 @@ QT_BEGIN_NAMESPACE extern QImage qt_gl_read_framebuffer(const QSize&, bool, bool); -#define QGL_FUNC_CONTEXT QGLContext *ctx = d_ptr->ctx; +#define QGL_FUNC_CONTEXT QGLContextGroup *ctx = d_ptr->ctx; #define QT_CHECK_GLERROR() \ { \ @@ -288,7 +288,7 @@ public: QGLFramebufferObjectFormat format; uint valid : 1; QGLFramebufferObject::Attachment fbo_attachment; - QGLContext *ctx; // for Windows extension ptrs + QGLContextGroup *ctx; // for Windows extension ptrs GLuint previous_fbo; mutable QPaintEngine *engine; }; @@ -340,9 +340,10 @@ bool QGLFramebufferObjectPrivate::checkFramebufferStatus() const void QGLFramebufferObjectPrivate::init(const QSize &sz, QGLFramebufferObject::Attachment attachment, GLenum texture_target, GLenum internal_format, GLint samples) { - ctx = const_cast(QGLContext::currentContext()); + QGLContext *currentContext = const_cast(QGLContext::currentContext()); + ctx = QGLContextPrivate::contextGroup(currentContext); bool ext_detected = (QGLExtensions::glExtensions & QGLExtensions::FramebufferObject); - if (!ext_detected || (ext_detected && !qt_resolve_framebufferobject_extensions(ctx))) + if (!ext_detected || (ext_detected && !qt_resolve_framebufferobject_extensions(currentContext))) return; size = sz; @@ -466,7 +467,7 @@ void QGLFramebufferObjectPrivate::init(const QSize &sz, QGLFramebufferObject::At fbo_attachment = QGLFramebufferObject::NoAttachment; } - glBindFramebuffer(GL_FRAMEBUFFER_EXT, ctx->d_ptr->current_fbo); + glBindFramebuffer(GL_FRAMEBUFFER_EXT, currentContext->d_ptr->current_fbo); if (!valid) { if (color_buffer) glDeleteRenderbuffers(1, &color_buffer); @@ -736,16 +737,19 @@ QGLFramebufferObject::~QGLFramebufferObject() delete d->engine; - if (isValid() - && (d->ctx == QGLContext::currentContext() - || qgl_share_reg()->checkSharing(d->ctx, QGLContext::currentContext()))) - { + if (isValid()) { + const QGLContext *oldContext = QGLContext::currentContext(); + bool switchContext = !oldContext || QGLContextPrivate::contextGroup(oldContext) != ctx; + if (switchContext) + const_cast(ctx->context())->makeCurrent(); glDeleteTextures(1, &d->texture); if (d->color_buffer) glDeleteRenderbuffers(1, &d->color_buffer); if (d->depth_stencil_buffer) glDeleteRenderbuffers(1, &d->depth_stencil_buffer); glDeleteFramebuffers(1, &d->fbo); + if (oldContext && switchContext) + const_cast(oldContext)->makeCurrent(); } } @@ -897,7 +901,7 @@ QImage QGLFramebufferObject::toImage() const bool wasBound = isBound(); if (!wasBound) const_cast(this)->bind(); - QImage image = qt_gl_read_framebuffer(d->size, d->ctx->format().alpha(), true); + QImage image = qt_gl_read_framebuffer(d->size, format().textureTarget() != GL_RGB, true); if (!wasBound) const_cast(this)->release(); @@ -969,16 +973,14 @@ bool QGLFramebufferObject::hasOpenGLFramebufferObjects() */ void QGLFramebufferObject::drawTexture(const QRectF &target, GLuint textureId, GLenum textureTarget) { - Q_D(QGLFramebufferObject); - d->ctx->drawTexture(target, textureId, textureTarget); + const_cast(QGLContext::currentContext())->drawTexture(target, textureId, textureTarget); } #ifdef Q_MAC_COMPAT_GL_FUNCTIONS /*! \internal */ void QGLFramebufferObject::drawTexture(const QRectF &target, QMacCompatGLuint textureId, QMacCompatGLenum textureTarget) { - Q_D(QGLFramebufferObject); - d->ctx->drawTexture(target, textureId, textureTarget); + const_cast(QGLContext::currentContext())->drawTexture(target, textureId, textureTarget); } #endif @@ -994,8 +996,7 @@ void QGLFramebufferObject::drawTexture(const QRectF &target, QMacCompatGLuint te */ void QGLFramebufferObject::drawTexture(const QPointF &point, GLuint textureId, GLenum textureTarget) { - Q_D(QGLFramebufferObject); - d->ctx->drawTexture(point, textureId, textureTarget); + const_cast(QGLContext::currentContext())->drawTexture(point, textureId, textureTarget); } #ifdef Q_MAC_COMPAT_GL_FUNCTIONS @@ -1100,7 +1101,7 @@ QGLFramebufferObject::Attachment QGLFramebufferObject::attachment() const bool QGLFramebufferObject::isBound() const { Q_D(const QGLFramebufferObject); - return d->ctx->d_ptr->current_fbo == d->fbo; + return QGLContext::currentContext()->d_ptr->current_fbo == d->fbo; } /*! -- cgit v0.12 From 23e1c7afed25ccb95cc24d2caa692853f35464ec Mon Sep 17 00:00:00 2001 From: David Boddie Date: Mon, 7 Sep 2009 14:53:59 +0200 Subject: Doc: Added a note that a state machine requires a running event loop. Reviewed-by: Trust Me --- .../src_corelib_statemachine_qstatemachine.cpp | 15 ++++++++ src/corelib/statemachine/qstatemachine.cpp | 42 ++++++---------------- 2 files changed, 26 insertions(+), 31 deletions(-) create mode 100644 doc/src/snippets/code/src_corelib_statemachine_qstatemachine.cpp diff --git a/doc/src/snippets/code/src_corelib_statemachine_qstatemachine.cpp b/doc/src/snippets/code/src_corelib_statemachine_qstatemachine.cpp new file mode 100644 index 0000000..128799f --- /dev/null +++ b/doc/src/snippets/code/src_corelib_statemachine_qstatemachine.cpp @@ -0,0 +1,15 @@ +//! [simple state machine] +QPushButton button; + +QStateMachine machine; +QState *s1 = new QState(); +s1->assignProperty(&button, "text", "Click me"); + +QFinalState *s2 = new QFinalState(); +s1->addTransition(&button, SIGNAL(clicked()), s2); + +machine.addState(s1); +machine.addState(s2); +machine.setInitialState(s1); +machine.start(); +//! [simple state machine] diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp index f562fb3..a5cdd45 100644 --- a/src/corelib/statemachine/qstatemachine.cpp +++ b/src/corelib/statemachine/qstatemachine.cpp @@ -78,13 +78,13 @@ QT_BEGIN_NAMESPACE /*! - \class QStateMachine - \reentrant + \class QStateMachine + \reentrant - \brief The QStateMachine class provides a hierarchical finite state machine. + \brief The QStateMachine class provides a hierarchical finite state machine. - \since 4.6 - \ingroup statemachine + \since 4.6 + \ingroup statemachine QStateMachine is based on the concepts and notation of \l{Statecharts: A visual formalism for complex @@ -128,21 +128,7 @@ QT_BEGIN_NAMESPACE The following snippet shows a state machine that will finish when a button is clicked: - \code - QPushButton button; - - QStateMachine machine; - QState *s1 = new QState(); - s1->assignProperty(&button, "text", "Click me"); - - QFinalState *s2 = new QFinalState(); - s1->addTransition(&button, SIGNAL(clicked()), s2); - - machine.addState(s1); - machine.addState(s2); - machine.setInitialState(s1); - machine.start(); - \endcode + \snippet doc/src/snippets/code/src_corelib_statemachine_qstatemachine.cpp simple state machine This code example uses QState, which inherits QAbstractState. The QState class provides a state that you can use to set properties @@ -160,17 +146,7 @@ QT_BEGIN_NAMESPACE no error state applies to the erroneous state, the machine will stop executing and an error message will be printed to the console. - \omit This stuff will be moved elsewhere -This is - typically used in conjunction with \l{Signals and Slots}{signals}; the - signals determine the flow of the state graph, whereas the states' property - assignments and method invocations are the actions. - - The postEvent() function posts an event to the state machine. This is useful - when you are using custom events to trigger transitions. - \endomit - - \sa QAbstractState, QAbstractTransition, QState, {The State Machine Framework} + \sa QAbstractState, QAbstractTransition, QState, {The State Machine Framework} */ /*! @@ -1748,6 +1724,10 @@ bool QStateMachine::isRunning() const transition to the initial state. When a final top-level state (QFinalState) is entered, the machine will emit the finished() signal. + \note A state machine will not run without a running event loop, such as + the main application event loop started with QCoreApplication::exec() or + QApplication::exec(). + \sa started(), finished(), stop(), initialState() */ void QStateMachine::start() -- cgit v0.12 From 63c3aede3998725960fbe17887e966a7acecbc53 Mon Sep 17 00:00:00 2001 From: Jedrzej Nowacki Date: Mon, 7 Sep 2009 11:55:55 +0200 Subject: Fix QScriptEngineAgent::exceptionCatch (JIT enabled) Event exceptionCatch fixed, now exceptionValue is correctly passed as an argument to debugger. Two QEXCEPT_FAIL were removed from autotest. Reviewed-by: Kent Hansen --- src/3rdparty/webkit/JavaScriptCore/jit/JITOpcodes.cpp | 1 + src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp | 4 +++- tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp | 4 ---- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/3rdparty/webkit/JavaScriptCore/jit/JITOpcodes.cpp b/src/3rdparty/webkit/JavaScriptCore/jit/JITOpcodes.cpp index dab6682..dc192f0 100644 --- a/src/3rdparty/webkit/JavaScriptCore/jit/JITOpcodes.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/jit/JITOpcodes.cpp @@ -690,6 +690,7 @@ void JIT::emit_op_catch(Instruction* currentInstruction) emitPutVirtualRegister(currentInstruction[1].u.operand); #ifdef QT_BUILD_SCRIPT_LIB JITStubCall stubCall(this, JITStubs::cti_op_debug_catch); + stubCall.addArgument(Imm32(currentInstruction[1].u.operand)); stubCall.call(); #endif } diff --git a/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp b/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp index 1d39ba4..c84d115 100644 --- a/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp @@ -2747,7 +2747,9 @@ DEFINE_STUB_FUNCTION(void, op_debug_catch) STUB_INIT_STACK_FRAME(stackFrame); CallFrame* callFrame = stackFrame.callFrame; if (JSC::Debugger* debugger = callFrame->lexicalGlobalObject()->debugger() ) { - debugger->exceptionCatch(DebuggerCallFrame(callFrame), callFrame->codeBlock()->ownerNode()->sourceID()); + JSValue exceptionValue = callFrame->r(stackFrame.args[0].int32()).jsValue(); + DebuggerCallFrame debuggerCallFrame(callFrame, exceptionValue); + debugger->exceptionCatch(debuggerCallFrame, callFrame->codeBlock()->ownerNode()->sourceID()); } } diff --git a/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp b/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp index 3d1cbe8..96277b3 100644 --- a/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp +++ b/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp @@ -1619,8 +1619,6 @@ void tst_QScriptEngineAgent::exceptionThrowAndCatch() QCOMPARE(spy->at(1).type, ScriptEngineEvent::ExceptionCatch); QCOMPARE(spy->at(1).scriptId, spy->at(0).scriptId); - if (qt_script_isJITEnabled()) - QEXPECT_FAIL("", "Exception value is not passed in exceptionCatch event when JIT is enabled", Continue); QVERIFY(spy->at(1).value.strictlyEquals(spy->at(0).value)); } } @@ -1764,8 +1762,6 @@ void tst_QScriptEngineAgent::eventOrder_throwAndCatch() QVERIFY(spy->at(7).hasExceptionHandler); // catch QCOMPARE(spy->at(8).type, ScriptEngineEvent::ExceptionCatch); - if (qt_script_isJITEnabled()) - QEXPECT_FAIL("", "Exception value is not passed in exceptionCatch event when JIT is enabled", Continue); QVERIFY(spy->at(8).value.isError()); // void(e) QCOMPARE(spy->at(9).type, ScriptEngineEvent::PositionChange); -- cgit v0.12 From 54fc571caf61b81442449f5586276cf782488cdd Mon Sep 17 00:00:00 2001 From: Jedrzej Nowacki Date: Mon, 7 Sep 2009 14:26:48 +0200 Subject: Fix QScriptEngineAgent::functionExit (JIT enabled) Event functionExit was fixed, now returnValue is correctly passed as an argument to debugger. Few QEXCEPT_FAIL were removed from autotest. Reviewed-by: Kent Hansen --- src/3rdparty/webkit/JavaScriptCore/jit/JITOpcodes.cpp | 1 + src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp | 4 +++- tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp | 16 ---------------- 3 files changed, 4 insertions(+), 17 deletions(-) diff --git a/src/3rdparty/webkit/JavaScriptCore/jit/JITOpcodes.cpp b/src/3rdparty/webkit/JavaScriptCore/jit/JITOpcodes.cpp index dc192f0..da541c5 100644 --- a/src/3rdparty/webkit/JavaScriptCore/jit/JITOpcodes.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/jit/JITOpcodes.cpp @@ -287,6 +287,7 @@ void JIT::emit_op_ret(Instruction* currentInstruction) { #ifdef QT_BUILD_SCRIPT_LIB JITStubCall stubCall(this, JITStubs::cti_op_debug_return); + stubCall.addArgument(Imm32(currentInstruction[1].u.operand)); stubCall.call(); #endif // We could JIT generate the deref, only calling out to C when the refcount hits zero. diff --git a/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp b/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp index c84d115..0a5eb07 100644 --- a/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp @@ -2758,7 +2758,9 @@ DEFINE_STUB_FUNCTION(void, op_debug_return) STUB_INIT_STACK_FRAME(stackFrame); CallFrame* callFrame = stackFrame.callFrame; if (JSC::Debugger* debugger = callFrame->lexicalGlobalObject()->debugger() ) { - debugger->functionExit(JSValue(), callFrame->codeBlock()->ownerNode()->sourceID()); + JSValue returnValue = callFrame->r(stackFrame.args[0].int32()).jsValue(); + intptr_t sourceID = callFrame->codeBlock()->ownerNode()->sourceID(); + debugger->functionExit(returnValue, sourceID); } } diff --git a/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp b/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp index 96277b3..75f7a12 100644 --- a/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp +++ b/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp @@ -589,11 +589,7 @@ void tst_QScriptEngineAgent::functionEntryAndExit_functionCall() // anonymous function exit QCOMPARE(spy->at(2).type, ScriptEngineEvent::FunctionExit); QCOMPARE(spy->at(2).scriptId, spy->at(0).scriptId); - if (qt_script_isJITEnabled()) - QEXPECT_FAIL("", "function return value is not reported when JIT is enabled", Continue); QVERIFY(spy->at(2).value.isNumber()); - if (qt_script_isJITEnabled()) - QEXPECT_FAIL("", "function return value is not reported when JIT is enabled", Continue); QCOMPARE(spy->at(2).value.toNumber(), qsreal(123)); // evaluate() exit @@ -670,11 +666,7 @@ void tst_QScriptEngineAgent::functionEntryAndExit_functionDefinition() // foo() exit QCOMPARE(spy->at(4).type, ScriptEngineEvent::FunctionExit); QCOMPARE(spy->at(4).scriptId, spy->at(0).scriptId); - if (qt_script_isJITEnabled()) - QEXPECT_FAIL("", "function return value is not reported when JIT is enabled", Continue); QVERIFY(spy->at(4).value.isNumber()); - if (qt_script_isJITEnabled()) - QEXPECT_FAIL("", "function return value is not reported when JIT is enabled", Continue); QCOMPARE(spy->at(4).value.toNumber(), qsreal(456)); // evaluate() exit @@ -1059,11 +1051,7 @@ void tst_QScriptEngineAgent::functionEntryAndExit_call() // exit QCOMPARE(spy->at(1).type, ScriptEngineEvent::FunctionExit); QCOMPARE(spy->at(1).scriptId, spy->at(0).scriptId); - if (qt_script_isJITEnabled()) - QEXPECT_FAIL("", "function return value is not reported when JIT is enabled", Continue); QVERIFY(spy->at(1).value.isNumber()); - if (qt_script_isJITEnabled()) - QEXPECT_FAIL("", "function return value is not reported when JIT is enabled", Continue); QCOMPARE(spy->at(1).value.toNumber(), qsreal(123)); } delete spy; @@ -1812,16 +1800,12 @@ void tst_QScriptEngineAgent::eventOrder_functions() // bar() exit QCOMPARE(spy->at(15).type, ScriptEngineEvent::FunctionExit); QCOMPARE(spy->at(15).scriptId, spy->at(3).scriptId); - if (qt_script_isJITEnabled()) - QEXPECT_FAIL("", "function return value is not reported when JIT is enabled", Continue); QVERIFY(spy->at(15).value.isNumber()); // restore context QCOMPARE(spy->at(16).type, ScriptEngineEvent::ContextPop); // foo() exit QCOMPARE(spy->at(17).type, ScriptEngineEvent::FunctionExit); QCOMPARE(spy->at(17).scriptId, spy->at(0).scriptId); - if (qt_script_isJITEnabled()) - QEXPECT_FAIL("", "function return value is not reported when JIT is enabled", Continue); QVERIFY(spy->at(17).value.isNumber()); // restore context QCOMPARE(spy->at(18).type, ScriptEngineEvent::ContextPop); -- cgit v0.12 From bb9b4f4eb76d323ddafa24dc811d0b0b3d2ef4ec Mon Sep 17 00:00:00 2001 From: Geir Vattekar Date: Mon, 7 Sep 2009 15:00:06 +0200 Subject: Doc: Minor adjustments to the rogue example docs. Reviewed-by: Trust Me --- doc/src/examples/rogue.qdoc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/src/examples/rogue.qdoc b/doc/src/examples/rogue.qdoc index 8f97696..1327df6 100644 --- a/doc/src/examples/rogue.qdoc +++ b/doc/src/examples/rogue.qdoc @@ -52,8 +52,8 @@ \c{@} in the screenshot? That's you, the rogue. The \c{#} characters are walls, and the dots represent floor. In a real game, other ASCII characters would represent all kinds of objects - and creatures. For instance, ancient dragons (\c{D}'s) or food - rations (\c{%}'s). But let's not get carried away. In this game, + and creatures, for instance, ancient dragons (\c{D}s) or food + rations (\c{%}s). But let's not get carried away. In this game, the rogue is simply running around in an empty room. The rogue is moved with the keypad (2, 4, 8, 6). That aside, we @@ -61,12 +61,12 @@ types \c {q}. The player is then asked if he/she really wants to quit. - Most games have commands that need more than one key press and - that may require a different sequence of keys based on questions - asked the user. In this game, only the \c quit command falls under - this category, but for the sake of argument, let's imagine a - fully-fledged game with a rich set of commands. If we were to - implement these by catching key events in + Most games have commands that need more than one key press (we + think of consecutive presses, i.e., not of several keys being + pressed at the same time). In this game, only the \c quit command + falls under this category, but for the sake of argument, let's + imagine a fully-fledged game with a rich set of commands. If we + were to implement these by catching key events in \l{QWidget::}{keyPressEvent()}, we would have to keep a lot of class member variables to track the sequence of keys already typed (or find some other way of deducing the current state of a -- cgit v0.12 From d724c91a0ae9ed38fd2dc33bcdd4edbe6aa69085 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Mon, 7 Sep 2009 15:15:34 +0200 Subject: Fix crash on QGraphicsItem destruction related to focus handling Do not call clearFocus() for child item in setParentItemHelper() if called from destructor: At this time, the ~QGraphicsItem destructor already deleted all its children. Reviewed-by: Andreas Aardal Hanssen --- src/gui/graphicsview/qgraphicsitem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index eae3e63..7023e9e 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -934,7 +934,7 @@ void QGraphicsItemPrivate::setParentItemHelper(QGraphicsItem *newParent) } QGraphicsItem *lastSubFocusItem = subFocusItem; - if (subFocusItem) { + if (subFocusItem && !inDestructor) { // Update the child focus chain; when reparenting an item that has a // focus child, ensure that that focus child clears its focus child // chain from our parents before it's reparented. -- cgit v0.12