Merge remote-tracking branch 'origin/5.15' into dev

Conflicts:
	src/corelib/text/qstringliteral.h

Change-Id: I1665af3ce537471b249def5e080b39bd4105189e
This commit is contained in:
Qt Forward Merge Bot 2020-04-27 01:00:12 +02:00 committed by Edward Welbourne
commit 00ee368813
8 changed files with 36 additions and 13 deletions

View File

@ -4497,6 +4497,14 @@ QDebug operator<<(QDebug dbg, const QObject *o)
\c{staticMetaObject} is of type QMetaObject and provides access to the \c{staticMetaObject} is of type QMetaObject and provides access to the
enums declared with Q_ENUM_NS/Q_FLAG_NS. enums declared with Q_ENUM_NS/Q_FLAG_NS.
For example:
\code
namespace test {
Q_NAMESPACE
...
\endcode
\sa Q_NAMESPACE_EXPORT \sa Q_NAMESPACE_EXPORT
*/ */
@ -4513,6 +4521,14 @@ QDebug operator<<(QDebug dbg, const QObject *o)
is declared with the supplied \a EXPORT_MACRO qualifier. This is is declared with the supplied \a EXPORT_MACRO qualifier. This is
useful if the object needs to be exported from a dynamic library. useful if the object needs to be exported from a dynamic library.
For example:
\code
namespace test {
Q_NAMESPACE_EXPORT(EXPORT_MACRO)
...
\endcode
\sa Q_NAMESPACE, {Creating Shared Libraries} \sa Q_NAMESPACE, {Creating Shared Libraries}
*/ */

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2016 The Qt Company Ltd. ** Copyright (C) 2016 The Qt Company Ltd.
** Copyright (C) 2016 Intel Corporation. ** Copyright (C) 2020 Intel Corporation.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the QtCore module of the Qt Toolkit. ** This file is part of the QtCore module of the Qt Toolkit.

View File

@ -2631,7 +2631,6 @@ QT_WARNING_POP
\row \li ap or a \row \li ap or a
\li Interpret as an am/pm time. \e a/ap will match a lower-case version \li Interpret as an am/pm time. \e a/ap will match a lower-case version
of either QLocale::amText() or QLocale::pmText(). of either QLocale::amText() or QLocale::pmText().
\row \li t \li the timezone (for example "CEST")
\endtable \endtable
All other input characters will be treated as text. Any non-empty sequence All other input characters will be treated as text. Any non-empty sequence
@ -5554,8 +5553,15 @@ QT_WARNING_POP
Uses the calendar \a cal if supplied, else Gregorian. Uses the calendar \a cal if supplied, else Gregorian.
See QDate::fromString() and QTime::fromString() for the expressions In addition to the expressions, recognized in the format string to represent
recognized in the format string to represent parts of the date and time. parts of the date and time, by QDate::fromString() and QTime::fromString(),
this method supports:
\table
\header \li Expression \li Output
\row \li t \li the timezone (for example "CEST")
\endtable
All other input characters will be treated as text. Any non-empty sequence All other input characters will be treated as text. Any non-empty sequence
of characters enclosed in single quotes will also be treated (stripped of of characters enclosed in single quotes will also be treated (stripped of
the quotes) as text and not be interpreted as expressions. the quotes) as text and not be interpreted as expressions.

View File

@ -525,7 +525,7 @@ bool QDateTimeParser::parseFormat(const QString &newFormat)
} }
break; break;
case 't': case 't':
if (parserType != QMetaType::QTime) { if (parserType == QMetaType::QDateTime) {
const SectionNode sn = { TimeZoneSection, i - add, countRepeat(newFormat, i, 4), 0 }; const SectionNode sn = { TimeZoneSection, i - add, countRepeat(newFormat, i, 4), 0 };
newSectionNodes.append(sn); newSectionNodes.append(sn);
appendSeparator(&newSeparators, newFormat, index, i - index, lastQuote); appendSeparator(&newSeparators, newFormat, index, i - index, lastQuote);

View File

@ -2122,12 +2122,7 @@ static QImage convertWithPalette(const QImage &src, QImage::Format format,
QImage dest(src.size(), format); QImage dest(src.size(), format);
dest.setColorTable(clut); dest.setColorTable(clut);
QString textsKeys = src.text(); QImageData::get(dest)->text = QImageData::get(src)->text;
const auto textKeyList = textsKeys.splitRef(QLatin1Char('\n'), Qt::SkipEmptyParts);
for (const auto &textKey : textKeyList) {
const auto textKeySplitted = textKey.split(QLatin1String(": "));
dest.setText(textKeySplitted[0].toString(), textKeySplitted[1].toString());
}
int h = src.height(); int h = src.height();
int w = src.width(); int w = src.width();

View File

@ -320,6 +320,7 @@ private:
friend class QRasterPlatformPixmap; friend class QRasterPlatformPixmap;
friend class QBlittablePlatformPixmap; friend class QBlittablePlatformPixmap;
friend class QPixmapCacheEntry; friend class QPixmapCacheEntry;
friend struct QImageData;
public: public:
typedef QImageData * DataPtr; typedef QImageData * DataPtr;

View File

@ -69,6 +69,9 @@ struct Q_GUI_EXPORT QImageData { // internal image data
static QImageData *create(const QSize &size, QImage::Format format); static QImageData *create(const QSize &size, QImage::Format format);
static QImageData *create(uchar *data, int w, int h, qsizetype bpl, QImage::Format format, bool readOnly, QImageCleanupFunction cleanupFunction = nullptr, void *cleanupInfo = nullptr); static QImageData *create(uchar *data, int w, int h, qsizetype bpl, QImage::Format format, bool readOnly, QImageCleanupFunction cleanupFunction = nullptr, void *cleanupInfo = nullptr);
static QImageData *get(QImage &img) noexcept { return img.d; }
static const QImageData *get(const QImage &img) noexcept { return img.d; }
QAtomicInt ref; QAtomicInt ref;
int width; int width;

View File

@ -536,8 +536,10 @@ void QCALayerBackingStore::flush(QWindow *flushedWindow, const QRegion &region,
flushedView.layer.contentsScale = m_buffers.back()->devicePixelRatio(); flushedView.layer.contentsScale = m_buffers.back()->devicePixelRatio();
} }
const bool isSingleBuffered = window()->format().swapBehavior() == QSurfaceFormat::SingleBuffer;
id backBufferSurface = (__bridge id)m_buffers.back()->surface(); id backBufferSurface = (__bridge id)m_buffers.back()->surface();
if (flushedView.layer.contents == backBufferSurface) { if (!isSingleBuffered && flushedView.layer.contents == backBufferSurface) {
// We've managed to paint to the back buffer again before Core Animation had time // We've managed to paint to the back buffer again before Core Animation had time
// to flush the transaction and persist the layer changes to the window server, or // to flush the transaction and persist the layer changes to the window server, or
// we've been asked to flush without painting anything. The layer already knows about // we've been asked to flush without painting anything. The layer already knows about
@ -554,7 +556,7 @@ void QCALayerBackingStore::flush(QWindow *flushedWindow, const QRegion &region,
// with other pending view and layer updates. // with other pending view and layer updates.
flushedView.window.viewsNeedDisplay = YES; flushedView.window.viewsNeedDisplay = YES;
if (window()->format().swapBehavior() == QSurfaceFormat::SingleBuffer) { if (isSingleBuffered) {
// The private API [CALayer reloadValueForKeyPath:@"contents"] would be preferable, // The private API [CALayer reloadValueForKeyPath:@"contents"] would be preferable,
// but barring any side effects or performance issues we opt for the hammer for now. // but barring any side effects or performance issues we opt for the hammer for now.
flushedView.layer.contents = nil; flushedView.layer.contents = nil;