diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2020-04-11 01:00:13 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2020-04-11 14:59:13 +0200 |
commit | 58a42898006f221807a08557f588a2d973a7ada2 (patch) | |
tree | 62d92617eae5df5aae666ea0902159498b285b24 /src | |
parent | 033d01bd6e2aef740ad1408a04d3ca0ae3b9ba9b (diff) | |
parent | 1ec350e35fcea87c527b36cf429b595731059240 (diff) |
Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
tests/auto/network/socket/platformsocketengine/platformsocketengine.pri
Change-Id: I22daf269a8f28f80630b5f521b91637531156404
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/io/qtemporaryfile.cpp | 6 | ||||
-rw-r--r-- | src/corelib/kernel/qmetaobjectbuilder.cpp | 12 | ||||
-rw-r--r-- | src/corelib/plugin/qfactoryloader.cpp | 3 | ||||
-rw-r--r-- | src/corelib/serialization/qcborvalue.cpp | 12 | ||||
-rw-r--r-- | src/corelib/serialization/qjsonobject.cpp | 3 | ||||
-rw-r--r-- | src/corelib/serialization/qtextstream.h | 48 | ||||
-rw-r--r-- | src/gui/gui.pro | 9 | ||||
-rw-r--r-- | src/gui/kernel/qwindowsysteminterface.cpp | 9 | ||||
-rw-r--r-- | src/plugins/platforms/minimal/qminimalintegration.cpp | 11 | ||||
-rw-r--r-- | src/plugins/platforms/minimal/qminimalintegration.h | 1 | ||||
-rw-r--r-- | src/widgets/graphicsview/qgraphicsscene.cpp | 4 | ||||
-rw-r--r-- | src/widgets/kernel/qapplication.cpp | 2 | ||||
-rw-r--r-- | src/widgets/widgets/qcombobox.cpp | 17 |
13 files changed, 85 insertions, 52 deletions
diff --git a/src/corelib/io/qtemporaryfile.cpp b/src/corelib/io/qtemporaryfile.cpp index 55d13dad70..c016a622c7 100644 --- a/src/corelib/io/qtemporaryfile.cpp +++ b/src/corelib/io/qtemporaryfile.cpp @@ -284,8 +284,10 @@ createUnnamedFile(NativeFileHandle &file, QTemporaryFileName &tfn, quint32 mode, return CreateUnnamedFileStatus::NotSupported; const char *p = "."; - int lastSlash = tfn.path.lastIndexOf('/'); - if (lastSlash != -1) { + QByteArray::size_type lastSlash = tfn.path.lastIndexOf('/'); + if (lastSlash >= 0) { + if (lastSlash == 0) + lastSlash = 1; tfn.path[lastSlash] = '\0'; p = tfn.path.data(); } diff --git a/src/corelib/kernel/qmetaobjectbuilder.cpp b/src/corelib/kernel/qmetaobjectbuilder.cpp index 6447e4ec5e..74e8af92df 100644 --- a/src/corelib/kernel/qmetaobjectbuilder.cpp +++ b/src/corelib/kernel/qmetaobjectbuilder.cpp @@ -575,6 +575,16 @@ QMetaPropertyBuilder QMetaObjectBuilder::addProperty return QMetaPropertyBuilder(this, index); } +#if QT_DEPRECATED_SINCE(5, 15) +QT_WARNING_PUSH +QT_WARNING_DISABLE_DEPRECATED +static bool deprecatedIsEditable(const QMetaProperty &prototype) +{ + return prototype.isEditable(); +} +QT_WARNING_POP +#endif + /*! Adds a new property to this class that has the same information as \a prototype. This is used to clone the properties of an existing @@ -592,7 +602,7 @@ QMetaPropertyBuilder QMetaObjectBuilder::addProperty(const QMetaProperty& protot property.setDesignable(prototype.isDesignable()); property.setScriptable(prototype.isScriptable()); property.setStored(prototype.isStored()); - property.setEditable(prototype.isEditable()); + property.setEditable(deprecatedIsEditable(prototype)); property.setUser(prototype.isUser()); property.setStdCppSet(prototype.hasStdCppSet()); property.setEnumOrFlag(prototype.isEnumType()); diff --git a/src/corelib/plugin/qfactoryloader.cpp b/src/corelib/plugin/qfactoryloader.cpp index 400c8bf05f..b03ab4349b 100644 --- a/src/corelib/plugin/qfactoryloader.cpp +++ b/src/corelib/plugin/qfactoryloader.cpp @@ -125,6 +125,8 @@ static QJsonDocument jsonFromCborMetaData(const char *raw, qsizetype size, QStri return QJsonDocument(o); } +QT_WARNING_PUSH +QT_WARNING_DISABLE_DEPRECATED QJsonDocument qJsonFromRawLibraryMetaData(const char *raw, qsizetype sectionSize, QString *errMsg) { raw += metaDataSignatureLength(); @@ -148,6 +150,7 @@ QJsonDocument qJsonFromRawLibraryMetaData(const char *raw, qsizetype sectionSize return jsonFromCborMetaData(raw, sectionSize, errMsg); } +QT_WARNING_POP class QFactoryLoaderPrivate : public QObjectPrivate { diff --git a/src/corelib/serialization/qcborvalue.cpp b/src/corelib/serialization/qcborvalue.cpp index 298ebcfd72..a3f93e5eed 100644 --- a/src/corelib/serialization/qcborvalue.cpp +++ b/src/corelib/serialization/qcborvalue.cpp @@ -956,7 +956,7 @@ QCborContainerPrivate *QCborContainerPrivate::grow(QCborContainerPrivate *d, qsi d = detach(d, index + 1); Q_ASSERT(d); int j = d->elements.size(); - while (j < index) + while (j++ < index) d->append(Undefined()); return d; } @@ -994,8 +994,12 @@ void QCborContainerPrivate::replaceAt_complex(Element &e, const QCborValue &valu e = value.container->elements.at(value.n); // Copy string data, if any - if (const ByteData *b = value.container->byteData(value.n)) - e.value = addByteData(b->byte(), b->len); + if (const ByteData *b = value.container->byteData(value.n)) { + if (this == value.container) + e.value = addByteData(b->toByteArray(), b->len); + else + e.value = addByteData(b->byte(), b->len); + } if (disp == MoveContainer) value.container->deref(); @@ -2649,7 +2653,7 @@ void QCborValueRef::assign(QCborValueRef that, QCborValue &&other) void QCborValueRef::assign(QCborValueRef that, const QCborValueRef other) { // ### optimize? - assign(that, other.concrete()); + that = other.concrete(); } QCborValue QCborValueRef::concrete(QCborValueRef self) noexcept diff --git a/src/corelib/serialization/qjsonobject.cpp b/src/corelib/serialization/qjsonobject.cpp index 1a85429c82..a03855d4a3 100644 --- a/src/corelib/serialization/qjsonobject.cpp +++ b/src/corelib/serialization/qjsonobject.cpp @@ -452,9 +452,11 @@ QJsonValueRef QJsonObject::atImpl(T key) bool keyExists = false; int index = indexOf(o, key, &keyExists); if (!keyExists) { + detach2(o->elements.length() / 2 + 1); o->insertAt(index, key); o->insertAt(index + 1, QCborValue::fromJsonValue(QJsonValue())); } + // detaching will happen if and when this QJsonValueRef is assigned to return QJsonValueRef(this, index / 2); } @@ -1469,6 +1471,7 @@ QJsonValue QJsonObject::valueAt(int i) const void QJsonObject::setValueAt(int i, const QJsonValue &val) { Q_ASSERT(o && i >= 0 && 2 * i + 1 < o->elements.length()); + detach2(); if (val.isUndefined()) { o->removeAt(2 * i + 1); o->removeAt(2 * i); diff --git a/src/corelib/serialization/qtextstream.h b/src/corelib/serialization/qtextstream.h index 0d8a9a548e..97d596137e 100644 --- a/src/corelib/serialization/qtextstream.h +++ b/src/corelib/serialization/qtextstream.h @@ -271,30 +271,30 @@ Q_CORE_EXPORT QTextStream &ws(QTextStream &s); #if QT_DEPRECATED_SINCE(5, 15) // This namespace only exists for 'using namespace' declarations. namespace QTextStreamFunctions { -Q_CORE_EXPORT QT_DEPRECATED_X("Use Qt::bin") QTextStream &bin(QTextStream &s); -Q_CORE_EXPORT QT_DEPRECATED_X("Use Qt::oct") QTextStream &oct(QTextStream &s); -Q_CORE_EXPORT QT_DEPRECATED_X("Use Qt::dec") QTextStream &dec(QTextStream &s); -Q_CORE_EXPORT QT_DEPRECATED_X("Use Qt::hex") QTextStream &hex(QTextStream &s); -Q_CORE_EXPORT QT_DEPRECATED_X("Use Qt::showbase") QTextStream &showbase(QTextStream &s); -Q_CORE_EXPORT QT_DEPRECATED_X("Use Qt::forcesign") QTextStream &forcesign(QTextStream &s); -Q_CORE_EXPORT QT_DEPRECATED_X("Use Qt::forcepoint") QTextStream &forcepoint(QTextStream &s); -Q_CORE_EXPORT QT_DEPRECATED_X("Use Qt::noshowbase") QTextStream &noshowbase(QTextStream &s); -Q_CORE_EXPORT QT_DEPRECATED_X("Use Qt::noforcesign") QTextStream &noforcesign(QTextStream &s); -Q_CORE_EXPORT QT_DEPRECATED_X("Use Qt::noforcepoint") QTextStream &noforcepoint(QTextStream &s); -Q_CORE_EXPORT QT_DEPRECATED_X("Use Qt::uppercasebase") QTextStream &uppercasebase(QTextStream &s); -Q_CORE_EXPORT QT_DEPRECATED_X("Use Qt::uppercasedigits") QTextStream &uppercasedigits(QTextStream &s); -Q_CORE_EXPORT QT_DEPRECATED_X("Use Qt::lowercasebase") QTextStream &lowercasebase(QTextStream &s); -Q_CORE_EXPORT QT_DEPRECATED_X("Use Qt::lowercasedigits") QTextStream &lowercasedigits(QTextStream &s); -Q_CORE_EXPORT QT_DEPRECATED_X("Use Qt::fixed") QTextStream &fixed(QTextStream &s); -Q_CORE_EXPORT QT_DEPRECATED_X("Use Qt::scientific") QTextStream &scientific(QTextStream &s); -Q_CORE_EXPORT QT_DEPRECATED_X("Use Qt::left") QTextStream &left(QTextStream &s); -Q_CORE_EXPORT QT_DEPRECATED_X("Use Qt::right") QTextStream &right(QTextStream &s); -Q_CORE_EXPORT QT_DEPRECATED_X("Use Qt::center") QTextStream ¢er(QTextStream &s); -Q_CORE_EXPORT QT_DEPRECATED_X("Use Qt::endl") QTextStream &endl(QTextStream &s); -Q_CORE_EXPORT QT_DEPRECATED_X("Use Qt::flush") QTextStream &flush(QTextStream &s); -Q_CORE_EXPORT QT_DEPRECATED_X("Use Qt::reset") QTextStream &reset(QTextStream &s); -Q_CORE_EXPORT QT_DEPRECATED_X("Use Qt::bom") QTextStream &bom(QTextStream &s); -Q_CORE_EXPORT QT_DEPRECATED_X("Use Qt::ws") QTextStream &ws(QTextStream &s); +Q_CORE_EXPORT QT_DEPRECATED_VERSION_X(5, 15, "Use Qt::bin") QTextStream &bin(QTextStream &s); +Q_CORE_EXPORT QT_DEPRECATED_VERSION_X(5, 15, "Use Qt::oct") QTextStream &oct(QTextStream &s); +Q_CORE_EXPORT QT_DEPRECATED_VERSION_X(5, 15, "Use Qt::dec") QTextStream &dec(QTextStream &s); +Q_CORE_EXPORT QT_DEPRECATED_VERSION_X(5, 15, "Use Qt::hex") QTextStream &hex(QTextStream &s); +Q_CORE_EXPORT QT_DEPRECATED_VERSION_X(5, 15, "Use Qt::showbase") QTextStream &showbase(QTextStream &s); +Q_CORE_EXPORT QT_DEPRECATED_VERSION_X(5, 15, "Use Qt::forcesign") QTextStream &forcesign(QTextStream &s); +Q_CORE_EXPORT QT_DEPRECATED_VERSION_X(5, 15, "Use Qt::forcepoint") QTextStream &forcepoint(QTextStream &s); +Q_CORE_EXPORT QT_DEPRECATED_VERSION_X(5, 15, "Use Qt::noshowbase") QTextStream &noshowbase(QTextStream &s); +Q_CORE_EXPORT QT_DEPRECATED_VERSION_X(5, 15, "Use Qt::noforcesign") QTextStream &noforcesign(QTextStream &s); +Q_CORE_EXPORT QT_DEPRECATED_VERSION_X(5, 15, "Use Qt::noforcepoint") QTextStream &noforcepoint(QTextStream &s); +Q_CORE_EXPORT QT_DEPRECATED_VERSION_X(5, 15, "Use Qt::uppercasebase") QTextStream &uppercasebase(QTextStream &s); +Q_CORE_EXPORT QT_DEPRECATED_VERSION_X(5, 15, "Use Qt::uppercasedigits") QTextStream &uppercasedigits(QTextStream &s); +Q_CORE_EXPORT QT_DEPRECATED_VERSION_X(5, 15, "Use Qt::lowercasebase") QTextStream &lowercasebase(QTextStream &s); +Q_CORE_EXPORT QT_DEPRECATED_VERSION_X(5, 15, "Use Qt::lowercasedigits") QTextStream &lowercasedigits(QTextStream &s); +Q_CORE_EXPORT QT_DEPRECATED_VERSION_X(5, 15, "Use Qt::fixed") QTextStream &fixed(QTextStream &s); +Q_CORE_EXPORT QT_DEPRECATED_VERSION_X(5, 15, "Use Qt::scientific") QTextStream &scientific(QTextStream &s); +Q_CORE_EXPORT QT_DEPRECATED_VERSION_X(5, 15, "Use Qt::left") QTextStream &left(QTextStream &s); +Q_CORE_EXPORT QT_DEPRECATED_VERSION_X(5, 15, "Use Qt::right") QTextStream &right(QTextStream &s); +Q_CORE_EXPORT QT_DEPRECATED_VERSION_X(5, 15, "Use Qt::center") QTextStream ¢er(QTextStream &s); +Q_CORE_EXPORT QT_DEPRECATED_VERSION_X(5, 15, "Use Qt::endl") QTextStream &endl(QTextStream &s); +Q_CORE_EXPORT QT_DEPRECATED_VERSION_X(5, 15, "Use Qt::flush") QTextStream &flush(QTextStream &s); +Q_CORE_EXPORT QT_DEPRECATED_VERSION_X(5, 15, "Use Qt::reset") QTextStream &reset(QTextStream &s); +Q_CORE_EXPORT QT_DEPRECATED_VERSION_X(5, 15, "Use Qt::bom") QTextStream &bom(QTextStream &s); +Q_CORE_EXPORT QT_DEPRECATED_VERSION_X(5, 15, "Use Qt::ws") QTextStream &ws(QTextStream &s); } // namespace QTextStreamFunctions QT_WARNING_PUSH diff --git a/src/gui/gui.pro b/src/gui/gui.pro index 350d4c5ee3..6e92283142 100644 --- a/src/gui/gui.pro +++ b/src/gui/gui.pro @@ -59,15 +59,16 @@ load(cmake_functions) win32: CMAKE_WINDOWS_BUILD = True qtConfig(angle) { + !mingw|qtConfig(debug_and_release): debug_suffix="d" CMAKE_GL_INCDIRS = $$CMAKE_INCLUDE_DIR CMAKE_ANGLE_EGL_DLL_RELEASE = libEGL.dll CMAKE_ANGLE_EGL_IMPLIB_RELEASE = libEGL.$${QMAKE_EXTENSION_STATICLIB} CMAKE_ANGLE_GLES2_DLL_RELEASE = libGLESv2.dll CMAKE_ANGLE_GLES2_IMPLIB_RELEASE = libGLESv2.$${QMAKE_EXTENSION_STATICLIB} - CMAKE_ANGLE_EGL_DLL_DEBUG = libEGLd.dll - CMAKE_ANGLE_EGL_IMPLIB_DEBUG = libEGLd.$${QMAKE_EXTENSION_STATICLIB} - CMAKE_ANGLE_GLES2_DLL_DEBUG = libGLESv2d.dll - CMAKE_ANGLE_GLES2_IMPLIB_DEBUG = libGLESv2d.$${QMAKE_EXTENSION_STATICLIB} + CMAKE_ANGLE_EGL_DLL_DEBUG = libEGL$${debug_suffix}.dll + CMAKE_ANGLE_EGL_IMPLIB_DEBUG = libEGL$${debug_suffix}.$${QMAKE_EXTENSION_STATICLIB} + CMAKE_ANGLE_GLES2_DLL_DEBUG = libGLESv2$${debug_suffix}.dll + CMAKE_ANGLE_GLES2_IMPLIB_DEBUG = libGLESv2$${debug_suffix}.$${QMAKE_EXTENSION_STATICLIB} CMAKE_QT_OPENGL_IMPLEMENTATION = GLESv2 } else { diff --git a/src/gui/kernel/qwindowsysteminterface.cpp b/src/gui/kernel/qwindowsysteminterface.cpp index e8f0892b95..5658968de4 100644 --- a/src/gui/kernel/qwindowsysteminterface.cpp +++ b/src/gui/kernel/qwindowsysteminterface.cpp @@ -687,9 +687,8 @@ QList<QTouchEvent::TouchPoint> states |= point->state; p.setState(point->state); - const QPointF screenPos = point->area.center(); - p.setScreenPos(QHighDpi::fromNativePixels(screenPos, window)); - p.setScreenRect(QHighDpi::fromNativePixels(point->area, window)); + p.setScreenPos(QHighDpi::fromNativePixels(point->area.center(), window)); + p.setEllipseDiameters(point->area.size()); // The local pos and rect are not set, they will be calculated // when the event gets processed by QGuiApplication. @@ -750,7 +749,9 @@ QList<QWindowSystemInterface::TouchPoint> p.id = pt.id(); p.flags = pt.flags(); p.normalPosition = QHighDpi::toNativeLocalPosition(pt.normalizedPos(), window); - p.area = QHighDpi::toNativePixels(pt.screenRect(), window); + QRectF area(QPointF(), pt.ellipseDiameters()); + area.moveCenter(pt.screenPos()); + p.area = QHighDpi::toNativePixels(area, window); p.pressure = pt.pressure(); p.state = pt.state(); p.velocity = QHighDpi::toNativePixels(pt.velocity(), window); diff --git a/src/plugins/platforms/minimal/qminimalintegration.cpp b/src/plugins/platforms/minimal/qminimalintegration.cpp index f457f69f11..0c2c0d0b68 100644 --- a/src/plugins/platforms/minimal/qminimalintegration.cpp +++ b/src/plugins/platforms/minimal/qminimalintegration.cpp @@ -103,17 +103,18 @@ QMinimalIntegration::QMinimalIntegration(const QStringList ¶meters) m_options |= DebugBackingStore | EnableFonts; } - QMinimalScreen *mPrimaryScreen = new QMinimalScreen(); + m_primaryScreen = new QMinimalScreen(); - mPrimaryScreen->mGeometry = QRect(0, 0, 240, 320); - mPrimaryScreen->mDepth = 32; - mPrimaryScreen->mFormat = QImage::Format_ARGB32_Premultiplied; + m_primaryScreen->mGeometry = QRect(0, 0, 240, 320); + m_primaryScreen->mDepth = 32; + m_primaryScreen->mFormat = QImage::Format_ARGB32_Premultiplied; - QWindowSystemInterface::handleScreenAdded(mPrimaryScreen); + QWindowSystemInterface::handleScreenAdded(m_primaryScreen); } QMinimalIntegration::~QMinimalIntegration() { + QWindowSystemInterface::handleScreenRemoved(m_primaryScreen); delete m_fontDatabase; } diff --git a/src/plugins/platforms/minimal/qminimalintegration.h b/src/plugins/platforms/minimal/qminimalintegration.h index ad1bec2112..f9c66e0c3e 100644 --- a/src/plugins/platforms/minimal/qminimalintegration.h +++ b/src/plugins/platforms/minimal/qminimalintegration.h @@ -88,6 +88,7 @@ public: private: mutable QPlatformFontDatabase *m_fontDatabase; + QMinimalScreen *m_primaryScreen; unsigned m_options; }; diff --git a/src/widgets/graphicsview/qgraphicsscene.cpp b/src/widgets/graphicsview/qgraphicsscene.cpp index 2ecb2c1aef..3a40452442 100644 --- a/src/widgets/graphicsview/qgraphicsscene.cpp +++ b/src/widgets/graphicsview/qgraphicsscene.cpp @@ -5915,10 +5915,6 @@ void QGraphicsScenePrivate::updateTouchPointsForItem(QGraphicsItem *item, QTouch item->d_ptr->genericMapFromSceneTransform(static_cast<const QWidget *>(touchEvent->target())); for (auto &touchPoint : touchEvent->_touchPoints) { - // Deprecated TouchPoint::setRect clobbers ellipseDiameters, restore - const QSizeF ellipseDiameters = touchPoint.ellipseDiameters(); - touchPoint.setRect(mapFromScene.map(touchPoint.sceneRect()).boundingRect()); - touchPoint.setEllipseDiameters(ellipseDiameters); touchPoint.setPos(mapFromScene.map(touchPoint.scenePos())); touchPoint.setStartPos(mapFromScene.map(touchPoint.startScenePos())); touchPoint.setLastPos(mapFromScene.map(touchPoint.lastScenePos())); diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index 029be25620..c5577e2772 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -3958,7 +3958,7 @@ bool QApplicationPrivate::updateTouchPointsForWidget(QWidget *widget, QTouchEven QTouchEvent::TouchPoint &touchPoint = touchEvent->_touchPoints[i]; // preserve the sub-pixel resolution - const QPointF screenPos = touchPoint.screenRect().center(); + const QPointF screenPos = touchPoint.screenPos(); const QPointF delta = screenPos - screenPos.toPoint(); touchPoint.d->pos = widget->mapFromGlobal(screenPos.toPoint()) + delta; diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp index a854ce2cb8..fd82384c03 100644 --- a/src/widgets/widgets/qcombobox.cpp +++ b/src/widgets/widgets/qcombobox.cpp @@ -385,6 +385,16 @@ int QComboBoxPrivate::computeWidthHint() const return tmp.width(); } +#if QT_DEPRECATED_SINCE(5, 15) +QT_WARNING_PUSH +QT_WARNING_DISABLE_DEPRECATED +static constexpr QComboBox::SizeAdjustPolicy deprecatedAdjustToMinimumContentsLength() +{ + return QComboBox::AdjustToMinimumContentsLength; +} +QT_WARNING_POP +#endif + QSize QComboBoxPrivate::recomputeSizeHint(QSize &sh) const { Q_Q(const QComboBox); @@ -412,10 +422,11 @@ QSize QComboBoxPrivate::recomputeSizeHint(QSize &sh) const } } break; - case QComboBox::AdjustToMinimumContentsLength: + case deprecatedAdjustToMinimumContentsLength(): for (int i = 0; i < count && !hasIcon; ++i) hasIcon = !q->itemIcon(i).isNull(); - default: + break; + case QComboBox::AdjustToMinimumContentsLengthWithIcon: ; } } else { @@ -1742,7 +1753,7 @@ void QComboBox::setMinimumContentsLength(int characters) d->minimumContentsLength = characters; if (d->sizeAdjustPolicy == AdjustToContents - || d->sizeAdjustPolicy == AdjustToMinimumContentsLength + || d->sizeAdjustPolicy == deprecatedAdjustToMinimumContentsLength() || d->sizeAdjustPolicy == AdjustToMinimumContentsLengthWithIcon) { d->sizeHint = QSize(); d->adjustComboBoxSize(); |