From 443ef0010ae68ac5a883fb9ab7677d9de719e70e Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Fri, 29 Nov 2019 10:50:24 +0100 Subject: rhi: Remove unused compat functions These were kept around to keep Qt Quick compiling, but the migration there has been done a long time ago. Remove these leftovers now. Change-Id: Ibd47381b410b11b5475a85c7ed3cb05c22f7adbb Reviewed-by: Paul Olav Tvete --- src/gui/rhi/qrhi_p.h | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'src/gui') diff --git a/src/gui/rhi/qrhi_p.h b/src/gui/rhi/qrhi_p.h index 907924c788..588347d111 100644 --- a/src/gui/rhi/qrhi_p.h +++ b/src/gui/rhi/qrhi_p.h @@ -246,10 +246,6 @@ public: m_bindings.clear(); std::copy(first, last, std::back_inserter(m_bindings)); } - void setBindings(const QVector &bindings) // compat., to be removed - { - setBindings(bindings.cbegin(), bindings.cend()); - } const QRhiVertexInputBinding *cbeginBindings() const { return m_bindings.cbegin(); } const QRhiVertexInputBinding *cendBindings() const { return m_bindings.cend(); } const QRhiVertexInputBinding *bindingAt(int index) const { return &m_bindings.at(index); } @@ -261,10 +257,6 @@ public: m_attributes.clear(); std::copy(first, last, std::back_inserter(m_attributes)); } - void setAttributes(const QVector &attributes) // compat., to be removed - { - setAttributes(attributes.cbegin(), attributes.cend()); - } const QRhiVertexInputAttribute *cbeginAttributes() const { return m_attributes.cbegin(); } const QRhiVertexInputAttribute *cendAttributes() const { return m_attributes.cend(); } @@ -551,9 +543,6 @@ public: QRhiTextureUploadDescription() = default; QRhiTextureUploadDescription(const QRhiTextureUploadEntry &entry); QRhiTextureUploadDescription(std::initializer_list list); - QRhiTextureUploadDescription(const QVector &entries) // compat., to be removed - : m_entries(entries.cbegin(), entries.cend()) - { } void setEntries(std::initializer_list list) { m_entries = list; } template @@ -979,11 +968,6 @@ public: std::copy(first, last, std::back_inserter(m_bindings)); } - void setBindings(const QVector &bindings) // compat., to be removed - { - setBindings(bindings.cbegin(), bindings.cend()); - } - const QRhiShaderResourceBinding *cbeginBindings() const { return m_bindings.cbegin(); } const QRhiShaderResourceBinding *cendBindings() const { return m_bindings.cend(); } @@ -1172,10 +1156,6 @@ public: m_shaderStages.clear(); std::copy(first, last, std::back_inserter(m_shaderStages)); } - void setShaderStages(const QVector &stages) // compat., to be removed - { - setShaderStages(stages.cbegin(), stages.cend()); - } const QRhiShaderStage *cbeginShaderStages() const { return m_shaderStages.cbegin(); } const QRhiShaderStage *cendShaderStages() const { return m_shaderStages.cend(); } -- cgit v1.2.3 From 9f79ab360fd8a504601d3c66a7773eeaa09bffde Mon Sep 17 00:00:00 2001 From: David Faure Date: Sun, 3 Mar 2019 14:55:20 +0100 Subject: Fix assert in QTextDocument CSS parser on "border-width: 1pt" The code was assuming that if the parsing of the value worked, then it must be a list of 4 variants. But in this case it's just a single length. This came from using 4 values for border-width while other elements use a single value. But the storage is shared. So the fix is to use 4 values everywhere. When reading 4 and there's only one, it gets duplicated, so the caller can just use the first one in that case. Task-number: QTBUG-80496 Change-Id: I682244b6e3781c4d673a62d5e6511dac263c58e8 Reviewed-by: Nils Jeisecke Reviewed-by: Shawn Rutledge --- src/gui/text/qcssparser.cpp | 1 + src/gui/text/qcssparser_p.h | 4 ++-- src/gui/text/qtexthtmlparser.cpp | 7 +++++-- 3 files changed, 8 insertions(+), 4 deletions(-) (limited to 'src/gui') diff --git a/src/gui/text/qcssparser.cpp b/src/gui/text/qcssparser.cpp index ce7c7610c1..627b3ec8c0 100644 --- a/src/gui/text/qcssparser.cpp +++ b/src/gui/text/qcssparser.cpp @@ -443,6 +443,7 @@ void ValueExtractor::lengthValues(const Declaration &decl, int *m) { if (decl.d->parsed.isValid()) { QList v = decl.d->parsed.toList(); + Q_ASSERT(v.size() == 4); for (int i = 0; i < 4; i++) m[i] = lengthValueFromData(qvariant_cast(v.at(i)), f); return; diff --git a/src/gui/text/qcssparser_p.h b/src/gui/text/qcssparser_p.h index ab85e76cf3..d91b095a76 100644 --- a/src/gui/text/qcssparser_p.h +++ b/src/gui/text/qcssparser_p.h @@ -856,13 +856,13 @@ struct Q_GUI_EXPORT ValueExtractor int extractStyleFeatures(); bool extractImage(QIcon *icon, Qt::Alignment *a, QSize *size); - int lengthValue(const Declaration &decl); + void lengthValues(const Declaration &decl, int *m); private: void extractFont(); void borderValue(const Declaration &decl, int *width, QCss::BorderStyle *style, QBrush *color); LengthData lengthValue(const Value& v); - void lengthValues(const Declaration &decl, int *m); + int lengthValue(const Declaration &decl); QSize sizeValue(const Declaration &decl); void sizeValues(const Declaration &decl, QSize *radii); diff --git a/src/gui/text/qtexthtmlparser.cpp b/src/gui/text/qtexthtmlparser.cpp index 5d37982a8b..b867f42480 100644 --- a/src/gui/text/qtexthtmlparser.cpp +++ b/src/gui/text/qtexthtmlparser.cpp @@ -1209,8 +1209,11 @@ void QTextHtmlParserNode::applyCssDeclarations(const QVector if (decl.styleValue() != QCss::BorderStyle_Unknown && decl.styleValue() != QCss::BorderStyle_Native) borderStyle = static_cast(decl.styleValue() - 1); break; - case QCss::BorderWidth: - tableBorder = extractor.lengthValue(decl); + case QCss::BorderWidth: { + int borders[4]; + extractor.lengthValues(decl, borders); + tableBorder = borders[0]; + } break; case QCss::BorderCollapse: borderCollapse = decl.borderCollapseValue(); -- cgit v1.2.3