summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2019-05-03 10:44:24 +0200
committerLiang Qi <liang.qi@qt.io>2019-05-03 10:44:24 +0200
commitb5c2535eb0da4ad2b65e79df288a3674f3118717 (patch)
tree964bd1dfaa9c769878f8195db6d2bce03ef4e5c7 /src/corelib
parent3f25bcd5b7ec0d8a17a3a236099b9049b32b7755 (diff)
parent6c0ced4b7a77b089b434ab5eb9f430717f26d687 (diff)
Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts: src/3rdparty/pcre2/qt_attribution.json Change-Id: Ibae941cb12662f27bd6962ee02bc235971c59a15
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp20
-rw-r--r--src/corelib/qtcore.tracepoints5
-rw-r--r--src/corelib/tools/qlocale_mac.mm14
-rw-r--r--src/corelib/tools/qsharedpointer.cpp27
-rw-r--r--src/corelib/tools/qsharedpointer.h4
5 files changed, 27 insertions, 43 deletions
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index 30994d3056..0711914e2d 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -1197,28 +1197,26 @@ bool QCoreApplicationPrivate::notify_helper(QObject *receiver, QEvent * event)
{
// Note: when adjusting the tracepoints in here
// consider adjusting QApplicationPrivate::notify_helper too.
- Q_TRACE_SCOPE(QCoreApplication_notify, receiver, event, event->type());
+ Q_TRACE(QCoreApplication_notify_entry, receiver, event, event->type());
+ bool consumed = false;
+ bool filtered = false;
+ Q_TRACE_EXIT(QCoreApplication_notify_exit, consumed, filtered);
// send to all application event filters (only does anything in the main thread)
if (QCoreApplication::self
&& receiver->d_func()->threadData->thread == mainThread()
&& QCoreApplication::self->d_func()->sendThroughApplicationEventFilters(receiver, event)) {
- Q_TRACE(QCoreApplication_notify_event_filtered, receiver, event, event->type());
- return true;
+ filtered = true;
+ return filtered;
}
// send to all receiver event filters
if (sendThroughObjectEventFilters(receiver, event)) {
- Q_TRACE(QCoreApplication_notify_event_filtered, receiver, event, event->type());
- return true;
+ filtered = true;
+ return filtered;
}
- Q_TRACE(QCoreApplication_notify_before_delivery, receiver, event, event->type());
-
// deliver the event
- const bool consumed = receiver->event(event);
-
- Q_TRACE(QCoreApplication_notify_after_delivery, receiver, event, event->type(), consumed);
-
+ consumed = receiver->event(event);
return consumed;
}
diff --git a/src/corelib/qtcore.tracepoints b/src/corelib/qtcore.tracepoints
index a1bc957fe5..4647b440a8 100644
--- a/src/corelib/qtcore.tracepoints
+++ b/src/corelib/qtcore.tracepoints
@@ -24,10 +24,7 @@ QCoreApplication_sendEvent(QObject *receiver, QEvent *event, int type)
QCoreApplication_sendSpontaneousEvent(QObject *receiver, QEvent *event, int type)
QCoreApplication_notify_entry(QObject *receiver, QEvent *event, int type)
-QCoreApplication_notify_exit()
-QCoreApplication_notify_event_filtered(QObject *receiver, QEvent *event, int type)
-QCoreApplication_notify_before_delivery(QObject *receiver, QEvent *event, int type)
-QCoreApplication_notify_after_delivery(QObject *receiver, QEvent *event, int type, bool consumed)
+QCoreApplication_notify_exit(bool consumed, bool filtered)
QObject_ctor(QObject *object)
QObject_dtor(QObject *object)
diff --git a/src/corelib/tools/qlocale_mac.mm b/src/corelib/tools/qlocale_mac.mm
index edbaaf5d18..574cb0714c 100644
--- a/src/corelib/tools/qlocale_mac.mm
+++ b/src/corelib/tools/qlocale_mac.mm
@@ -332,6 +332,17 @@ static QString macCurrencySymbol(QLocale::CurrencySymbolFormat format)
return QString();
}
+static QString macZeroDigit()
+{
+ QCFType<CFLocaleRef> locale = CFLocaleCopyCurrent();
+ QCFType<CFNumberFormatterRef> numberFormatter =
+ CFNumberFormatterCreate(nullptr, locale, kCFNumberFormatterNoStyle);
+ static const int zeroDigit = 0;
+ QCFType<CFStringRef> value = CFNumberFormatterCreateStringWithValue(nullptr, numberFormatter,
+ kCFNumberIntType, &zeroDigit);
+ return QString::fromCFString(value);
+}
+
#ifndef QT_NO_SYSTEMLOCALE
static QString macFormatCurrency(const QSystemLocale::CurrencyToStringArgument &arg)
{
@@ -437,8 +448,9 @@ QVariant QSystemLocale::query(QueryType type, QVariant in = QVariant()) const
case NegativeSign:
case PositiveSign:
- case ZeroDigit:
break;
+ case ZeroDigit:
+ return QVariant(macZeroDigit());
case MeasurementSystem:
return QVariant(static_cast<int>(macMeasurementSystem()));
diff --git a/src/corelib/tools/qsharedpointer.cpp b/src/corelib/tools/qsharedpointer.cpp
index 62b76c5bb7..9e9466f6b1 100644
--- a/src/corelib/tools/qsharedpointer.cpp
+++ b/src/corelib/tools/qsharedpointer.cpp
@@ -649,19 +649,7 @@
*/
/*!
- \fn template <class T> QSharedPointer<T> QSharedPointer<T>::create()
- \since 5.1
-
- Creates a QSharedPointer object and allocates a new item of type \tt T. The
- QSharedPointer internals and the object are allocated in one single memory
- allocation, which could help reduce memory fragmentation in a long-running
- application.
-
- This function calls the default constructor for type \tt T.
-*/
-
-/*!
- \fn template <class T> QSharedPointer<T> QSharedPointer<T>::create(...)
+ \fn template <class T> template <typename... Args> QSharedPointer<T> QSharedPointer<T>::create(Args &&... args)
\overload
\since 5.1
@@ -671,18 +659,7 @@
application.
This function will attempt to call a constructor for type \tt T that can
- accept all the arguments passed. Arguments will be perfectly-forwarded.
-
- \note This function is only fully available with a C++11 compiler that
- supports perfect forwarding of an arbitrary number of arguments.
-
- If the compiler does not support the necessary C++11 features,
- then a restricted version is available since Qt 5.4: you may pass
- one (but just one) argument, and it will always be passed by const
- reference.
-
- If you target Qt before version 5.4, you must use the overload
- that calls the default constructor.
+ accept all the arguments passed (\a args). Arguments will be perfectly-forwarded.
*/
/*!
diff --git a/src/corelib/tools/qsharedpointer.h b/src/corelib/tools/qsharedpointer.h
index 98b38b97d3..a2c5f990fc 100644
--- a/src/corelib/tools/qsharedpointer.h
+++ b/src/corelib/tools/qsharedpointer.h
@@ -97,8 +97,8 @@ public:
template <class X> QSharedPointer<X> constCast() const;
template <class X> QSharedPointer<X> objectCast() const;
- static inline QSharedPointer<T> create();
- static inline QSharedPointer<T> create(...);
+ template <typename... Args>
+ static inline QSharedPointer<T> create(Args &&... args);
};
template <class T>