summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-07-19 01:00:40 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-07-19 01:00:41 +0200
commit8f0790dd90f3fcaefa1a74ca1ce9bce84064eb10 (patch)
treeabc028924edde03ed173c2ba16e25daca38d7acd
parent82aabafadad2010f0f20abeeb7234057e3c10e9f (diff)
parent69ef6e821287d324459336dd1292d19d272386b8 (diff)
Merge remote-tracking branch 'origin/5.13' into dev
-rw-r--r--src/corelib/io/qstandardpaths.cpp2
-rw-r--r--src/corelib/time/qdatetime.cpp34
-rw-r--r--src/corelib/tools/qvector.h2
-rw-r--r--src/gui/kernel/qopenglcontext.cpp2
-rw-r--r--src/network/socket/qhttpsocketengine.cpp2
-rw-r--r--src/plugins/platforms/cocoa/qcocoaglcontext.h2
-rw-r--r--src/plugins/platforms/cocoa/qcocoaglcontext.mm83
-rw-r--r--src/plugins/platforms/cocoa/qcocoaintegration.mm4
-rw-r--r--src/plugins/platforms/windows/qwindowsscreen.cpp31
-rw-r--r--src/widgets/widgets/qlineedit.cpp32
-rw-r--r--tests/auto/corelib/tools/qvector/tst_qvector.cpp11
-rw-r--r--tests/auto/network/access/http2/tst_http2.cpp7
12 files changed, 125 insertions, 87 deletions
diff --git a/src/corelib/io/qstandardpaths.cpp b/src/corelib/io/qstandardpaths.cpp
index dbf650d5f6..f56fef7f8e 100644
--- a/src/corelib/io/qstandardpaths.cpp
+++ b/src/corelib/io/qstandardpaths.cpp
@@ -297,7 +297,7 @@ QT_BEGIN_NAMESPACE
\li "<APPROOT>/tmp"
\row \li HomeLocation
\li "<APPROOT>/files"
- \li "<APPROOT>" (not writable)
+ \li system defined
\row \li DataLocation
\li "<APPROOT>/files", "<USER>/<APPNAME>/files"
\li "<APPROOT>/Library/Application Support"
diff --git a/src/corelib/time/qdatetime.cpp b/src/corelib/time/qdatetime.cpp
index aa8aa6b915..b2532be49d 100644
--- a/src/corelib/time/qdatetime.cpp
+++ b/src/corelib/time/qdatetime.cpp
@@ -346,11 +346,10 @@ static constexpr int daysInUsualMonth(int month) // (February isn't usual.)
setDate(). The fromString() function returns a QDate given a string and a
date format which is used to interpret the date within the string.
- The year(), month(), and day() functions provide access to the
- year, month, and day numbers. Also, dayOfWeek() and dayOfYear()
- functions are provided. The same information is provided in
- textual format by the toString(), shortDayName(), longDayName(),
- shortMonthName(), and longMonthName() functions.
+ The year(), month(), and day() functions provide access to the year, month,
+ and day numbers. Also, dayOfWeek() and dayOfYear() functions are
+ provided. The same information is provided in textual format by
+ toString(). The day and month numbers can be mapped to names using QLocal.
QDate provides a full set of operators to compare two QDate
objects where smaller means earlier, and larger means later.
@@ -1076,11 +1075,10 @@ static QString toStringIsoDate(qint64 jd)
Returns the date as a string. The \a format parameter determines
the format of the string.
- If the \a format is Qt::TextDate, the string is formatted in
- the default way. QDate::shortDayName() and QDate::shortMonthName()
- are used to generate the string, so the day and month names will
- be localized names using the system locale, i.e. QLocale::system(). An
- example of this formatting is "Sat May 20 1995".
+ If the \a format is Qt::TextDate, the string is formatted in the default
+ way. The day and month names will be localized names using the system
+ locale, i.e. QLocale::system(). An example of this formatting
+ is "Sat May 20 1995".
If the \a format is Qt::ISODate, the string format corresponds
to the ISO 8601 extended specification for representations of
@@ -1112,7 +1110,7 @@ static QString toStringIsoDate(qint64 jd)
range 0 to 9999. This restriction may apply to locale-aware
formats as well, depending on the locale settings.
- \sa fromString(), shortDayName(), shortMonthName(), QLocale::toString()
+ \sa fromString(), QLocale::toString()
*/
QString QDate::toString(Qt::DateFormat format) const
{
@@ -4064,12 +4062,10 @@ void QDateTime::setTime_t(uint secsSince1Jan1970UTC)
Returns the datetime as a string in the \a format given.
- If the \a format is Qt::TextDate, the string is formatted in
- the default way. QDate::shortDayName(), QDate::shortMonthName(),
- and QTime::toString() are used to generate the string, so the
- day and month names will be localized names using the system locale,
- i.e. QLocale::system(). An example of this formatting is
- "Wed May 20 03:40:13 1998".
+ If the \a format is Qt::TextDate, the string is formatted in the default
+ way. The day and month names will be localized names using the system
+ locale, i.e. QLocale::system(). An example of this formatting is "Wed May 20
+ 03:40:13 1998".
If the \a format is Qt::ISODate, the string format corresponds
to the ISO 8601 extended specification for representations of
@@ -5238,18 +5234,14 @@ QDateTime QDateTime::fromString(const QString &string, Qt::DateFormat format)
\row \li dd \li the day as number with a leading zero (01 to 31)
\row \li ddd
\li the abbreviated localized day name (e.g. 'Mon' to 'Sun').
- Uses QDate::shortDayName().
\row \li dddd
\li the long localized day name (e.g. 'Monday' to 'Sunday').
- Uses QDate::longDayName().
\row \li M \li the month as number without a leading zero (1-12)
\row \li MM \li the month as number with a leading zero (01-12)
\row \li MMM
\li the abbreviated localized month name (e.g. 'Jan' to 'Dec').
- Uses QDate::shortMonthName().
\row \li MMMM
\li the long localized month name (e.g. 'January' to 'December').
- Uses QDate::longMonthName().
\row \li yy \li the year as two digit number (00-99)
\row \li yyyy \li the year as four digit number
\endtable
diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h
index 65a5174abf..ebe6527d89 100644
--- a/src/corelib/tools/qvector.h
+++ b/src/corelib/tools/qvector.h
@@ -424,7 +424,7 @@ template <typename T>
void QVector<T>::resize(int asize)
{
if (asize == d->size)
- return;
+ return detach();
if (asize > int(d->alloc) || !isDetached()) { // there is not enough space
QArrayData::AllocationOptions opt = asize > int(d->alloc) ? QArrayData::Grow : QArrayData::Default;
realloc(qMax(int(d->alloc), asize), opt);
diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp
index 326d2823eb..10adee438b 100644
--- a/src/gui/kernel/qopenglcontext.cpp
+++ b/src/gui/kernel/qopenglcontext.cpp
@@ -611,8 +611,8 @@ bool QOpenGLContext::create()
d->platformGLContext = QGuiApplicationPrivate::platformIntegration()->createPlatformOpenGLContext(this);
if (!d->platformGLContext)
return false;
- d->platformGLContext->initialize();
d->platformGLContext->setContext(this);
+ d->platformGLContext->initialize();
if (!d->platformGLContext->isSharing())
d->shareContext = 0;
d->shareGroup = d->shareContext ? d->shareContext->shareGroup() : new QOpenGLContextGroup;
diff --git a/src/network/socket/qhttpsocketengine.cpp b/src/network/socket/qhttpsocketengine.cpp
index 6cae29193d..c67b273937 100644
--- a/src/network/socket/qhttpsocketengine.cpp
+++ b/src/network/socket/qhttpsocketengine.cpp
@@ -627,7 +627,7 @@ void QHttpSocketEngine::slotSocketReadNotification()
// from http spec is also allowed.
if (proxyConnectionHeader.isEmpty())
proxyConnectionHeader = d->reply->headerField("Connection");
- if (proxyConnectionHeader.compare("close", Qt::CaseSensitive) == 0) {
+ if (proxyConnectionHeader.compare("close", Qt::CaseInsensitive) == 0) {
willClose = true;
} else if (proxyConnectionHeader.compare("keep-alive", Qt::CaseInsensitive) == 0) {
willClose = false;
diff --git a/src/plugins/platforms/cocoa/qcocoaglcontext.h b/src/plugins/platforms/cocoa/qcocoaglcontext.h
index c1041ac2da..bb309c0713 100644
--- a/src/plugins/platforms/cocoa/qcocoaglcontext.h
+++ b/src/plugins/platforms/cocoa/qcocoaglcontext.h
@@ -56,6 +56,8 @@ public:
QCocoaGLContext(QOpenGLContext *context);
~QCocoaGLContext();
+ void initialize() override;
+
bool makeCurrent(QPlatformSurface *surface) override;
void swapBuffers(QPlatformSurface *surface) override;
void doneCurrent() override;
diff --git a/src/plugins/platforms/cocoa/qcocoaglcontext.mm b/src/plugins/platforms/cocoa/qcocoaglcontext.mm
index 0f8fec0548..7b124ea517 100644
--- a/src/plugins/platforms/cocoa/qcocoaglcontext.mm
+++ b/src/plugins/platforms/cocoa/qcocoaglcontext.mm
@@ -40,6 +40,8 @@
#include "qcocoaglcontext.h"
#include "qcocoawindow.h"
#include "qcocoahelpers.h"
+#include "qcocoascreen.h"
+
#include <qdebug.h>
#include <QtPlatformHeaders/qcocoanativecontext.h>
#include <dlfcn.h>
@@ -53,32 +55,19 @@ static inline QByteArray getGlString(GLenum param)
return QByteArray();
}
-@implementation NSOpenGLPixelFormat (QtHelpers)
-- (GLint)qt_getAttribute:(NSOpenGLPixelFormatAttribute)attribute
-{
- int value = 0;
- [self getValues:&value forAttribute:attribute forVirtualScreen:0];
- return value;
-}
-@end
-
-@implementation NSOpenGLContext (QtHelpers)
-- (GLint)qt_getParameter:(NSOpenGLContextParameter)parameter
-{
- int value = 0;
- [self getValues:&value forParameter:parameter];
- return value;
-}
-@end
-
QT_BEGIN_NAMESPACE
Q_LOGGING_CATEGORY(lcQpaOpenGLContext, "qt.qpa.openglcontext", QtWarningMsg);
QCocoaGLContext::QCocoaGLContext(QOpenGLContext *context)
- : QPlatformOpenGLContext(), m_format(context->format())
+ : QPlatformOpenGLContext()
+ , m_format(context->format())
+{
+}
+
+void QCocoaGLContext::initialize()
{
- QVariant nativeHandle = context->nativeHandle();
+ QVariant nativeHandle = context()->nativeHandle();
if (!nativeHandle.isNull()) {
if (!nativeHandle.canConvert<QCocoaNativeContext>()) {
qCWarning(lcQpaOpenGLContext, "QOpenGLContext native handle must be a QCocoaNativeContext");
@@ -95,7 +84,7 @@ QCocoaGLContext::QCocoaGLContext(QOpenGLContext *context)
// Note: We have no way of knowing whether the NSOpenGLContext was created with the
// share context as reported by the QOpenGLContext, but we just have to trust that
// it was. It's okey, as the only thing we're using it for is to report isShared().
- if (QPlatformOpenGLContext *shareContext = context->shareHandle())
+ if (QPlatformOpenGLContext *shareContext = context()->shareHandle())
m_shareContext = static_cast<QCocoaGLContext *>(shareContext)->nativeContext();
updateSurfaceFormat();
@@ -110,7 +99,7 @@ QCocoaGLContext::QCocoaGLContext(QOpenGLContext *context)
if (m_format.renderableType() != QSurfaceFormat::OpenGL)
return;
- if (QPlatformOpenGLContext *shareContext = context->shareHandle()) {
+ if (QPlatformOpenGLContext *shareContext = context()->shareHandle()) {
m_shareContext = static_cast<QCocoaGLContext *>(shareContext)->nativeContext();
// Allow sharing between 3.2 Core and 4.1 Core profile versions in
@@ -150,6 +139,9 @@ QCocoaGLContext::QCocoaGLContext(QOpenGLContext *context)
return;
}
+ // The native handle should reflect the underlying context, even if we created it
+ context()->setNativeHandle(QVariant::fromValue<QCocoaNativeContext>(m_context));
+
// --------------------- Set NSOpenGLContext properties ---------------------
const GLint interval = m_format.swapInterval() >= 0 ? m_format.swapInterval() : 1;
@@ -285,7 +277,32 @@ void QCocoaGLContext::updateSurfaceFormat()
NSOpenGLPixelFormat *pixelFormat = m_context.pixelFormat;
- int colorSize = [pixelFormat qt_getAttribute:NSOpenGLPFAColorSize];
+ GLint virtualScreen = [&, this]() {
+ auto *platformScreen = static_cast<QCocoaScreen*>(context()->screen()->handle());
+ auto displayId = platformScreen->nativeScreen().qt_displayId;
+ auto requestedDisplay = CGDisplayIDToOpenGLDisplayMask(displayId);
+ for (int i = 0; i < pixelFormat.numberOfVirtualScreens; ++i) {
+ GLint supportedDisplays;
+ [pixelFormat getValues:&supportedDisplays forAttribute:NSOpenGLPFAScreenMask forVirtualScreen:i];
+ // Note: The mask returned for NSOpenGLPFAScreenMask is a bit mask of
+ // physical displays that the renderer can drive, while the one returned
+ // from CGDisplayIDToOpenGLDisplayMask has a single bit set, representing
+ // that particular display.
+ if (requestedDisplay & supportedDisplays)
+ return i;
+ }
+ qCWarning(lcQpaOpenGLContext) << "Could not find virtual screen for"
+ << platformScreen << "with displayId" << displayId;
+ return 0;
+ }();
+
+ auto pixelFormatAttribute = [&](NSOpenGLPixelFormatAttribute attribute) {
+ int value = 0;
+ [pixelFormat getValues:&value forAttribute:attribute forVirtualScreen:virtualScreen];
+ return value;
+ };
+
+ int colorSize = pixelFormatAttribute(NSOpenGLPFAColorSize);
colorSize /= 4; // The attribute includes the alpha component
m_format.setRedBufferSize(colorSize);
m_format.setGreenBufferSize(colorSize);
@@ -297,22 +314,28 @@ void QCocoaGLContext::updateSurfaceFormat()
// size, as that will make the user believe the alpha channel can be used for
// something useful, when in reality it can't, due to the surface being opaque.
if (m_format.alphaBufferSize() > 0)
- m_format.setAlphaBufferSize([pixelFormat qt_getAttribute:NSOpenGLPFAAlphaSize]);
+ m_format.setAlphaBufferSize(pixelFormatAttribute(NSOpenGLPFAAlphaSize));
- m_format.setDepthBufferSize([pixelFormat qt_getAttribute:NSOpenGLPFADepthSize]);
- m_format.setStencilBufferSize([pixelFormat qt_getAttribute:NSOpenGLPFAStencilSize]);
- m_format.setSamples([pixelFormat qt_getAttribute:NSOpenGLPFASamples]);
+ m_format.setDepthBufferSize(pixelFormatAttribute(NSOpenGLPFADepthSize));
+ m_format.setStencilBufferSize(pixelFormatAttribute(NSOpenGLPFAStencilSize));
+ m_format.setSamples(pixelFormatAttribute(NSOpenGLPFASamples));
- if ([pixelFormat qt_getAttribute:NSOpenGLPFATripleBuffer])
+ if (pixelFormatAttribute(NSOpenGLPFATripleBuffer))
m_format.setSwapBehavior(QSurfaceFormat::TripleBuffer);
- else if ([pixelFormat qt_getAttribute:NSOpenGLPFADoubleBuffer])
+ else if (pixelFormatAttribute(NSOpenGLPFADoubleBuffer))
m_format.setSwapBehavior(QSurfaceFormat::DoubleBuffer);
else
m_format.setSwapBehavior(QSurfaceFormat::SingleBuffer);
// ------------------- Query the context -------------------
- m_format.setSwapInterval([m_context qt_getParameter:NSOpenGLCPSwapInterval]);
+ auto glContextParameter = [&](NSOpenGLContextParameter parameter) {
+ int value = 0;
+ [m_context getValues:&value forParameter:parameter];
+ return value;
+ };
+
+ m_format.setSwapInterval(glContextParameter(NSOpenGLCPSwapInterval));
if (oldContext)
[oldContext makeCurrentContext];
diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm
index 08e7447a75..009074a5f3 100644
--- a/src/plugins/platforms/cocoa/qcocoaintegration.mm
+++ b/src/plugins/platforms/cocoa/qcocoaintegration.mm
@@ -331,9 +331,7 @@ QPlatformOffscreenSurface *QCocoaIntegration::createPlatformOffscreenSurface(QOf
#ifndef QT_NO_OPENGL
QPlatformOpenGLContext *QCocoaIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const
{
- QCocoaGLContext *glContext = new QCocoaGLContext(context);
- context->setNativeHandle(QVariant::fromValue<QCocoaNativeContext>(glContext->nativeContext()));
- return glContext;
+ return new QCocoaGLContext(context);
}
#endif
diff --git a/src/plugins/platforms/windows/qwindowsscreen.cpp b/src/plugins/platforms/windows/qwindowsscreen.cpp
index d919d97211..282c0b107e 100644
--- a/src/plugins/platforms/windows/qwindowsscreen.cpp
+++ b/src/plugins/platforms/windows/qwindowsscreen.cpp
@@ -303,23 +303,28 @@ void QWindowsScreen::handleChanges(const QWindowsScreenData &newData)
m_data.hMonitor = newData.hMonitor;
}
- if (m_data.geometry != newData.geometry || m_data.availableGeometry != newData.availableGeometry) {
- m_data.geometry = newData.geometry;
- m_data.availableGeometry = newData.availableGeometry;
- QWindowSystemInterface::handleScreenGeometryChange(screen(),
- newData.geometry, newData.availableGeometry);
- }
- if (!qFuzzyCompare(m_data.dpi.first, newData.dpi.first)
- || !qFuzzyCompare(m_data.dpi.second, newData.dpi.second)) {
- m_data.dpi = newData.dpi;
+ // QGuiApplicationPrivate::processScreenGeometryChange() checks and emits
+ // DPI and orientation as well, so, assign new values and emit DPI first.
+ const bool geometryChanged = m_data.geometry != newData.geometry
+ || m_data.availableGeometry != newData.availableGeometry;
+ const bool dpiChanged = !qFuzzyCompare(m_data.dpi.first, newData.dpi.first)
+ || !qFuzzyCompare(m_data.dpi.second, newData.dpi.second);
+ const bool orientationChanged = m_data.orientation != newData.orientation;
+ m_data.dpi = newData.dpi;
+ m_data.orientation = newData.orientation;
+ m_data.geometry = newData.geometry;
+ m_data.availableGeometry = newData.availableGeometry;
+
+ if (dpiChanged) {
QWindowSystemInterface::handleScreenLogicalDotsPerInchChange(screen(),
newData.dpi.first,
newData.dpi.second);
}
- if (m_data.orientation != newData.orientation) {
- m_data.orientation = newData.orientation;
- QWindowSystemInterface::handleScreenOrientationChange(screen(),
- newData.orientation);
+ if (orientationChanged)
+ QWindowSystemInterface::handleScreenOrientationChange(screen(), newData.orientation);
+ if (geometryChanged) {
+ QWindowSystemInterface::handleScreenGeometryChange(screen(),
+ newData.geometry, newData.availableGeometry);
}
}
diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp
index 19389cbf83..23e2611fca 100644
--- a/src/widgets/widgets/qlineedit.cpp
+++ b/src/widgets/widgets/qlineedit.cpp
@@ -293,7 +293,7 @@ QLineEdit::~QLineEdit()
/*!
\property QLineEdit::text
- \brief the line edit's text
+ \brief the line edit's text.
Setting this property clears the selection, clears the undo/redo
history, moves the cursor to the end of the line and resets the
@@ -322,7 +322,7 @@ void QLineEdit::setText(const QString& text)
\since 4.7
\property QLineEdit::placeholderText
- \brief the line edit's placeholder text
+ \brief the line edit's placeholder text.
Setting this property makes the line edit display a grayed-out
placeholder text as long as the line edit is empty.
@@ -354,7 +354,7 @@ void QLineEdit::setPlaceholderText(const QString& placeholderText)
/*!
\property QLineEdit::displayText
- \brief the displayed text
+ \brief the displayed text.
If \l echoMode is \l Normal this returns the same as text(); if
\l EchoMode is \l Password or \l PasswordEchoOnEdit it returns a string of
@@ -375,7 +375,7 @@ QString QLineEdit::displayText() const
/*!
\property QLineEdit::maxLength
- \brief the maximum permitted length of the text
+ \brief the maximum permitted length of the text.
If the text is too long, it is truncated at the limit.
@@ -405,7 +405,7 @@ void QLineEdit::setMaxLength(int maxLength)
/*!
\property QLineEdit::frame
- \brief whether the line edit draws itself with a frame
+ \brief whether the line edit draws itself with a frame.
If enabled (the default) the line edit draws itself inside a
frame, otherwise the line edit draws itself without any frame.
@@ -544,7 +544,7 @@ void QLineEdit::setFrame(bool enable)
/*!
\property QLineEdit::echoMode
- \brief the line edit's echo mode
+ \brief the line edit's echo mode.
The echo mode determines how the text entered in the line edit is
displayed (or echoed) to the user.
@@ -723,7 +723,7 @@ QSize QLineEdit::minimumSizeHint() const
/*!
\property QLineEdit::cursorPosition
- \brief the current cursor position for this line edit
+ \brief the current cursor position for this line edit.
Setting the cursor position causes a repaint when appropriate.
@@ -756,7 +756,7 @@ int QLineEdit::cursorPositionAt(const QPoint &pos)
/*!
\property QLineEdit::alignment
- \brief the alignment of the line edit
+ \brief the alignment of the line edit.
Both horizontal and vertical alignment is allowed here, Qt::AlignJustify
will map to Qt::AlignLeft.
@@ -894,7 +894,7 @@ void QLineEdit::end(bool mark)
/*!
\property QLineEdit::modified
- \brief whether the line edit's contents has been modified by the user
+ \brief whether the line edit's contents has been modified by the user.
The modified flag is never read by QLineEdit; it has a default value
of false and is changed to true whenever the user changes the line
@@ -924,7 +924,7 @@ void QLineEdit::setModified(bool modified)
/*!
\property QLineEdit::hasSelectedText
- \brief whether there is any text selected
+ \brief whether there is any text selected.
hasSelectedText() returns \c true if some or all of the text has been
selected by the user; otherwise returns \c false.
@@ -943,7 +943,7 @@ bool QLineEdit::hasSelectedText() const
/*!
\property QLineEdit::selectedText
- \brief the selected text
+ \brief the selected text.
If there is no selected text this property's value is
an empty string.
@@ -1030,7 +1030,7 @@ void QLineEdit::setSelection(int start, int length)
/*!
\property QLineEdit::undoAvailable
- \brief whether undo is available
+ \brief whether undo is available.
Undo becomes available once the user has modified the text in the line edit.
@@ -1045,7 +1045,7 @@ bool QLineEdit::isUndoAvailable() const
/*!
\property QLineEdit::redoAvailable
- \brief whether redo is available
+ \brief whether redo is available.
Redo becomes available once the user has performed one or more undo operations
on text in the line edit.
@@ -1062,7 +1062,7 @@ bool QLineEdit::isRedoAvailable() const
/*!
\property QLineEdit::dragEnabled
\brief whether the lineedit starts a drag if the user presses and
- moves the mouse on some selected text
+ moves the mouse on some selected text.
Dragging is disabled by default.
*/
@@ -1081,7 +1081,7 @@ void QLineEdit::setDragEnabled(bool b)
/*!
\property QLineEdit::cursorMoveStyle
- \brief the movement style of cursor in this line edit
+ \brief the movement style of cursor in this line edit.
\since 4.8
When this property is set to Qt::VisualMoveStyle, the line edit will use visual
@@ -1184,7 +1184,7 @@ QMargins QLineEdit::textMargins() const
/*!
\property QLineEdit::inputMask
- \brief The validation input mask
+ \brief The validation input mask.
If no mask is set, inputMask() returns an empty string.
diff --git a/tests/auto/corelib/tools/qvector/tst_qvector.cpp b/tests/auto/corelib/tools/qvector/tst_qvector.cpp
index 3256130472..05b5579d64 100644
--- a/tests/auto/corelib/tools/qvector/tst_qvector.cpp
+++ b/tests/auto/corelib/tools/qvector/tst_qvector.cpp
@@ -253,6 +253,7 @@ private slots:
void fillInt() const;
void fillMovable() const;
void fillCustom() const;
+ void fillDetaches() const;
void first() const;
void fromListInt() const;
void fromListMovable() const;
@@ -1310,6 +1311,16 @@ void tst_QVector::fillCustom() const
QCOMPARE(instancesCount, Custom::counter.loadAcquire());
}
+void tst_QVector::fillDetaches() const
+{
+ QVector<int> test = { 1, 2, 3 };
+ QVector<int> copy = test;
+ copy.fill(42);
+
+ QCOMPARE(test, QVector<int>({1, 2, 3}));
+ QCOMPARE(copy, QVector<int>({42, 42, 42}));
+}
+
void tst_QVector::first() const
{
QVector<int> myvec;
diff --git a/tests/auto/network/access/http2/tst_http2.cpp b/tests/auto/network/access/http2/tst_http2.cpp
index e24370fc87..95fee23fe3 100644
--- a/tests/auto/network/access/http2/tst_http2.cpp
+++ b/tests/auto/network/access/http2/tst_http2.cpp
@@ -71,6 +71,8 @@ class tst_Http2 : public QObject
public:
tst_Http2();
~tst_Http2();
+public slots:
+ void init();
private slots:
// Tests:
void singleRequest_data();
@@ -174,6 +176,11 @@ tst_Http2::~tst_Http2()
}
}
+void tst_Http2::init()
+{
+ manager.clearConnectionCache();
+}
+
void tst_Http2::singleRequest_data()
{
QTest::addColumn<QNetworkRequest::Attribute>("h2Attribute");