From 9d1203bf02abec8b5ab73c4c8a81eb4627336ad8 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Sun, 9 Apr 2017 09:19:41 +0200 Subject: QVariant: fix docs regarding QUuid - toUuid(): QUuid is a built-in type, so use type(), not userType() - canConvert()/toUuid(): QUuid converts to and from QString Change-Id: I5262ff7ab093040cb943b6ab9cfffe95491d2b9b Reviewed-by: Thiago Macieira --- src/corelib/kernel/qvariant.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/corelib/kernel') diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp index 7c9df5b46f..8ad61be8ee 100644 --- a/src/corelib/kernel/qvariant.cpp +++ b/src/corelib/kernel/qvariant.cpp @@ -2526,8 +2526,9 @@ QRegularExpression QVariant::toRegularExpression() const /*! \since 5.0 - Returns the variant as a QUuid if the variant has userType() \l - QUuid; otherwise returns a default constructed QUuid. + Returns the variant as a QUuid if the variant has type() + \l QMetaType::QUuid or \l QMetaType::QString; + otherwise returns a default-constructed QUuid. \sa canConvert(), convert() */ @@ -2995,7 +2996,7 @@ static bool canConvertMetaObject(int fromId, int toId, QObject *fromObject) \l QMetaType::QDate, \l QMetaType::QDateTime, \l QMetaType::Double, \l QMetaType::QFont, \l QMetaType::Int, \l QMetaType::QKeySequence, \l QMetaType::LongLong, \l QMetaType::QStringList, \l QMetaType::QTime, - \l QMetaType::UInt, \l QMetaType::ULongLong + \l QMetaType::UInt, \l QMetaType::ULongLong, \l QMetaType::QUuid \row \li \l QMetaType::QStringList \li \l QMetaType::QVariantList, \l QMetaType::QString (if the list contains exactly one item) \row \li \l QMetaType::QTime \li \l QMetaType::QString @@ -3005,6 +3006,7 @@ static bool canConvertMetaObject(int fromId, int toId, QObject *fromObject) \row \li \l QMetaType::ULongLong \li \l QMetaType::Bool, \l QMetaType::QChar, \l QMetaType::Double, \l QMetaType::Int, \l QMetaType::LongLong, \l QMetaType::QString, \l QMetaType::UInt + \row \li \l QMetaType::QUuid \li \l QMetaType::QString \endtable A QVariant containing a pointer to a type derived from QObject will also return true for this -- cgit v1.2.3 From eda7f6ea7863b80985f62b28fe99c1176bc54c77 Mon Sep 17 00:00:00 2001 From: BogDan Vatra Date: Thu, 6 Apr 2017 11:14:26 +0300 Subject: Don't hide critical info The developer should see what's wrong even on release builds. That code hides any mistakes we do in JNI which are pretty critical for developers because they can't see what's wrong with their code. e.g. QtAndroid::activity().callMethod("wrongMethodName") *silently* fails, which is so wrong! Change-Id: I8b6a24946dfef716fcd86ab9bba82666974e3991 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/corelib/kernel/qjni.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/corelib/kernel') diff --git a/src/corelib/kernel/qjni.cpp b/src/corelib/kernel/qjni.cpp index 41d55c8fde..60154328c2 100644 --- a/src/corelib/kernel/qjni.cpp +++ b/src/corelib/kernel/qjni.cpp @@ -64,9 +64,7 @@ static QString qt_convertJString(jstring string) static inline bool exceptionCheckAndClear(JNIEnv *env) { if (Q_UNLIKELY(env->ExceptionCheck())) { -#ifdef QT_DEBUG env->ExceptionDescribe(); -#endif // QT_DEBUG env->ExceptionClear(); return true; } -- cgit v1.2.3