From ee735a39a333ddff4d5d0734062093ba553850f2 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Wed, 3 Jun 2009 11:23:33 +0200 Subject: use of QMutexPool to reduce the number of Q_GLOBAL_STATIC in the animation framework --- src/corelib/animation/qpropertyanimation.cpp | 47 +++++++++++++++------------- src/corelib/animation/qvariantanimation.cpp | 29 ++++++++--------- 2 files changed, 40 insertions(+), 36 deletions(-) diff --git a/src/corelib/animation/qpropertyanimation.cpp b/src/corelib/animation/qpropertyanimation.cpp index 43b5283..357a6ac 100644 --- a/src/corelib/animation/qpropertyanimation.cpp +++ b/src/corelib/animation/qpropertyanimation.cpp @@ -91,19 +91,17 @@ #include "qpropertyanimation.h" #include "qanimationgroup.h" -#include - #include "qpropertyanimation_p.h" #include #include +#include QT_BEGIN_NAMESPACE typedef QPair QPropertyAnimationPair; typedef QHash QPropertyAnimationHash; Q_GLOBAL_STATIC(QPropertyAnimationHash, _q_runningAnimations) -Q_GLOBAL_STATIC_WITH_ARGS(QMutex, guardHashLock, (QMutex::Recursive) ) void QPropertyAnimationPrivate::updateMetaProperty() { @@ -284,27 +282,32 @@ void QPropertyAnimation::updateState(QAbstractAnimation::State oldState, } QVariantAnimation::updateState(oldState, newState); - QMutexLocker locker(guardHashLock()); - QPropertyAnimationHash * hash = _q_runningAnimations(); - QPropertyAnimationPair key(d->target, d->propertyName); - if (newState == Running) { - d->updateMetaProperty(); - QPropertyAnimation *oldAnim = hash->value(key, 0); - if (oldAnim) { - // try to stop the top level group - QAbstractAnimation *current = oldAnim; - while (current->group() && current->state() != Stopped) - current = current->group(); - current->stop(); - } - hash->insert(key, this); - // update the default start value - if (oldState == Stopped) { - d->setDefaultStartValue(d->target->property(d->propertyName.constData())); + QPropertyAnimation *animToStop = 0; + { + QPropertyAnimationHash * hash = _q_runningAnimations(); + QMutexLocker locker(QMutexPool::globalInstanceGet(hash)); + QPropertyAnimationPair key(d->target, d->propertyName); + if (newState == Running) { + d->updateMetaProperty(); + animToStop = hash->value(key, 0); + hash->insert(key, this); + // update the default start value + if (oldState == Stopped) { + d->setDefaultStartValue(d->target->property(d->propertyName.constData())); + } + } else if (hash->value(key) == this) { + hash->remove(key); } - } else if (hash->value(key) == this) { - hash->remove(key); + } + + //we need to do that after the mutex was unlocked + if (animToStop) { + // try to stop the top level group + QAbstractAnimation *current = animToStop; + while (current->group() && current->state() != Stopped) + current = current->group(); + current->stop(); } } diff --git a/src/corelib/animation/qvariantanimation.cpp b/src/corelib/animation/qvariantanimation.cpp index e973ec5..a3fa93a 100644 --- a/src/corelib/animation/qvariantanimation.cpp +++ b/src/corelib/animation/qvariantanimation.cpp @@ -44,11 +44,10 @@ #include "qvariantanimation.h" #include "qvariantanimation_p.h" -#include -#include -#include -#include -#include +#include +#include +#include +#include QT_BEGIN_NAMESPACE @@ -365,8 +364,8 @@ void QVariantAnimation::setEasingCurve(const QEasingCurve &easing) d->recalculateCurrentInterval(); } -Q_GLOBAL_STATIC(QVector, registeredInterpolators) -Q_GLOBAL_STATIC(QReadWriteLock, registeredInterpolatorsLock) +typedef QVector QInterpolatorVector; +Q_GLOBAL_STATIC(QInterpolatorVector, registeredInterpolators) /*! \fn void qRegisterAnimationInterpolator(QVariant (*func)(const T &from, const T &to, qreal progress)) @@ -398,10 +397,11 @@ Q_GLOBAL_STATIC(QReadWriteLock, registeredInterpolatorsLock) void QVariantAnimation::registerInterpolator(QVariantAnimation::Interpolator func, int interpolationType) { // will override any existing interpolators - QWriteLocker locker(registeredInterpolatorsLock()); - if (int(interpolationType) >= registeredInterpolators()->count()) - registeredInterpolators()->resize(int(interpolationType) + 1); - registeredInterpolators()->replace(interpolationType, func); + QInterpolatorVector *interpolators = registeredInterpolators(); + QMutexLocker locker(QMutexPool::globalInstanceGet(interpolators)); + if (int(interpolationType) >= interpolators->count()) + interpolators->resize(int(interpolationType) + 1); + interpolators->replace(interpolationType, func); } @@ -412,10 +412,11 @@ template static inline QVariantAnimation::Interpolator castToInterpo QVariantAnimation::Interpolator QVariantAnimationPrivate::getInterpolator(int interpolationType) { - QReadLocker locker(registeredInterpolatorsLock()); + QInterpolatorVector *interpolators = registeredInterpolators(); + QMutexLocker locker(QMutexPool::globalInstanceGet(interpolators)); QVariantAnimation::Interpolator ret = 0; - if (interpolationType < registeredInterpolators()->count()) { - ret = registeredInterpolators()->at(interpolationType); + if (interpolationType < interpolators->count()) { + ret = interpolators->at(interpolationType); if (ret) return ret; } -- cgit v0.12 From a3c0fd23dcac2389e20cf0731166c18374d481ec Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Wed, 3 Jun 2009 11:38:45 +0200 Subject: fix typos Copy&paste error; the classes are in Gui, not Core. --- src/gui/statemachine/qkeyeventtransition.h | 2 +- src/gui/statemachine/qmouseeventtransition.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/statemachine/qkeyeventtransition.h b/src/gui/statemachine/qkeyeventtransition.h index 3c8295f..d9c7760 100644 --- a/src/gui/statemachine/qkeyeventtransition.h +++ b/src/gui/statemachine/qkeyeventtransition.h @@ -48,7 +48,7 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -QT_MODULE(Core) +QT_MODULE(Gui) class QKeyEventTransitionPrivate; class Q_GUI_EXPORT QKeyEventTransition : public QEventTransition diff --git a/src/gui/statemachine/qmouseeventtransition.h b/src/gui/statemachine/qmouseeventtransition.h index 3f5f3ac..9c7af5b 100644 --- a/src/gui/statemachine/qmouseeventtransition.h +++ b/src/gui/statemachine/qmouseeventtransition.h @@ -48,7 +48,7 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -QT_MODULE(Core) +QT_MODULE(Gui) class QMouseEventTransitionPrivate; class QPainterPath; -- cgit v0.12 From f9aa7cbaea69168a4e7b9411cfdceb9e27cf75a9 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Wed, 3 Jun 2009 11:44:28 +0200 Subject: fix qdoc warning No need to link to the class in its own doc page. --- src/corelib/statemachine/qstatemachine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp index 84619d7..be816a6 100644 --- a/src/corelib/statemachine/qstatemachine.cpp +++ b/src/corelib/statemachine/qstatemachine.cpp @@ -92,7 +92,7 @@ QT_BEGIN_NAMESPACE QAbstractState) and transitions (descendants of QAbstractTransition) between those states; these states and transitions define a state graph. Once a state graph has been - built, the state machine can execute it. \l{QStateMachine}'s + built, the state machine can execute it. QStateMachine's execution algorithm is based on the \l{State Chart XML: State Machine Notation for Control Abstraction}{State Chart XML (SCXML)} algorithm. The framework's \l{The State Machine -- cgit v0.12 From e72285b0108f7649366a106f1c16ea73611dbcd4 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Wed, 3 Jun 2009 13:17:37 +0200 Subject: don't require use of SIGNAL macro in calls to addTransition() Just as with the QSignalTransition::signal property, this makes it possible to use the function from language bindings (e.g. QtScript). --- src/corelib/statemachine/qstate.cpp | 5 +++-- tests/auto/qstatemachine/tst_qstatemachine.cpp | 28 ++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/src/corelib/statemachine/qstate.cpp b/src/corelib/statemachine/qstate.cpp index 5463059..ebb0b47 100644 --- a/src/corelib/statemachine/qstate.cpp +++ b/src/corelib/statemachine/qstate.cpp @@ -329,9 +329,10 @@ QSignalTransition *QState::addTransition(QObject *sender, const char *signal, qWarning("QState::addTransition: cannot add transition to null state"); return 0; } - if (*signal && sender->metaObject()->indexOfSignal(signal+1) == -1) { + int offset = (*signal == '0'+QSIGNAL_CODE) ? 1 : 0; + if (sender->metaObject()->indexOfSignal(signal+offset) == -1) { qWarning("QState::addTransition: no such signal %s::%s", - sender->metaObject()->className(), signal+1); + sender->metaObject()->className(), signal+offset); return 0; } QSignalTransition *trans = new QSignalTransition(sender, signal, QList() << target); diff --git a/tests/auto/qstatemachine/tst_qstatemachine.cpp b/tests/auto/qstatemachine/tst_qstatemachine.cpp index 768a683..66e50ba 100644 --- a/tests/auto/qstatemachine/tst_qstatemachine.cpp +++ b/tests/auto/qstatemachine/tst_qstatemachine.cpp @@ -1768,6 +1768,34 @@ void tst_QStateMachine::signalTransitions() QState *s0 = new QState(machine.rootState()); QFinalState *s1 = new QFinalState(machine.rootState()); SignalEmitter emitter; + QSignalTransition *trans = s0->addTransition(&emitter, "signalWithNoArg()", s1); + QVERIFY(trans != 0); + QCOMPARE(trans->sourceState(), s0); + QCOMPARE(trans->targetState(), (QAbstractState*)s1); + QCOMPARE(trans->senderObject(), (QObject*)&emitter); + QCOMPARE(trans->signal(), QByteArray("signalWithNoArg()")); + + QSignalSpy finishedSpy(&machine, SIGNAL(finished())); + machine.setInitialState(s0); + machine.start(); + QCoreApplication::processEvents(); + + emitter.emitSignalWithNoArg(); + + QTRY_COMPARE(finishedSpy.count(), 1); + + trans->setSignal("signalWithIntArg(int)"); + QCOMPARE(trans->signal(), QByteArray("signalWithIntArg(int)")); + machine.start(); + QCoreApplication::processEvents(); + emitter.emitSignalWithIntArg(123); + QTRY_COMPARE(finishedSpy.count(), 2); + } + { + QStateMachine machine; + QState *s0 = new QState(machine.rootState()); + QFinalState *s1 = new QFinalState(machine.rootState()); + SignalEmitter emitter; TestSignalTransition *trans = new TestSignalTransition(&emitter, SIGNAL(signalWithIntArg(int)), s1); s0->addTransition(trans); -- cgit v0.12 From a6cb0edd2f8f69ea7b878d65756d47ed166f4224 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Wed, 3 Jun 2009 13:21:43 +0200 Subject: fix signal signature bug in debug output The signal code (first character of const char *signal) is stripped internally, so the debug output code should not skip any characters. --- src/corelib/statemachine/qstatemachine.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp index be816a6..d5f6b76 100644 --- a/src/corelib/statemachine/qstatemachine.cpp +++ b/src/corelib/statemachine/qstatemachine.cpp @@ -1329,7 +1329,7 @@ void QStateMachinePrivate::registerSignalTransition(QSignalTransition *transitio if (!ok) { #ifdef QSTATEMACHINE_DEBUG qDebug() << q << ": FAILED to add signal transition from" << transition->sourceState() - << ": ( sender =" << sender << ", signal =" << (signal.mid(1)) + << ": ( sender =" << sender << ", signal =" << signal << ", targets =" << transition->targetStates() << ')'; #endif return; @@ -1339,7 +1339,7 @@ void QStateMachinePrivate::registerSignalTransition(QSignalTransition *transitio QSignalTransitionPrivate::get(transition)->signalIndex = signalIndex; #ifdef QSTATEMACHINE_DEBUG qDebug() << q << ": added signal transition from" << transition->sourceState() - << ": ( sender =" << sender << ", signal =" << (signal.mid(1)) + << ": ( sender =" << sender << ", signal =" << signal << ", targets =" << transition->targetStates() << ')'; #endif } -- cgit v0.12 From 94376c5ab5caf1889caef29db66f981e34e7c4d5 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 3 Jun 2009 10:53:11 +0200 Subject: qdoc: Fixed constructor position in summary lists. The constructors had been displayed in the left column of the table in the summary list, because there was no type. It was caused by a strange test of the match index for 0, which was true for constructors and destructors, anything without a type. I removed that test, since I couldn't figure out what it was for. We might see problems elsewhere in the docs because of this, so beware. I didn't see any, but that test must have been there for some reason. --- tools/qdoc3/htmlgenerator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 4e4261f..db70862 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -2317,7 +2317,7 @@ QString HtmlGenerator::highlightedCode(const QString& markedCode, static const QString linkTag("link"); for (int i = 0, n = src.size(); i < n;) { if (src.at(i) == charLangle && src.at(i + 1).unicode() == '@') { - if (nameAlignment && (i != 0)) + if (nameAlignment) // && (i != 0)) Why was this here? html += " "; i += 2; if (parseArg(src, linkTag, &i, n, &arg, &par1)) { -- cgit v0.12 From 8ccecbfef54fbb59eedb3e717c1e2838b96e4fe3 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 3 Jun 2009 14:06:49 +0200 Subject: qdoc: Fixed some spacing problems. --- tools/qdoc3/htmlgenerator.cpp | 31 +++++++++++++++++++------------ tools/qdoc3/test/classic.css | 2 +- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index db70862..422e956 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -1118,29 +1118,34 @@ void HtmlGenerator::generateClassLikeNode(const InnerNode *inner, names << (*m)->name(); if ((*m)->type() == Node::Function) { const FunctionNode *func = reinterpret_cast(*m); - if (func->metaness() == FunctionNode::Ctor || func->metaness() == FunctionNode::Dtor - || func->overloadNumber() != 1) + if (func->metaness() == FunctionNode::Ctor || + func->metaness() == FunctionNode::Dtor || + func->overloadNumber() != 1) names.clear(); - } else if ((*m)->type() == Node::Property) { + } + else if ((*m)->type() == Node::Property) { const PropertyNode *prop = reinterpret_cast(*m); - if (!prop->getters().isEmpty() && !names.contains(prop->getters().first()->name())) + if (!prop->getters().isEmpty() && + !names.contains(prop->getters().first()->name())) names << prop->getters().first()->name(); if (!prop->setters().isEmpty()) names << prop->setters().first()->name(); if (!prop->resetters().isEmpty()) names << prop->resetters().first()->name(); - } else if ((*m)->type() == Node::Enum) { - const EnumNode *enume = reinterpret_cast(*m); + } + else if ((*m)->type() == Node::Enum) { + const EnumNode *enume = reinterpret_cast(*m); if (enume->flagsType()) names << enume->flagsType()->name(); foreach (const QString &enumName, - enume->doc().enumItemNames().toSet() - - enume->doc().omitEnumItemNames().toSet()) - names << plainCode(marker->markedUpEnumValue(enumName, enume)); + enume->doc().enumItemNames().toSet() - + enume->doc().omitEnumItemNames().toSet()) + names << plainCode(marker->markedUpEnumValue(enumName, + enume)); } foreach (const QString &name, names) - classSection.keywords += qMakePair(name, linkForNode(*m, 0)); + classSection.keywords += qMakePair(name,linkForNode(*m,0)); } ++m; } @@ -3099,7 +3104,8 @@ void HtmlGenerator::generateDetailedMember(const Node *node, << " type is a typedef for " << "QFlags<" << protect(enume->name()) - << ">. It stores an OR combination of " << protect(enume->name()) + << ">. It stores an OR combination of " + << protect(enume->name()) << " values.

\n"; } } @@ -3113,7 +3119,8 @@ void HtmlGenerator::findAllClasses(const InnerNode *node) if ((*c)->access() != Node::Private && (*c)->url().isEmpty()) { if ((*c)->type() == Node::Class && !(*c)->doc().isEmpty()) { QString className = (*c)->name(); - if ((*c)->parent() && (*c)->parent()->type() == Node::Namespace && + if ((*c)->parent() && + (*c)->parent()->type() == Node::Namespace && !(*c)->parent()->name().isEmpty()) className = (*c)->parent()->name()+"::"+className; diff --git a/tools/qdoc3/test/classic.css b/tools/qdoc3/test/classic.css index fa0167b..5239856 100644 --- a/tools/qdoc3/test/classic.css +++ b/tools/qdoc3/test/classic.css @@ -66,7 +66,7 @@ body } table td.memItemLeft { - width: 200px; + width: 100px; padding: 1px 0px 0px 8px; margin: 4px; border-top-width: 1px; -- cgit v0.12 From ab873250fc93df5f5290fedbd5b17872cb1294c6 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 3 Jun 2009 13:31:44 +0200 Subject: Fix webkit import from the trunk. Updated the file list, the SVG filters have been removed. Reviewed-by: Trust me --- util/webkit/mkdist-webkit | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/util/webkit/mkdist-webkit b/util/webkit/mkdist-webkit index 62264ec..730e8eb 100755 --- a/util/webkit/mkdist-webkit +++ b/util/webkit/mkdist-webkit @@ -109,6 +109,7 @@ excluded_directories="$excluded_directories WebCore/platform/image-decoders/png" excluded_directories="$excluded_directories WebCore/platform/image-decoders/ico" excluded_directories="$excluded_directories WebCore/platform/image-decoders/jpeg" excluded_directories="$excluded_directories WebCore/platform/image-decoders/xbm" +excluded_directories="$excluded_directories WebCore/platform/image-decoders/skia" excluded_directories="$excluded_directories WebCore/plugins/gtk" excluded_directories="$excluded_directories WebCore/plugins/chromium" @@ -120,11 +121,6 @@ excluded_directories="$excluded_directories WebKit/mac" excluded_directories="$excluded_directories WebKit/wx" excluded_directories="$excluded_directories WebKit/cf" -excluded_directories="$excluded_directories WebCore/svg/graphics/cg" -excluded_directories="$excluded_directories WebCore/svg/graphics/cairo" -excluded_directories="$excluded_directories WebCore/svg/graphics/filters/cg" -excluded_directories="$excluded_directories WebCore/svg/graphics/mac" - excluded_directories="$excluded_directories WebKit/English.lproj WebKit/WebKit.xcodeproj" excluded_directories="$excluded_directories WebCore/English.lproj" -- cgit v0.12 From c890793e7a58e1d75d1f88f5e2c88162eddcca44 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 28 May 2009 17:22:54 +0200 Subject: force activation of minimized windows on Windows mobile When pressing the <- key on a Windows mobile device, the window gets a minimized event (no other soft keys behave like that). Restoring the window via the app menu isn't possible, because the window get a WM_ACTIVATE but its internal state is still minimized. It makes sense to unminimize activated apps on Windows mobile. Task-number: 254673 Reviewed-by: thartman --- src/gui/kernel/qapplication_win.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp index 670058b..7e97784 100644 --- a/src/gui/kernel/qapplication_win.cpp +++ b/src/gui/kernel/qapplication_win.cpp @@ -2063,9 +2063,13 @@ LRESULT CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam // WM_ACTIVATEAPP handles the "true" false case, as this is only when the application // loses focus. Doing it here would result in the widget getting focus to not know // where it got it from; it would simply get a 0 value as the old focus widget. +#ifndef Q_WS_WINCE_WM if (!(widget->windowState() & Qt::WindowMinimized)) { // Ignore the activate message send by WindowsXP to a minimized window -#ifdef Q_WS_WINCE_WM +#else + { + if (widget->windowState() & Qt::WindowMinimized) + widget->dataPtr()->window_state &= ~Qt::WindowMinimized; if (widget->windowState() & Qt::WindowFullScreen) qt_wince_hide_taskbar(widget->winId()); #endif -- cgit v0.12 From 5e0aef012a90598b88b547b1b73785f59ef135c1 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Wed, 3 Jun 2009 15:44:20 +0200 Subject: fix silly typo Yeesh. The function worked for the common case of the argument being a plain script object (obviously, otherwise this would have been discovered sooner), but it would never pick the less expensive path when replacing the QObject pointer of an existing proxy. And if you passed in a QVariant proxy (now who would ever do something like that...?), it would assert. --- src/script/qscriptengine.cpp | 2 +- tests/auto/qscriptengine/tst_qscriptengine.cpp | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/script/qscriptengine.cpp b/src/script/qscriptengine.cpp index d8908ed..97021fc 100644 --- a/src/script/qscriptengine.cpp +++ b/src/script/qscriptengine.cpp @@ -587,7 +587,7 @@ QScriptValue QScriptEngine::newQObject(const QScriptValue &scriptObject, QScriptValuePrivate *p = QScriptValuePrivate::get(scriptObject); if (!p || !p->value.isObject()) return newQObject(qtObject, ownership, options); - if (p->value.isVariant()) { + if (p->value.isQObject()) { QScript::ExtQObject::Instance *data; data = d->qobjectConstructor->get(p->value); Q_ASSERT(data != 0); diff --git a/tests/auto/qscriptengine/tst_qscriptengine.cpp b/tests/auto/qscriptengine/tst_qscriptengine.cpp index 5339fb4..fe60cd0 100644 --- a/tests/auto/qscriptengine/tst_qscriptengine.cpp +++ b/tests/auto/qscriptengine/tst_qscriptengine.cpp @@ -636,9 +636,21 @@ void tst_QScriptEngine::newQObject() QScriptValue val = ret.property("objectName"); QVERIFY(val.isString()); } + // "promote" variant object to QObject + { + QScriptValue obj = eng.newVariant(123); + QVERIFY(obj.isVariant()); + QScriptValue originalProto = obj.prototype(); + QScriptValue ret = eng.newQObject(obj, this); + QVERIFY(ret.isQObject()); + QVERIFY(ret.strictlyEquals(obj)); + QVERIFY(obj.isQObject()); + QCOMPARE(ret.toQObject(), (QObject *)this); + QVERIFY(ret.prototype().strictlyEquals(originalProto)); + } // replace QObject* of existing object { - QScriptValue object = eng.newQObject(this); + QScriptValue object = eng.newVariant(123); QScriptValue originalProto = object.prototype(); QObject otherQObject; QScriptValue ret = eng.newQObject(object, &otherQObject); -- cgit v0.12 From bd14a25c84fc2c12bfaa594b338aa2d0c0d4d940 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Wed, 3 Jun 2009 11:53:27 +0200 Subject: Removed a warning (qreal should be used, and not float) --- src/gui/widgets/qmenu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp index 50100af..bcfe0fb 100644 --- a/src/gui/widgets/qmenu.cpp +++ b/src/gui/widgets/qmenu.cpp @@ -398,7 +398,7 @@ QRect QMenuPrivate::actionRect(QAction *act) const return ret; } -static const float MenuFadeTimeInSec = 0.150; +static const qreal MenuFadeTimeInSec = 0.150; void QMenuPrivate::hideUpToMenuBar() { -- cgit v0.12 From a04e1c4733feb643eb8da7b4a94c175153691b38 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Wed, 3 Jun 2009 15:59:18 +0200 Subject: Fixed the QMenu to open submenus even if the pointing device is moving but the current highlighted item doesn't change Task-number: 254238 Reviewed-by: ogoffart --- src/gui/widgets/qmenu.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp index bcfe0fb..711f1f4 100644 --- a/src/gui/widgets/qmenu.cpp +++ b/src/gui/widgets/qmenu.cpp @@ -547,10 +547,12 @@ void QMenuPrivate::setCurrentAction(QAction *action, int popup, SelectionReason { Q_Q(QMenu); tearoffHighlighted = 0; - if (action == currentAction && !(action && action->menu() && action->menu() != activeMenu)) { - if(QMenu *menu = qobject_cast(causedPopup.widget)) { - if(causedPopup.action && menu->d_func()->activeMenu == q) - menu->d_func()->setCurrentAction(causedPopup.action, 0, reason, false); + if (action == currentAction) { + if (!action || !action->menu() || action->menu() == activeMenu) { + if(QMenu *menu = qobject_cast(causedPopup.widget)) { + if(causedPopup.action && menu->d_func()->activeMenu == q) + menu->d_func()->setCurrentAction(causedPopup.action, 0, reason, false); + } } return; } @@ -565,7 +567,7 @@ void QMenuPrivate::setCurrentAction(QAction *action, int popup, SelectionReason QAction *previousAction = currentAction; #endif #ifdef QT3_SUPPORT - emitHighlighted = (action && action != currentAction); + emitHighlighted = action; #endif currentAction = action; if (action) { -- cgit v0.12 From 9d42ae152f660cfacad104060741b17b96269cd2 Mon Sep 17 00:00:00 2001 From: Norwegian Rock Cat Date: Wed, 3 Jun 2009 16:07:26 +0200 Subject: Change crazy casts from QString to NSSting to qt_mac_QStringToNSString. These function exist for making code not look so crazy, so let's actually use that in code where it didn't exist before. --- src/gui/widgets/qmenu_mac.mm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/gui/widgets/qmenu_mac.mm b/src/gui/widgets/qmenu_mac.mm index 87c886c..786633c 100644 --- a/src/gui/widgets/qmenu_mac.mm +++ b/src/gui/widgets/qmenu_mac.mm @@ -623,7 +623,7 @@ static inline QT_MANGLE_NAMESPACE(QCocoaMenuLoader) *getMenuLoader() static NSMenuItem *createNSMenuItem(const QString &title) { NSMenuItem *item = [[NSMenuItem alloc] - initWithTitle:reinterpret_cast(static_cast(QCFString(title))) + initWithTitle:qt_mac_QStringToNSString(title) action:@selector(qtDispatcherToQAction:) keyEquivalent:@""]; [item setTarget:getMenuLoader()]; return item; @@ -1381,18 +1381,18 @@ QMenuPrivate::QMacMenuPrivate::syncAction(QMacMenuAction *action) // Cocoa Font and title if (action->action->font().resolve()) { const QFont &actionFont = action->action->font(); - NSFont *customMenuFont = [NSFont fontWithName:reinterpret_cast(static_cast(QCFString(actionFont.family()))) + NSFont *customMenuFont = [NSFont fontWithName:qt_mac_QStringToNSString(actionFont.family()) size:actionFont.pointSize()]; NSArray *keys = [NSArray arrayWithObjects:NSFontAttributeName, nil]; NSArray *objects = [NSArray arrayWithObjects:customMenuFont, nil]; NSDictionary *attributes = [NSDictionary dictionaryWithObjects:objects forKeys:keys]; - NSAttributedString *str = [[[NSAttributedString alloc] initWithString:reinterpret_cast(static_cast(QCFString(finalString))) + NSAttributedString *str = [[[NSAttributedString alloc] initWithString:qt_mac_QStringToNSString(finalString) attributes:attributes] autorelease]; [item setAttributedTitle: str]; } else { - [item setTitle: reinterpret_cast(static_cast(QCFString(finalString)))]; + [item setTitle: qt_mac_QStringToNSString(finalString)]; } - [item setTitle:reinterpret_cast(static_cast(QCFString(qt_mac_removeMnemonics(text))))]; + [item setTitle:qt_mac_QStringToNSString(qt_mac_removeMnemonics(text))]; // Cocoa Enabled [item setEnabled: action->action->isEnabled()]; @@ -1694,7 +1694,7 @@ QMenuBarPrivate::QMacMenuBarPrivate::syncAction(QMacMenuAction *action) ChangeMenuAttributes(submenu, kMenuAttrHidden, 0); #else [item setSubmenu: submenu]; - [submenu setTitle:reinterpret_cast(static_cast(QCFString(qt_mac_removeMnemonics(action->action->text()))))]; + [submenu setTitle:qt_mac_QStringToNSString(qt_mac_removeMnemonics(action->action->text()))]; syncNSMenuItemVisiblity(item, visible); #endif if (release_submenu) { //no pointers to it @@ -1786,7 +1786,7 @@ OSMenuRef QMenuBarPrivate::macMenu() SetMenuItemHierarchicalMenu(mac_menubar->menu, index, mac_menubar->apple_menu); SetMenuItemProperty(mac_menubar->apple_menu, 0, kMenuCreatorQt, kMenuPropertyQWidget, sizeof(q), &q); #else - [mac_menubar->apple_menu setTitle:reinterpret_cast(static_cast(QCFString(QString(QChar(0x14)))))]; + [mac_menubar->apple_menu setTitle:qt_mac_QStringToNSString(QString(QChar(0x14)))]; NSMenuItem *apple_menuItem = [[NSMenuItem alloc] init]; [apple_menuItem setSubmenu:mac_menubar->menu]; [mac_menubar->apple_menu addItem:apple_menuItem]; -- cgit v0.12 From 43de28ba040bea21e2aee5b13be1351127503336 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Wed, 3 Jun 2009 17:27:03 +0200 Subject: Doc fix: moved the cldr version outside of the double-to-string license header --- src/corelib/tools/qlocale.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp index 4c2f59a..8c740bd 100644 --- a/src/corelib/tools/qlocale.cpp +++ b/src/corelib/tools/qlocale.cpp @@ -1601,6 +1601,8 @@ QDataStream &operator>>(QDataStream &ds, QLocale &l) This constructor converts the locale name to a language/country pair; it does not use the system locale database. + QLocale's data is based on Common Locale Data Repository v1.6.1. + The double-to-string and string-to-double conversion functions are covered by the following licenses: @@ -1621,8 +1623,6 @@ QDataStream &operator>>(QDataStream &ds, QLocale &l) This product includes software developed by the University of California, Berkeley and its contributors. - QLocale's data is based on Common Locale Data Repository v1.6.1. - \sa QString::arg(), QString::toInt(), QString::toDouble() */ -- cgit v0.12 From ba2e1015f9efe584a1ea671ff1db00f743f4ee3c Mon Sep 17 00:00:00 2001 From: David Boddie Date: Wed, 3 Jun 2009 18:36:32 +0200 Subject: Doc: Added information about the Fontconfig and FreeType dependencies. Task-number: 250349 Reviewed-by: Trust Me --- doc/src/installation.qdoc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/doc/src/installation.qdoc b/doc/src/installation.qdoc index 6a689f9..bc310c9 100644 --- a/doc/src/installation.qdoc +++ b/doc/src/installation.qdoc @@ -612,6 +612,14 @@ in the \l{Qt for Windows CE Requirements} document. Xinerama libXinerama Multi-head support -xinerama or auto-detected1.1.0 + + + Fontconfig libfontconfig Font customization and configuration + -fontconfig or auto-detected2.1 + + FreeType libfreetype Font engine + 2.1.3 + Xi libXi X11 Input Extensions -xinput or auto-detected1.3.0 @@ -621,12 +629,14 @@ in the \l{Qt for Windows CE Requirements} document. Xext libXext X Extensions6.4.3 X11 libX11 X11 Client-Side Library6.2.1 + SM libSM X Session Management -sm or auto-detected6.0.4 ICE libICE Inter-Client Exchange -sm or auto-detected6.3.5 + glib libglib-2.0 Common event loop handling -glib or auto-detected2.8.3 -- cgit v0.12