From: Kent Hansen Date: Tue, 27 Mar 2012 14:43:26 +0000 (+0200) Subject: Merge master into api_changes X-Git-Tag: 071012131707~609^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=24fb8dc27eddfdd62bd2c3a6e863cbf433762cd6;p=profile%2Fivi%2Fqtdeclarative.git Merge master into api_changes Conflicts: src/qml/debugger/qqmlenginedebugservice.cpp src/qml/debugger/qqmlprofilerservice_p.h src/qml/qml/qqmlboundsignal.cpp src/qml/qml/qqmlpropertycache.cpp src/quick/util/qquickimageprovider.cpp Change-Id: I0609aa5ed54c7769f1e2773a96a7cd43a69f133c --- 24fb8dc27eddfdd62bd2c3a6e863cbf433762cd6 diff --cc src/qml/debugger/qqmlenginedebugservice.cpp index 7f0bf7c,2dbabdb..cd09b69 --- a/src/qml/debugger/qqmlenginedebugservice.cpp +++ b/src/qml/debugger/qqmlenginedebugservice.cpp @@@ -247,8 -269,10 +269,8 @@@ void QQmlEngineDebugService::buildObjec prop.value = expr->expression(); QObject *scope = expr->scopeObject(); if (scope) { - QString methodName = QString::fromLatin1(scope->metaObject()->method(signal->index()).name()); - QString sig = QString::fromLatin1(scope->metaObject()->method(signalHandler->index()).signature()); - int lparen = sig.indexOf(QLatin1Char('(')); - if (lparen >= 0) { - QString methodName = sig.mid(0, lparen); ++ QString methodName = QString::fromLatin1(scope->metaObject()->method(signalHandler->index()).name()); + if (!methodName.isEmpty()) { prop.name = QLatin1String("on") + methodName[0].toUpper() + methodName.mid(1); } diff --cc src/qml/debugger/qqmlprofilerservice_p.h index 2b4cafb,2037643..2e35179 --- a/src/qml/debugger/qqmlprofilerservice_p.h +++ b/src/qml/debugger/qqmlprofilerservice_p.h @@@ -224,6 -224,19 +224,19 @@@ struct QQmlHandlingSignalProfiler } bool enabled; + + private: + void init(const QMetaMethod &signal, QQmlExpression *expression) + { + QQmlProfilerService *service = QQmlProfilerService::instance; + service->startRange(QQmlProfilerService::HandlingSignal); + service->rangeData(QQmlProfilerService::HandlingSignal, - QLatin1String(signal.signature()) + QLatin1String(": ") ++ QString::fromLatin1(signal.methodSignature()) + QLatin1String(": ") + + expression->expression()); + service->rangeLocation(QQmlProfilerService::HandlingSignal, + expression->sourceFile(), expression->lineNumber(), + expression->columnNumber()); + } }; struct QQmlObjectCreatingProfiler { diff --cc src/qml/qml/qqmlboundsignal.cpp index f7d0c00,b375a70..3a3bf40 --- a/src/qml/qml/qqmlboundsignal.cpp +++ b/src/qml/qml/qqmlboundsignal.cpp @@@ -227,10 -226,14 +226,14 @@@ QQmlBoundSignalParameters::QQmlBoundSig prop.setWritable(false); } else { QByteArray propType = type; - if ((QMetaType::typeFlags(t) & QMetaType::IsEnumeration) == QMetaType::IsEnumeration) { + QMetaType::TypeFlags flags = QMetaType::typeFlags(t); + if (flags & QMetaType::IsEnumeration) { t = QVariant::Int; propType = "int"; - } else if (t == QMetaType::UnknownType) { - } else if (t == QVariant::Invalid || - (t >= QVariant::UserType && !(flags & QMetaType::PointerToQObject) && ++ } else if (t == QMetaType::UnknownType || ++ (t >= int(QMetaType::User) && !(flags & QMetaType::PointerToQObject) && + t != qMetaTypeId())) { + //the UserType clause is to catch registered QFlags QByteArray scope; QByteArray name; int scopeIdx = propType.lastIndexOf("::"); @@@ -297,6 -300,71 +300,71 @@@ int QQmlBoundSignalParameters::metaCall } } + //////////////////////////////////////////////////////////////////////// + + QQmlBoundSignalNoParams::QQmlBoundSignalNoParams(QObject *scope, const QMetaMethod &signal, + QObject *owner) + : m_expression(0), m_owner(owner), m_index(signal.methodIndex()), m_isEvaluating(false) + { + callback = &subscriptionCallback; + QQmlNotifierEndpoint::connect(scope, m_index); + } + + QQmlBoundSignalNoParams::~QQmlBoundSignalNoParams() + { + delete m_expression; + m_expression = 0; + } + + int QQmlBoundSignalNoParams::index() const + { + return m_index; + } + + /*! + Returns the signal expression. + */ + QQmlExpression *QQmlBoundSignalNoParams::expression() const + { + return m_expression; + } + + /*! + Sets the signal expression to \a e. Returns the current signal expression, + or null if there is no signal expression. + + The QQmlBoundSignalNoParams instance takes ownership of \a e. The caller is + assumes ownership of the returned QQmlExpression. + */ + QQmlExpression *QQmlBoundSignalNoParams::setExpression(QQmlExpression *e) + { + QQmlExpression *rv = m_expression; + m_expression = e; + if (m_expression) m_expression->setNotifyOnValueChanged(false); + return rv; + } + + void QQmlBoundSignalNoParams::subscriptionCallback(QQmlNotifierEndpoint *e) + { + QQmlBoundSignalNoParams *s = static_cast(e); + if (!s->m_expression) + return; + + if (QQmlDebugService::isDebuggingEnabled()) - QV8DebugService::instance()->signalEmitted(QString::fromAscii(s->m_owner->metaObject()->method(s->m_index).signature())); ++ QV8DebugService::instance()->signalEmitted(QString::fromAscii(s->m_owner->metaObject()->method(s->m_index).methodSignature())); + + QQmlHandlingSignalProfiler prof(s->m_owner, s->m_index, s->m_expression); + + s->m_isEvaluating = true; + + if (s->m_expression && s->m_expression->engine()) { + QQmlExpressionPrivate::get(s->m_expression)->value(); + if (s->m_expression && s->m_expression->hasError()) + QQmlEnginePrivate::warning(s->m_expression->engine(), s->m_expression->error()); + } + s->m_isEvaluating = false; + } + QT_END_NAMESPACE #include diff --cc src/qml/qml/qqmlpropertycache.cpp index 4a1eb79,50fd409..1e8cfb6 --- a/src/qml/qml/qqmlpropertycache.cpp +++ b/src/qml/qml/qqmlpropertycache.cpp @@@ -730,22 -738,22 +730,26 @@@ int *QQmlPropertyCache::methodParameter const QMetaObject *metaObject = object->metaObject(); QMetaMethod m = metaObject->method(index); - QList argTypeNames = m.parameterTypes(); - A *args = static_cast(malloc(sizeof(A) + (argTypeNames.count() + 1) * sizeof(int))); - args->arguments[0] = argTypeNames.count(); + int argc = m.parameterCount(); + A *args = static_cast(malloc(sizeof(A) + (argc + 1) * sizeof(int))); + args->arguments[0] = argc; + QList argTypeNames; // Only loaded if needed - for (int ii = 0; ii < argTypeNames.count(); ++ii) { - int type = QMetaType::type(argTypeNames.at(ii)); + for (int ii = 0; ii < argc; ++ii) { + int type = m.parameterType(ii); - if ((QMetaType::typeFlags(type) & QMetaType::IsEnumeration) == QMetaType::IsEnumeration) + QMetaType::TypeFlags flags = QMetaType::typeFlags(type); + if (flags & QMetaType::IsEnumeration) type = QVariant::Int; - else if (type == QMetaType::UnknownType) { - else if (type == QVariant::Invalid || ++ else if (type == QMetaType::UnknownType || + (type >= (int)QVariant::UserType && !(flags & QMetaType::PointerToQObject) && - type != qMetaTypeId())) ++ type != qMetaTypeId())) { + //the UserType clause is to catch registered QFlags + if (argTypeNames.isEmpty()) + argTypeNames = m.parameterTypes(); - type = EnumType(object->metaObject(), argTypeNames.at(ii)); + type = EnumType(object->metaObject(), argTypeNames.at(ii), type); - if (type == QVariant::Invalid) { + } + if (type == QMetaType::UnknownType) { if (unknownTypeError) *unknownTypeError = argTypeNames.at(ii); free(args); return 0; @@@ -760,21 -768,21 +764,25 @@@ } else { QMetaMethod m = object->metaObject()->method(index); - QList argTypeNames = m.parameterTypes(); - dummy.resize(argTypeNames.count() + 1); - dummy[0] = argTypeNames.count(); + int argc = m.parameterCount(); + dummy.resize(argc + 1); + dummy[0] = argc; + QList argTypeNames; // Only loaded if needed - for (int ii = 0; ii < argTypeNames.count(); ++ii) { - int type = QMetaType::type(argTypeNames.at(ii)); + for (int ii = 0; ii < argc; ++ii) { + int type = m.parameterType(ii); - if ((QMetaType::typeFlags(type) & QMetaType::IsEnumeration) == QMetaType::IsEnumeration) + QMetaType::TypeFlags flags = QMetaType::typeFlags(type); + if (flags & QMetaType::IsEnumeration) type = QVariant::Int; - else if (type == QMetaType::UnknownType) { - else if (type == QVariant::Invalid || ++ else if (type == QMetaType::UnknownType || + (type >= (int)QVariant::UserType && !(flags & QMetaType::PointerToQObject) && - type != qMetaTypeId())) ++ type != qMetaTypeId())) { + //the UserType clause is to catch registered QFlags) + if (argTypeNames.isEmpty()) + argTypeNames = m.parameterTypes(); - type = EnumType(object->metaObject(), argTypeNames.at(ii)); + type = EnumType(object->metaObject(), argTypeNames.at(ii), type); - if (type == QVariant::Invalid) { + } + if (type == QMetaType::UnknownType) { if (unknownTypeError) *unknownTypeError = argTypeNames.at(ii); return 0; } diff --cc src/quick/util/qquickimageprovider.cpp index 1d838ca,5742b00..b306ab3 --- a/src/quick/util/qquickimageprovider.cpp +++ b/src/quick/util/qquickimageprovider.cpp @@@ -109,11 -110,12 +110,12 @@@ QImage QQuickTextureFactory::image() co /*! - \class QQmlImageProvider + \class QQuickImageProvider - \since 4.7 + \since 5.0 - \inmodule QtQml - \brief The QQmlImageProvider class provides an interface for supporting pixmaps and threaded image requests in QML. ++ \inmodule QtQuick + \brief The QQuickImageProvider class provides an interface for supporting pixmaps and threaded image requests in QML. - QQmlImageProvider is used to provide advanced image loading features + QQuickImageProvider is used to provide advanced image loading features in QML applications. It allows images in QML to be: \list