From 7d5afd371d634e35192ab27f65c6dc895f7bbb5c Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Thu, 30 Sep 2010 11:00:33 +0200 Subject: Update changes --- dist/changes-4.7.1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dist/changes-4.7.1 b/dist/changes-4.7.1 index 9a3e543..2c25699 100644 --- a/dist/changes-4.7.1 +++ b/dist/changes-4.7.1 @@ -90,6 +90,8 @@ QtGui - QTreeView * [QTBUG-13567] Do not scroll to top if last item is removed + - QGtkStyle + * [QTBUG-13125] Fixed a regression with custom itemview background color. QtDBus ------ -- cgit v0.12 From 9e9a7bc29319d52c3e563bc2c5282cb7e6890eba Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Wed, 29 Sep 2010 14:02:10 +0200 Subject: Fixes cursor shape when widget becomes native on X11. When a native window handle is created for a widget that has override cursor set, we should reset the cursor on the parent and set the cursor on the new window handle. Task-number: QTBUG-6185 Reviewed-by: Olivier Goffart --- src/gui/kernel/qwidget_x11.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qwidget_x11.cpp b/src/gui/kernel/qwidget_x11.cpp index e01489f..8d80e10 100644 --- a/src/gui/kernel/qwidget_x11.cpp +++ b/src/gui/kernel/qwidget_x11.cpp @@ -889,8 +889,10 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO q->setWindowOpacity(maybeTopData()->opacity/255.); } - } else if (q->testAttribute(Qt::WA_SetCursor) && q->internalWinId()) { + } else if (q->internalWinId()) { qt_x11_enforce_cursor(q); + if (QWidget *p = q->parentWidget()) // reset the cursor on the native parent + qt_x11_enforce_cursor(p); } if (extra && !extra->mask.isEmpty() && q->internalWinId()) -- cgit v0.12 From fc50d7ecaacfbfef1dbefd6ffdc083cb66c5633c Mon Sep 17 00:00:00 2001 From: Prasanth Ullattil Date: Thu, 30 Sep 2010 13:45:00 +0200 Subject: QAxBase::dynamicCall() returns invalid QVariant Starting from 4.7.0, QVariant is recognized as a standard type by the meta type system. ActiveQt needs to consider this while converting COM VARIANT types to a QVariant. Task-number: QTBUG-13845 Reviewed-by: Volker Hilsheimer Reviewed-by: Olivier Goffart --- src/activeqt/shared/qaxtypes.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/activeqt/shared/qaxtypes.cpp b/src/activeqt/shared/qaxtypes.cpp index 957733e..ff21a9f 100644 --- a/src/activeqt/shared/qaxtypes.cpp +++ b/src/activeqt/shared/qaxtypes.cpp @@ -1376,8 +1376,10 @@ QVariant VARIANTToQVariant(const VARIANT &arg, const QByteArray &typeName, uint } QVariant::Type proptype = (QVariant::Type)type; - if (proptype == QVariant::Invalid && !typeName.isEmpty()) - proptype = QVariant::nameToType(typeName); + if (proptype == QVariant::Invalid && !typeName.isEmpty()) { + if (typeName != "QVariant") + proptype = QVariant::nameToType(typeName); + } if (proptype != QVariant::LastType && proptype != QVariant::Invalid && var.type() != proptype) { if (var.canConvert(proptype)) { QVariant oldvar = var; -- cgit v0.12 From eb407209bb9f2c06684fd1299169cd3b8ab4b58d Mon Sep 17 00:00:00 2001 From: Jedrzej Nowacki Date: Thu, 30 Sep 2010 13:17:39 +0200 Subject: Fix QScriptEngine::abortEvaluation. This patch reduce time in which QScriptEngine would abort an script executing multiple long-running native functions. Task-number: QTBUG-9433 Reviewed-by: Olivier Goffart --- src/script/api/qscriptengine.cpp | 7 ++- tests/auto/qscriptengine/tst_qscriptengine.cpp | 60 ++++++++++++++++++++++++-- 2 files changed, 62 insertions(+), 5 deletions(-) diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp index 07aced4..128e9c3 100644 --- a/src/script/api/qscriptengine.cpp +++ b/src/script/api/qscriptengine.cpp @@ -46,6 +46,7 @@ #include "Error.h" #include "Interpreter.h" +#include "ExceptionHelpers.h" #include "PrototypeFunction.h" #include "InitializeThreading.h" #include "ObjectPrototype.h" @@ -4116,9 +4117,11 @@ bool QScriptEngine::isEvaluating() const void QScriptEngine::abortEvaluation(const QScriptValue &result) { Q_D(QScriptEngine); - - d->timeoutChecker()->setShouldAbort(true); + if (!isEvaluating()) + return; d->abortResult = result; + d->timeoutChecker()->setShouldAbort(true); + JSC::throwError(d->currentFrame, JSC::createInterruptedExecutionException(&d->currentFrame->globalData()).toObject(d->currentFrame)); } #ifndef QT_NO_QOBJECT diff --git a/tests/auto/qscriptengine/tst_qscriptengine.cpp b/tests/auto/qscriptengine/tst_qscriptengine.cpp index f96aea6..26eb1af 100644 --- a/tests/auto/qscriptengine/tst_qscriptengine.cpp +++ b/tests/auto/qscriptengine/tst_qscriptengine.cpp @@ -134,6 +134,7 @@ private slots: void numberParsing(); void automaticSemicolonInsertion(); void abortEvaluation(); + void abortEvaluation_QTBUG9433(); void isEvaluating(); void printFunctionWithCustomHandler(); void printThrowsException(); @@ -3007,7 +3008,8 @@ public: enum AbortionResult { None = 0, String = 1, - Error = 2 + Error = 2, + Number = 3 }; EventReceiver3(QScriptEngine *eng) { @@ -3027,6 +3029,8 @@ public: case Error: engine->abortEvaluation(engine->currentContext()->throwError("AbortedWithError")); break; + case Number: + engine->abortEvaluation(QScriptValue(1234)); } } return QObject::event(e); @@ -3059,7 +3063,7 @@ void tst_QScriptEngine::abortEvaluation() EventReceiver3 receiver(&eng); eng.setProcessEventsInterval(100); - for (int x = 0; x < 3; ++x) { + for (int x = 0; x < 4; ++x) { QCoreApplication::postEvent(&receiver, new QEvent(QEvent::Type(QEvent::User+1))); receiver.resultType = EventReceiver3::AbortionResult(x); QScriptValue ret = eng.evaluate(QString::fromLatin1("while (1) { }")); @@ -3068,6 +3072,11 @@ void tst_QScriptEngine::abortEvaluation() QVERIFY(!eng.hasUncaughtException()); QVERIFY(!ret.isValid()); break; + case EventReceiver3::Number: + QVERIFY(!eng.hasUncaughtException()); + QVERIFY(ret.isNumber()); + QCOMPARE(ret.toInt32(), 1234); + break; case EventReceiver3::String: QVERIFY(!eng.hasUncaughtException()); QVERIFY(ret.isString()); @@ -3082,7 +3091,7 @@ void tst_QScriptEngine::abortEvaluation() } // scripts cannot intercept the abortion with try/catch - for (int y = 0; y < 3; ++y) { + for (int y = 0; y < 4; ++y) { QCoreApplication::postEvent(&receiver, new QEvent(QEvent::Type(QEvent::User+1))); receiver.resultType = EventReceiver3::AbortionResult(y); QScriptValue ret = eng.evaluate(QString::fromLatin1( @@ -3098,6 +3107,11 @@ void tst_QScriptEngine::abortEvaluation() QVERIFY(!eng.hasUncaughtException()); QVERIFY(!ret.isValid()); break; + case EventReceiver3::Number: + QVERIFY(!eng.hasUncaughtException()); + QVERIFY(ret.isNumber()); + QCOMPARE(ret.toInt32(), 1234); + break; case EventReceiver3::String: QVERIFY(!eng.hasUncaughtException()); QVERIFY(ret.isString()); @@ -3118,6 +3132,46 @@ void tst_QScriptEngine::abortEvaluation() } } +class ThreadedEngine : public QThread { + Q_OBJECT; + +private: + QScriptEngine* m_engine; +protected: + void run() { + m_engine = new QScriptEngine(); + m_engine->setGlobalObject(m_engine->newQObject(this)); + m_engine->evaluate("while(1) { sleep(); }"); + delete m_engine; + } + +public slots: + void sleep() + { + QTest::qSleep(25); + m_engine->abortEvaluation(); + } +}; + +void tst_QScriptEngine::abortEvaluation_QTBUG9433() +{ + ThreadedEngine engine; + engine.start(); + QVERIFY(engine.isRunning()); + QTest::qSleep(50); + for (uint i = 0; i < 50; ++i) { // up to ~2500 ms + if (engine.isFinished()) + return; + QTest::qSleep(50); + } + if (!engine.isFinished()) { + engine.terminate(); + engine.wait(7000); + QFAIL("abortEvaluation doesn't work"); + } + +} + static QScriptValue myFunctionReturningIsEvaluating(QScriptContext *, QScriptEngine *eng) { return QScriptValue(eng, eng->isEvaluating()); -- cgit v0.12 From 72fd8399aa36395e41f497fff79842496d6f9b03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Nilsen?= Date: Thu, 30 Sep 2010 16:46:26 +0200 Subject: Some 4.7.1 changes. --- dist/changes-4.7.1 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dist/changes-4.7.1 b/dist/changes-4.7.1 index 2c25699..2d79ac1 100644 --- a/dist/changes-4.7.1 +++ b/dist/changes-4.7.1 @@ -62,6 +62,16 @@ QtGui - QGraphicsWidget * [QTBUG-13188] Make sure a font that has propagated from a parent can be set on a QPainter. + * [QT-3808] Issues when applying effects in combination with ItemHasNoContents flag. + + - QGraphicsItem + * [QTBUG-3633, QT-3828] Wrong children bounding rect when applying effects. + + - QGraphicsEffect + * [QT-3633] Wrong bounding rect. + + - QGraphicsScene + * [QT-3674] Spurious assert triggered from render(). - QPainter * [QTBUG-13429] Fixed scale point drawing with square cap in the raster -- cgit v0.12