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

Change-Id: I2f6e1c0f649c5098723b776c774a8a689bb60582
bb10
Qt Forward Merge Bot 2018-09-06 01:00:33 +02:00
commit e5d0289413
28 changed files with 127 additions and 50 deletions

View File

@ -844,7 +844,7 @@
},
"precompile_header": {
"label": "Using precompiled headers",
"condition": "config.msvc || tests.precompile_header",
"condition": "tests.precompile_header",
"output": [
"privateConfig",
{ "type": "varRemove", "negative": true, "name": "CONFIG", "value": "'precompile_header'" }

View File

@ -604,6 +604,9 @@ defineTest(qtConfOutput_prepareOptions) {
target_arch = armeabi-v7a
platform = $$eval(config.input.android-ndk-platform)
isEmpty(platform): equals(target_arch, arm64-v8a): \
platform = android-21
isEmpty(platform): \
platform = android-16 ### the windows configure disagrees ...

View File

@ -111,7 +111,7 @@ load(qt_common)
load(resolve_target)
TARGETPATHBASE = $$replace(TARGETPATH, \\.\\d+\$, )
qmltypes.target = qmltypes
qmltypes.commands = $$QMLPLUGINDUMP -nonrelocatable $$replace(TARGETPATHBASE, /, .) $$IMPORT_VERSION > $$QMLTYPEFILE
qmltypes.commands = $$QMLPLUGINDUMP -nonrelocatable $$QMAKE_QMLPLUGINDUMP_FLAGS $$replace(TARGETPATHBASE, /, .) $$IMPORT_VERSION > $$QMLTYPEFILE
qmltypes.depends = $$QMAKE_RESOLVED_TARGET
} else {
qmltypes.CONFIG += recursive

View File

@ -43,7 +43,6 @@
#include <qdebug.h>
#include <qdatetime.h>
#include <qpair.h>
#include <qregularexpression.h>
#include <qstringlist.h>
#include <private/qabstractitemmodel_p.h>
#include <private/qabstractproxymodel_p.h>

View File

@ -42,7 +42,10 @@
#include <QtCore/qabstractproxymodel.h>
#include <QtCore/qregexp.h>
#include <QtCore/qregularexpression.h>
#if QT_CONFIG(regularexpression)
# include <QtCore/qregularexpression.h>
#endif
QT_REQUIRE_CONFIG(sortfilterproxymodel);
@ -87,8 +90,10 @@ public:
QRegExp filterRegExp() const;
void setFilterRegExp(const QRegExp &regExp);
#if QT_CONFIG(regularexpression)
QRegularExpression filterRegularExpression() const;
void setFilterRegularExpression(const QRegularExpression &regularExpression);
#endif
int filterKeyColumn() const;
void setFilterKeyColumn(int column);

View File

@ -571,7 +571,7 @@ void QTimer::singleShot(int msec, Qt::TimerType timerType, const QObject *receiv
*/
/*!
\fn template<typename Functor> QMetaObject::Connection connectTo(Functor functor, Qt::ConnectionType connectionType = Qt::AutoConnection)
\fn template<typename Functor> QMetaObject::Connection callOnTimeout(Functor functor, Qt::ConnectionType connectionType = Qt::AutoConnection)
\since 5.12
\overload
@ -585,9 +585,9 @@ void QTimer::singleShot(int msec, Qt::TimerType timerType, const QObject *receiv
*/
/*!
\fn template<typename Functor> QMetaObject::Connection connectTo(QObject *context, Functor functor, Qt::ConnectionType connectionType = Qt::AutoConnection)
\fn template<typename Functor> QMetaObject::Connection callOnTimeout(QObject *context, Functor functor, Qt::ConnectionType connectionType = Qt::AutoConnection)
\since 5.12
\overload connectTo()
\overload callOnTimeout()
Creates a connection from the timeout() signal to \a functor to be placed in a specific
event loop of \a context, and returns a handle to the connection.
@ -599,9 +599,9 @@ void QTimer::singleShot(int msec, Qt::TimerType timerType, const QObject *receiv
*/
/*!
\fn template<typename PointerToMemberFunction> QMetaObject::Connection connectTo(QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType connectionType = Qt::AutoConnection)
\fn template<typename PointerToMemberFunction> QMetaObject::Connection callOnTimeout(QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType connectionType = Qt::AutoConnection)
\since 5.12
\overload connectTo()
\overload callOnTimeout()
Creates a connection from the timeout() signal to the \a method in the \a receiver object. Returns
a handle to the connection.

View File

@ -97,11 +97,11 @@ public:
template<typename Functor, int>
static void singleShot(int msec, Qt::TimerType timerType, const QObject *context, Functor functor);
template <typename Functor>
QMetaObject::Connection connectTo(Functor slot, Qt::ConnectionType connectionType = Qt::AutoConnection);
QMetaObject::Connection callOnTimeout(Functor slot, Qt::ConnectionType connectionType = Qt::AutoConnection);
template <typename Functor>
QMetaObject::Connection connectTo(const QObject *context, Functor slot, Qt::ConnectionType connectionType = Qt::AutoConnection);
QMetaObject::Connection callOnTimeout(const QObject *context, Functor slot, Qt::ConnectionType connectionType = Qt::AutoConnection);
template <typename PointerToMemberFunction>
QMetaObject::Connection connectTo(const QObject *receiver, PointerToMemberFunction slot, Qt::ConnectionType connectionType = Qt::AutoConnection);
QMetaObject::Connection callOnTimeout(const QObject *receiver, PointerToMemberFunction slot, Qt::ConnectionType connectionType = Qt::AutoConnection);
#else
// singleShot to a QObject slot
template <typename Duration, typename Func1>
@ -160,7 +160,7 @@ public:
}
template <typename ... Args>
QMetaObject::Connection connectTo(Args && ...args)
QMetaObject::Connection callOnTimeout(Args && ...args)
{
return QObject::connect(this, &QTimer::timeout, std::forward<Args>(args)... );
}

View File

@ -157,7 +157,7 @@ bool QLibraryPrivate::load_sys()
// Do not unload the library during dlclose(). Consequently, the
// library's specific static variables are not reinitialized if the
// library is reloaded with dlopen() at a later time.
#ifdef RTLD_NODELETE
#if defined(RTLD_NODELETE) && !defined(Q_OS_ANDROID)
if (loadHints & QLibrary::PreventUnloadHint) {
dlFlags |= RTLD_NODELETE;
}

View File

@ -432,7 +432,7 @@ int qstricmp(const char *str1, const char *str2)
return int(Incomplete);
};
#ifdef __SSE4_1__
#if defined(__SSE4_1__) && !(defined(__SANITIZE_ADDRESS__) || QT_HAS_FEATURE(address_sanitizer))
enum { PageSize = 4096, PageMask = PageSize - 1 };
const __m128i zero = _mm_setzero_si128();
forever {

View File

@ -6225,7 +6225,17 @@ QString& QString::fill(QChar ch, int size)
sensitivity setting \a cs.
*/
/*!
\fn int QString::compare(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
\since 5.12
\overload compare()
Performs a comparison of this with \a s, using the case
sensitivity setting \a cs.
*/
#if QT_STRINGVIEW_LEVEL < 2
/*!
\overload compare()
\since 4.2
@ -6241,6 +6251,7 @@ int QString::compare(const QString &other, Qt::CaseSensitivity cs) const Q_DECL_
{
return qt_compare_strings(*this, other, cs);
}
#endif
/*!
\internal
@ -6267,6 +6278,7 @@ int QString::compare(QLatin1String other, Qt::CaseSensitivity cs) const Q_DECL_N
return qt_compare_strings(*this, other, cs);
}
#if QT_STRINGVIEW_LEVEL < 2
/*!
\fn int QString::compare(const QStringRef &ref, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
\overload compare()
@ -6275,6 +6287,7 @@ int QString::compare(QLatin1String other, Qt::CaseSensitivity cs) const Q_DECL_N
an integer less than, equal to, or greater than zero if the string
is less than, equal to, or greater than \a ref.
*/
#endif
/*!
\internal

View File

@ -608,8 +608,12 @@ public:
QString &setUnicode(const QChar *unicode, int size);
inline QString &setUtf16(const ushort *utf16, int size);
#if QT_STRINGVIEW_LEVEL < 2
int compare(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW;
inline int compare(const QStringRef &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW;
#endif
int compare(QLatin1String other, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW;
inline int compare(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW;
static inline int compare(const QString &s1, const QString &s2,
Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW
@ -622,7 +626,6 @@ public:
Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW
{ return -s2.compare(s1, cs); }
inline int compare(const QStringRef &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW;
static int compare(const QString &s1, const QStringRef &s2,
Qt::CaseSensitivity = Qt::CaseSensitive) Q_DECL_NOTHROW;
@ -1636,8 +1639,12 @@ inline bool operator> (const QStringRef &lhs, const QString &rhs) Q_DECL_NOTHROW
inline bool operator<=(const QStringRef &lhs, const QString &rhs) Q_DECL_NOTHROW { return rhs >= lhs; }
inline bool operator>=(const QStringRef &lhs, const QString &rhs) Q_DECL_NOTHROW { return rhs <= lhs; }
#if QT_STRINGVIEW_LEVEL < 2
inline int QString::compare(const QStringRef &s, Qt::CaseSensitivity cs) const Q_DECL_NOTHROW
{ return QString::compare_helper(constData(), length(), s.constData(), s.length(), cs); }
#endif
inline int QString::compare(QStringView s, Qt::CaseSensitivity cs) const Q_DECL_NOTHROW
{ return -s.compare(*this, cs); }
inline int QString::compare(const QString &s1, const QStringRef &s2, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
{ return QString::compare_helper(s1.constData(), s1.length(), s2.constData(), s2.length(), cs); }
inline int QStringRef::compare(const QString &s, Qt::CaseSensitivity cs) const Q_DECL_NOTHROW

View File

@ -323,6 +323,7 @@ static bool stringList_contains(const QStringList &stringList, const T &str, Qt:
}
#if QT_STRINGVIEW_LEVEL < 2
/*!
\fn bool QStringList::contains(const QString &str, Qt::CaseSensitivity cs) const
@ -332,7 +333,18 @@ static bool stringList_contains(const QStringList &stringList, const T &str, Qt:
\sa indexOf(), lastIndexOf(), QString::contains()
*/
bool QtPrivate::QStringList_contains(const QStringList *that, const QString &str,
#endif
/*!
\fn bool QStringList::contains(QStringView str, Qt::CaseSensitivity cs) const
\overload
\since 5.12
Returns \c true if the list contains the string \a str; otherwise
returns \c false. The search is case insensitive if \a cs is
Qt::CaseInsensitive; the search is case sensitive by default.
*/
bool QtPrivate::QStringList_contains(const QStringList *that, QStringView str,
Qt::CaseSensitivity cs)
{
return stringList_contains(*that, str, cs);

View File

@ -117,8 +117,11 @@ public:
{ QList<QString>::operator=(std::move(other)); return *this; }
#endif
#if QT_STRINGVIEW_LEVEL < 2
inline bool contains(const QString &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
#endif
inline bool contains(QLatin1String str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
inline bool contains(QStringView str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
inline QStringList operator+(const QStringList &other) const
{ QStringList n = *this; n += other; return n; }
@ -161,7 +164,7 @@ namespace QtPrivate {
QStringList Q_CORE_EXPORT QStringList_filter(const QStringList *that, const QString &str,
Qt::CaseSensitivity cs);
bool Q_CORE_EXPORT QStringList_contains(const QStringList *that, const QString &str, Qt::CaseSensitivity cs);
bool Q_CORE_EXPORT QStringList_contains(const QStringList *that, QStringView str, Qt::CaseSensitivity cs);
bool Q_CORE_EXPORT QStringList_contains(const QStringList *that, QLatin1String str, Qt::CaseSensitivity cs);
void Q_CORE_EXPORT QStringList_replaceInStrings(QStringList *that, const QString &before, const QString &after,
Qt::CaseSensitivity cs);
@ -213,16 +216,23 @@ inline QStringList QListSpecialMethods<QString>::filter(const QString &str, Qt::
return QtPrivate::QStringList_filter(self(), str, cs);
}
#if QT_STRINGVIEW_LEVEL < 2
inline bool QStringList::contains(const QString &str, Qt::CaseSensitivity cs) const
{
return QtPrivate::QStringList_contains(this, str, cs);
}
#endif
inline bool QStringList::contains(QLatin1String str, Qt::CaseSensitivity cs) const
{
return QtPrivate::QStringList_contains(this, str, cs);
}
inline bool QStringList::contains(QStringView str, Qt::CaseSensitivity cs) const
{
return QtPrivate::QStringList_contains(this, str, cs);
}
inline QStringList &QListSpecialMethods<QString>::replaceInStrings(const QString &before, const QString &after, Qt::CaseSensitivity cs)
{
QtPrivate::QStringList_replaceInStrings(self(), before, after, cs);

View File

@ -245,7 +245,7 @@ void setup_qt(QImage& image, png_structp png_ptr, png_infop info_ptr, QSize scal
png_set_interlace_handling(png_ptr);
if (color_type == PNG_COLOR_TYPE_GRAY) {
// Black & White or 8-bit grayscale
// Black & White or grayscale
if (bit_depth == 1 && png_get_channels(png_ptr, info_ptr) == 1) {
png_set_invert_mono(png_ptr);
png_read_update_info(png_ptr, info_ptr);
@ -266,19 +266,22 @@ void setup_qt(QImage& image, png_structp png_ptr, png_infop info_ptr, QSize scal
else if (g == 1)
image.setColor(0, qRgba(255, 255, 255, 0));
}
} else if (bit_depth == 16 && png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) {
png_set_expand(png_ptr);
png_set_strip_16(png_ptr);
} else if (bit_depth == 16) {
bool hasMask = png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS);
if (!hasMask)
png_set_filler(png_ptr, 0xffff, PNG_FILLER_AFTER);
else
png_set_expand(png_ptr);
png_set_gray_to_rgb(png_ptr);
if (image.size() != QSize(width, height) || image.format() != QImage::Format_ARGB32) {
image = QImage(width, height, QImage::Format_ARGB32);
QImage::Format format = hasMask ? QImage::Format_RGBA64 : QImage::Format_RGBX64;
if (image.size() != QSize(width, height) || image.format() != format) {
image = QImage(width, height, format);
if (image.isNull())
return;
}
if (QSysInfo::ByteOrder == QSysInfo::BigEndian)
png_set_swap_alpha(png_ptr);
png_read_update_info(png_ptr, info_ptr);
if (QSysInfo::ByteOrder == QSysInfo::LittleEndian)
png_set_swap(png_ptr);
} else if (bit_depth == 8 && !png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) {
png_set_expand(png_ptr);
if (image.size() != QSize(width, height) || image.format() != QImage::Format_Grayscale8) {
@ -289,9 +292,7 @@ void setup_qt(QImage& image, png_structp png_ptr, png_infop info_ptr, QSize scal
png_read_update_info(png_ptr, info_ptr);
} else {
if (bit_depth == 16)
png_set_strip_16(png_ptr);
else if (bit_depth < 8)
if (bit_depth < 8)
png_set_packing(png_ptr);
int ncols = bit_depth < 8 ? 1 << bit_depth : 256;
png_read_update_info(png_ptr, info_ptr);
@ -356,12 +357,14 @@ void setup_qt(QImage& image, png_structp png_ptr, png_infop info_ptr, QSize scal
if (QSysInfo::ByteOrder == QSysInfo::LittleEndian) {
png_set_bgr(png_ptr);
}
} else if (bit_depth == 16 && (color_type & PNG_COLOR_MASK_COLOR)) {
} else if (bit_depth == 16 && !(color_type & PNG_COLOR_MASK_PALETTE)) {
QImage::Format format = QImage::Format_RGBA64;
if (!(color_type & PNG_COLOR_MASK_ALPHA) && !png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) {
png_set_filler(png_ptr, 0xffff, PNG_FILLER_AFTER);
format = QImage::Format_RGBX64;
}
if (!(color_type & PNG_COLOR_MASK_COLOR))
png_set_gray_to_rgb(png_ptr);
if (image.size() != QSize(width, height) || image.format() != format) {
image = QImage(width, height, format);
if (image.isNull())
@ -680,11 +683,11 @@ QImage::Format QPngHandlerPrivate::readImageFormat()
int num_palette;
png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, 0, 0, 0);
if (color_type == PNG_COLOR_TYPE_GRAY) {
// Black & White or 8-bit grayscale
// Black & White or grayscale
if (bit_depth == 1 && png_get_channels(png_ptr, info_ptr) == 1) {
format = QImage::Format_Mono;
} else if (bit_depth == 16 && png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) {
format = QImage::Format_ARGB32;
} else if (bit_depth == 16) {
format = png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS) ? QImage::Format_RGBA64 : QImage::Format_RGBX64;
} else if (bit_depth == 8 && !png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) {
format = QImage::Format_Grayscale8;
} else {
@ -696,7 +699,7 @@ QImage::Format QPngHandlerPrivate::readImageFormat()
{
// 1-bit and 8-bit color
format = bit_depth == 1 ? QImage::Format_Mono : QImage::Format_Indexed8;
} else if (bit_depth == 16 && (color_type & PNG_COLOR_MASK_COLOR)) {
} else if (bit_depth == 16 && !(color_type & PNG_COLOR_MASK_PALETTE)) {
format = QImage::Format_RGBA64;
if (!(color_type & PNG_COLOR_MASK_ALPHA) && !png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS))
format = QImage::Format_RGBX64;

View File

@ -210,7 +210,7 @@ void QWindowsPrintDevice::loadPageSizes() const
&& DeviceCapabilities((LPWSTR)m_id.utf16(), NULL, DC_PAPERS, NULL, NULL) == paperCount) {
QScopedArrayPointer<wchar_t> paperNames(new wchar_t[paperCount*64]);
QScopedArrayPointer<POINT> winSizes(new POINT[paperCount*sizeof(POINT)]);
QScopedArrayPointer<POINT> winSizes(new POINT[paperCount]);
QScopedArrayPointer<wchar_t> papers(new wchar_t[paperCount]);
// Get the details and match the default paper size
@ -356,7 +356,7 @@ void QWindowsPrintDevice::loadInputSlots() const
if (int(binCount) > 0
&& DeviceCapabilities(printerId, nullptr, DC_BINNAMES, nullptr, nullptr) == binCount) {
QScopedArrayPointer<WORD> bins(new WORD[binCount*sizeof(WORD)]);
QScopedArrayPointer<WORD> bins(new WORD[binCount]);
QScopedArrayPointer<wchar_t> binNames(new wchar_t[binCount*24]);
// Get the details and match the default paper size

View File

@ -565,6 +565,10 @@ bool QSqlTableModel::isDirty(const QModelIndex &index) const
Returns \c true if the value could be set or false on error, for
example if \a index is out of bounds.
Returns \c false if the role is not Qt::EditRole. To set data
for roles other than EditRole, either use a custom proxy model
or subclass QSqlTableModel.
\sa editStrategy(), data(), submit(), submitAll(), revertRow()
*/
bool QSqlTableModel::setData(const QModelIndex &index, const QVariant &value, int role)

View File

@ -62,7 +62,7 @@ static const char docTypeHeader[] =
#define PROGRAMNAME "qdbuscpp2xml"
#define PROGRAMVERSION "0.2"
#define PROGRAMCOPYRIGHT "Copyright (C) 2017 The Qt Company Ltd."
#define PROGRAMCOPYRIGHT "Copyright (C) 2018 The Qt Company Ltd."
static QString outputFile;
static int flags;

View File

@ -46,7 +46,7 @@
#define PROGRAMNAME "qdbusxml2cpp"
#define PROGRAMVERSION "0.8"
#define PROGRAMCOPYRIGHT "Copyright (C) 2017 The Qt Company Ltd."
#define PROGRAMCOPYRIGHT "Copyright (C) 2018 The Qt Company Ltd."
#define ANNOTATION_NO_WAIT "org.freedesktop.DBus.Method.NoReply"

View File

@ -845,12 +845,14 @@ void QWindowsStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt,
#endif // QT_CONFIG(itemviews)
if (!(opt->state & State_Off)) {
QPointF points[6];
points[0] = { opt->rect.x() + QStyleHelper::dpiScaled(3.5), opt->rect.y() + QStyleHelper::dpiScaled(5.5) };
points[1] = { points[0].x(), points[0].y() + QStyleHelper::dpiScaled(2) };
points[2] = { points[1].x() + QStyleHelper::dpiScaled(2), points[1].y() + QStyleHelper::dpiScaled(2) };
points[3] = { points[2].x() + QStyleHelper::dpiScaled(4), points[2].y() - QStyleHelper::dpiScaled(4) };
points[4] = { points[3].x(), points[3].y() - QStyleHelper::dpiScaled(2) };
points[5] = { points[4].x() - QStyleHelper::dpiScaled(4), points[4].y() + QStyleHelper::dpiScaled(4) };
qreal scaleh = opt->rect.width() / 12.0;
qreal scalev = opt->rect.height() / 12.0;
points[0] = { opt->rect.x() + 3.5 * scaleh, opt->rect.y() + 5.5 * scalev };
points[1] = { points[0].x(), points[0].y() + 2 * scalev };
points[2] = { points[1].x() + 2 * scaleh, points[1].y() + 2 * scalev };
points[3] = { points[2].x() + 4 * scaleh, points[2].y() - 4 * scalev };
points[4] = { points[3].x(), points[3].y() - 2 * scalev };
points[5] = { points[4].x() - 4 * scaleh, points[4].y() + 4 * scalev };
p->setPen(QPen(opt->palette.text().color(), 0));
p->setBrush(opt->palette.text().color());
p->drawPolygon(points, 6);

View File

@ -75,7 +75,7 @@ private slots:
void dontBlockEvents();
void postedEventsShouldNotStarveTimers();
void connectTo();
void callOnTimeout();
};
void tst_QTimer::zeroTimer()
@ -979,7 +979,7 @@ void tst_QTimer::crossThreadSingleShotToFunctor()
delete o;
}
void tst_QTimer::connectTo()
void tst_QTimer::callOnTimeout()
{
QTimer timer;
QSignalSpy timeoutSpy(&timer, &QTimer::timeout);
@ -989,9 +989,9 @@ void tst_QTimer::connectTo()
auto context = new QObject();
int count = 0;
timer.connectTo([&count] { count++; });
QMetaObject::Connection connection = timer.connectTo(context, [&count] { count++; });
timer.connectTo(&timer, &QTimer::stop);
timer.callOnTimeout([&count] { count++; });
QMetaObject::Connection connection = timer.callOnTimeout(context, [&count] { count++; });
timer.callOnTimeout(&timer, &QTimer::stop);
QTest::qWait(100);

View File

@ -6238,11 +6238,14 @@ void tst_QString::compare()
QStringRef r1(&s1, 0, s1.length());
QStringRef r2(&s2, 0, s2.length());
const QStringView v2(s2);
QCOMPARE(sign(QString::compare(s1, s2)), csr);
QCOMPARE(sign(QStringRef::compare(r1, r2)), csr);
QCOMPARE(sign(s1.compare(s2)), csr);
QCOMPARE(sign(s1.compare(r2)), csr);
QCOMPARE(sign(r1.compare(r2)), csr);
QCOMPARE(sign(s1.compare(v2)), csr);
QCOMPARE(sign(s1.compare(s2, Qt::CaseSensitive)), csr);
QCOMPARE(sign(s1.compare(s2, Qt::CaseInsensitive)), cir);
@ -6250,6 +6253,8 @@ void tst_QString::compare()
QCOMPARE(sign(s1.compare(r2, Qt::CaseInsensitive)), cir);
QCOMPARE(sign(r1.compare(r2, Qt::CaseSensitive)), csr);
QCOMPARE(sign(r1.compare(r2, Qt::CaseInsensitive)), cir);
QCOMPARE(sign(s1.compare(v2, Qt::CaseSensitive)), csr);
QCOMPARE(sign(s1.compare(v2, Qt::CaseInsensitive)), cir);
QCOMPARE(sign(QString::compare(s1, s2, Qt::CaseSensitive)), csr);
QCOMPARE(sign(QString::compare(s1, s2, Qt::CaseInsensitive)), cir);

View File

@ -273,6 +273,15 @@ void tst_QStringList::contains()
QVERIFY(list.contains(QLatin1String("ARTHUR"), Qt::CaseInsensitive));
QVERIFY(list.contains(QLatin1String("dent"), Qt::CaseInsensitive));
QVERIFY(!list.contains(QLatin1String("hans"), Qt::CaseInsensitive));
QVERIFY(list.contains(QStringView(QString("arthur"))));
QVERIFY(!list.contains(QStringView(QString("ArthuR"))));
QVERIFY(!list.contains(QStringView(QString("Hans"))));
QVERIFY(list.contains(QStringView(QString("arthur")), Qt::CaseInsensitive));
QVERIFY(list.contains(QStringView(QString("ArthuR")), Qt::CaseInsensitive));
QVERIFY(list.contains(QStringView(QString("ARTHUR")), Qt::CaseInsensitive));
QVERIFY(list.contains(QStringView(QString("dent")), Qt::CaseInsensitive));
QVERIFY(!list.contains(QStringView(QString("hans")), Qt::CaseInsensitive));
}
void tst_QStringList::removeDuplicates_data()

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 302 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -525,6 +525,11 @@ void tst_QImageReader::imageFormat_data()
QTest::newRow("png") << QString("kollada.png") << QByteArray("png") << QImage::Format_ARGB32;
QTest::newRow("png-2") << QString("YCbCr_cmyk.png") << QByteArray("png") << QImage::Format_RGB32;
QTest::newRow("png-3") << QString("kollada-16bpc.png") << QByteArray("png") << QImage::Format_RGBA64;
QTest::newRow("png-4") << QString("basn0g16.png") << QByteArray("png") << QImage::Format_RGBX64; // Grayscale16
QTest::newRow("png-5") << QString("basn2c16.png") << QByteArray("png") << QImage::Format_RGBX64;
QTest::newRow("png-6") << QString("basn4a16.png") << QByteArray("png") << QImage::Format_RGBA64; // Grayscale16Alpha16
QTest::newRow("png-7") << QString("basn6a16.png") << QByteArray("png") << QImage::Format_RGBA64;
QTest::newRow("png-8") << QString("tbwn0g16.png") << QByteArray("png") << QImage::Format_RGBA64; // Grayscale16+tRNS
QTest::newRow("svg") << QString("rect.svg") << QByteArray("svg") << QImage::Format_ARGB32_Premultiplied;
QTest::newRow("svgz") << QString("rect.svgz") << QByteArray("svgz") << QImage::Format_ARGB32_Premultiplied;
}