summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp4
-rw-r--r--src/corelib/kernel/qdeadlinetimer.cpp2
-rw-r--r--src/corelib/kernel/qobjectdefs.h1
-rw-r--r--src/corelib/kernel/qvariant.cpp13
4 files changed, 17 insertions, 3 deletions
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index a08021be96..6141a73966 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -1911,8 +1911,8 @@ void QCoreApplication::quit()
Installing or removing a QTranslator, or changing an installed QTranslator
generates a \l{QEvent::LanguageChange}{LanguageChange} event for the
- QCoreApplication instance. A QGuiApplication instance will propagate the event
- to all toplevel windows, where a reimplementation of changeEvent can
+ QCoreApplication instance. A QApplication instance will propagate the event
+ to all toplevel widgets, where a reimplementation of changeEvent can
re-translate the user interface by passing user-visible strings via the
tr() function to the respective property setters. User-interface classes
generated by Qt Designer provide a \c retranslateUi() function that can be
diff --git a/src/corelib/kernel/qdeadlinetimer.cpp b/src/corelib/kernel/qdeadlinetimer.cpp
index a2ec813f11..ae4ffdcefc 100644
--- a/src/corelib/kernel/qdeadlinetimer.cpp
+++ b/src/corelib/kernel/qdeadlinetimer.cpp
@@ -420,7 +420,7 @@ void QDeadlineTimer::setTimerType(Qt::TimerType timerType)
qint64 QDeadlineTimer::remainingTime() const Q_DECL_NOTHROW
{
qint64 ns = remainingTimeNSecs();
- return ns <= 0 ? ns : ns / (1000 * 1000);
+ return ns <= 0 ? ns : (ns + 999999) / (1000 * 1000);
}
/*!
diff --git a/src/corelib/kernel/qobjectdefs.h b/src/corelib/kernel/qobjectdefs.h
index b6307fcfcf..5fc8937f23 100644
--- a/src/corelib/kernel/qobjectdefs.h
+++ b/src/corelib/kernel/qobjectdefs.h
@@ -205,6 +205,7 @@ private: \
QT_ANNOTATE_CLASS(qt_qgadget, "") \
/*end*/
+/* qmake ignore Q_NAMESPACE */
#define Q_NAMESPACE \
extern const QMetaObject staticMetaObject; \
QT_ANNOTATE_CLASS(qt_qnamespace, "") \
diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp
index 17c94e4e9d..e6262124fb 100644
--- a/src/corelib/kernel/qvariant.cpp
+++ b/src/corelib/kernel/qvariant.cpp
@@ -855,6 +855,12 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok)
if (qstrcmp(QMetaType::typeName(d->type), "QMap<QString, QVariant>") == 0) {
*static_cast<QVariantMap *>(result) =
*static_cast<QMap<QString, QVariant> *>(d->data.shared->ptr);
+ } else if (d->type == QVariant::Hash) {
+ QVariantMap *map = static_cast<QVariantMap *>(result);
+ const QVariantHash *hash = v_cast<QVariantHash>(d);
+ const auto end = hash->end();
+ for (auto it = hash->begin(); it != end; ++it)
+ map->insertMulti(it.key(), it.value());
#ifndef QT_BOOTSTRAPPED
} else if (d->type == QMetaType::QJsonValue) {
if (!v_cast<QJsonValue>(d)->isObject())
@@ -871,6 +877,12 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok)
if (qstrcmp(QMetaType::typeName(d->type), "QHash<QString, QVariant>") == 0) {
*static_cast<QVariantHash *>(result) =
*static_cast<QHash<QString, QVariant> *>(d->data.shared->ptr);
+ } else if (d->type == QVariant::Map) {
+ QVariantHash *hash = static_cast<QVariantHash *>(result);
+ const QVariantMap *map = v_cast<QVariantMap>(d);
+ const auto end = map->end();
+ for (auto it = map->begin(); it != end; ++it)
+ hash->insertMulti(it.key(), it.value());
#ifndef QT_BOOTSTRAPPED
} else if (d->type == QMetaType::QJsonValue) {
if (!v_cast<QJsonValue>(d)->isObject())
@@ -2070,6 +2082,7 @@ void QVariant::load(QDataStream &s)
typeId = QMetaType::type(name.constData());
if (typeId == QMetaType::UnknownType) {
s.setStatus(QDataStream::ReadCorruptData);
+ qWarning("QVariant::load: unknown user type with name %s.", name.constData());
return;
}
}