diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index efa71470d4..b0e2ebca92 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -4497,6 +4497,14 @@ QDebug operator<<(QDebug dbg, const QObject *o) \c{staticMetaObject} is of type QMetaObject and provides access to the enums declared with Q_ENUM_NS/Q_FLAG_NS. + For example: + + \code + namespace test { + Q_NAMESPACE + ... + \endcode + \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 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} */ diff --git a/src/corelib/text/qstringliteral.h b/src/corelib/text/qstringliteral.h index 742d38de7d..913a8b0ee8 100644 --- a/src/corelib/text/qstringliteral.h +++ b/src/corelib/text/qstringliteral.h @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. -** Copyright (C) 2016 Intel Corporation. +** Copyright (C) 2020 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/time/qdatetime.cpp b/src/corelib/time/qdatetime.cpp index c2f0601ebf..eb4beff9e6 100644 --- a/src/corelib/time/qdatetime.cpp +++ b/src/corelib/time/qdatetime.cpp @@ -2631,7 +2631,6 @@ QT_WARNING_POP \row \li ap or a \li Interpret as an am/pm time. \e a/ap will match a lower-case version of either QLocale::amText() or QLocale::pmText(). - \row \li t \li the timezone (for example "CEST") \endtable 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. - See QDate::fromString() and QTime::fromString() for the expressions - recognized in the format string to represent parts of the date and time. + In addition to the expressions, recognized in the format string to represent + 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 of characters enclosed in single quotes will also be treated (stripped of the quotes) as text and not be interpreted as expressions. diff --git a/src/corelib/time/qdatetimeparser.cpp b/src/corelib/time/qdatetimeparser.cpp index 3374b28b69..bc3d9b992e 100644 --- a/src/corelib/time/qdatetimeparser.cpp +++ b/src/corelib/time/qdatetimeparser.cpp @@ -525,7 +525,7 @@ bool QDateTimeParser::parseFormat(const QString &newFormat) } break; case 't': - if (parserType != QMetaType::QTime) { + if (parserType == QMetaType::QDateTime) { const SectionNode sn = { TimeZoneSection, i - add, countRepeat(newFormat, i, 4), 0 }; newSectionNodes.append(sn); appendSeparator(&newSeparators, newFormat, index, i - index, lastQuote); diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index 189f12fd5c..5460104fd0 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -2122,12 +2122,7 @@ static QImage convertWithPalette(const QImage &src, QImage::Format format, QImage dest(src.size(), format); dest.setColorTable(clut); - QString textsKeys = 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()); - } + QImageData::get(dest)->text = QImageData::get(src)->text; int h = src.height(); int w = src.width(); diff --git a/src/gui/image/qimage.h b/src/gui/image/qimage.h index df8d2729ef..138a52ab78 100644 --- a/src/gui/image/qimage.h +++ b/src/gui/image/qimage.h @@ -320,6 +320,7 @@ private: friend class QRasterPlatformPixmap; friend class QBlittablePlatformPixmap; friend class QPixmapCacheEntry; + friend struct QImageData; public: typedef QImageData * DataPtr; diff --git a/src/gui/image/qimage_p.h b/src/gui/image/qimage_p.h index 6f6f626858..e154ae8183 100644 --- a/src/gui/image/qimage_p.h +++ b/src/gui/image/qimage_p.h @@ -69,6 +69,9 @@ struct Q_GUI_EXPORT QImageData { // internal image data 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 *get(QImage &img) noexcept { return img.d; } + static const QImageData *get(const QImage &img) noexcept { return img.d; } + QAtomicInt ref; int width; diff --git a/src/plugins/platforms/cocoa/qcocoabackingstore.mm b/src/plugins/platforms/cocoa/qcocoabackingstore.mm index c734be09b6..97bb4e8bed 100644 --- a/src/plugins/platforms/cocoa/qcocoabackingstore.mm +++ b/src/plugins/platforms/cocoa/qcocoabackingstore.mm @@ -536,8 +536,10 @@ void QCALayerBackingStore::flush(QWindow *flushedWindow, const QRegion ®ion, flushedView.layer.contentsScale = m_buffers.back()->devicePixelRatio(); } + const bool isSingleBuffered = window()->format().swapBehavior() == QSurfaceFormat::SingleBuffer; + 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 // 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 @@ -554,7 +556,7 @@ void QCALayerBackingStore::flush(QWindow *flushedWindow, const QRegion ®ion, // with other pending view and layer updates. flushedView.window.viewsNeedDisplay = YES; - if (window()->format().swapBehavior() == QSurfaceFormat::SingleBuffer) { + if (isSingleBuffered) { // The private API [CALayer reloadValueForKeyPath:@"contents"] would be preferable, // but barring any side effects or performance issues we opt for the hammer for now. flushedView.layer.contents = nil;