diff options
10 files changed, 26 insertions, 44 deletions
diff --git a/dependencies.yaml b/dependencies.yaml index b86d9ef5ab..0442c2acf2 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -1,16 +1,16 @@ dependencies: ../qtbase: - ref: 5deac08db78dcfb1e0c4ff11e7c53190d03f19a2 + ref: 1d353eec82dbefc6e42b4d3099c8b41a156b8ec9 required: true ../qtimageformats: - ref: ec0554a007e598ca87fea394425eb118417f79ae + ref: 508f182b1f92489f71f246820145a5ea0d6aad83 required: false ../qtlanguageserver: - ref: 6e4da180c9bedd93c46b22826f82fff16b89efbc + ref: b41c06c8a237ad995e1912c89fdbf6e98b4f82d3 required: false ../qtshadertools: - ref: 353b6a8911b498f4514b2633a2c830cb2fcb4a49 + ref: 593ce7024484461290fc41b17b69d64b5c29fd3b required: false ../qtsvg: - ref: 8372f7382868542c8978c452081e1c1cf238a408 + ref: 107167902005a37aee041b5a1ce7ccffa37587d5 required: false diff --git a/examples/quick/quickshapes/weatherforecast/CMakeLists.txt b/examples/quick/quickshapes/weatherforecast/CMakeLists.txt index 08e8eb6596..c5d3887016 100644 --- a/examples/quick/quickshapes/weatherforecast/CMakeLists.txt +++ b/examples/quick/quickshapes/weatherforecast/CMakeLists.txt @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.16) project(weatherforecast LANGUAGES CXX) -find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick QuickTools) qt_standard_project_setup(REQUIRES 6.8) diff --git a/examples/quick/vectorimage/CMakeLists.txt b/examples/quick/vectorimage/CMakeLists.txt index 7e4041503d..e177cf8286 100644 --- a/examples/quick/vectorimage/CMakeLists.txt +++ b/examples/quick/vectorimage/CMakeLists.txt @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.16) project(vectorimage LANGUAGES CXX) -find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick QuickTools) qt_standard_project_setup(REQUIRES 6.8) diff --git a/src/quickshapes/designhelpers/qquickellipseshape.cpp b/src/quickshapes/designhelpers/qquickellipseshape.cpp index 5c709d5b1d..6734281eff 100644 --- a/src/quickshapes/designhelpers/qquickellipseshape.cpp +++ b/src/quickshapes/designhelpers/qquickellipseshape.cpp @@ -430,6 +430,15 @@ void QQuickEllipseShapePrivate::drawOuterArc(QVector2D center, QVector2D ellipse : (sweepAngle > 0.0f ? QQuickPathArc::Clockwise : QQuickPathArc::Counterclockwise), isFull ? true : alpha > 180.0f); + + // add reverse arc to hide fill color + if (qFuzzyCompare(innerArcRatio, 1)) { + addArc(beginPoint, ellipseRadius, + isFull ? QQuickPathArc::Counterclockwise + : (sweepAngle > 0.0f ? QQuickPathArc::Counterclockwise + : QQuickPathArc::Clockwise), + isFull ? true : alpha > 180.0f); + } } void QQuickEllipseShapePrivate::drawFullInnerArc(QVector2D center, QVector2D ellipseRadius) @@ -492,7 +501,7 @@ void QQuickEllipseShapePrivate::updatePath() return; // just an arc - if (qFuzzyCompare(innerArcRatio, 1) || (hideLine && qFuzzyCompare(innerArcRatio, 0))) { + if (qFuzzyCompare(innerArcRatio, 1)) { drawOuterArc(center, ellipseRadius); return; } @@ -594,22 +603,6 @@ QQuickEllipseShape::QQuickEllipseShape(QQuickItem *parent) QQuickEllipseShape::~QQuickEllipseShape() = default; -bool QQuickEllipseShape::hideLine() const -{ - Q_D(const QQuickEllipseShape); - return d->hideLine; -} - -void QQuickEllipseShape::setHideLine(bool hideLine) -{ - Q_D(QQuickEllipseShape); - if (d->hideLine == hideLine) - return; - d->hideLine = hideLine; - d->updatePath(); - emit hideLineChanged(); -} - /*! \qmlproperty real QtQuick.Shapes.DesignHelpers::EllipseShape::sweepAngle diff --git a/src/quickshapes/designhelpers/qquickellipseshape_p.h b/src/quickshapes/designhelpers/qquickellipseshape_p.h index 0e11a79cb7..6053705464 100644 --- a/src/quickshapes/designhelpers/qquickellipseshape_p.h +++ b/src/quickshapes/designhelpers/qquickellipseshape_p.h @@ -35,7 +35,6 @@ public: FINAL) Q_PROPERTY( qreal strokeWidth READ strokeWidth WRITE setStrokeWidth NOTIFY strokeWidthChanged FINAL) - Q_PROPERTY(bool hideLine READ hideLine WRITE setHideLine NOTIFY hideLineChanged FINAL) Q_PROPERTY(QColor fillColor READ fillColor WRITE setFillColor NOTIFY fillColorChanged FINAL) Q_PROPERTY(QColor strokeColor READ strokeColor WRITE setStrokeColor NOTIFY strokeColorChanged FINAL) @@ -79,9 +78,6 @@ public: qreal strokeWidth() const; void setStrokeWidth(qreal width); - bool hideLine() const; - void setHideLine(bool hideLine); - QColor fillColor() const; void setFillColor(const QColor &color); @@ -116,7 +112,6 @@ public: Q_SIGNALS: void innerArcRatioChanged(); void cornerRadiusChanged(); - void hideLineChanged(); void startAngleChanged(); void sweepAngleChanged(); void strokeColorChanged(); diff --git a/src/quickshapes/designhelpers/qquickellipseshape_p_p.h b/src/quickshapes/designhelpers/qquickellipseshape_p_p.h index f9a9b8bbc9..40ed484794 100644 --- a/src/quickshapes/designhelpers/qquickellipseshape_p_p.h +++ b/src/quickshapes/designhelpers/qquickellipseshape_p_p.h @@ -135,8 +135,6 @@ public: QQuickShapePath *path = nullptr; - bool hideLine = false; - qreal startAngle = 0; qreal sweepAngle = 360; qreal innerArcRatio = 0; diff --git a/src/quickvectorimage/generator/qsvgvisitorimpl.cpp b/src/quickvectorimage/generator/qsvgvisitorimpl.cpp index 3193bf05d4..dceff04da9 100644 --- a/src/quickvectorimage/generator/qsvgvisitorimpl.cpp +++ b/src/quickvectorimage/generator/qsvgvisitorimpl.cpp @@ -296,7 +296,7 @@ bool QSvgVisitorImpl::traverse() if (m_assumeTrustedSource) options.setFlag(QtSvg::AssumeTrustedSource); - auto *doc = QSvgTinyDocument::load(m_svgFileName, options); + auto *doc = QSvgDocument::load(m_svgFileName, options); if (!doc) { qCDebug(lcQuickVectorImage) << "Not a valid Svg File : " << m_svgFileName; return false; @@ -1457,7 +1457,7 @@ QString QSvgVisitorImpl::nextNodeId() const return QStringLiteral("_qt_node%1").arg(m_nodeIdCounter++); } -bool QSvgVisitorImpl::visitDocumentNodeStart(const QSvgTinyDocument *node) +bool QSvgVisitorImpl::visitDocumentNodeStart(const QSvgDocument *node) { Q_ASSERT(m_defsLevel == 0); handleBaseNodeSetup(node); @@ -1466,7 +1466,7 @@ bool QSvgVisitorImpl::visitDocumentNodeStart(const QSvgTinyDocument *node) fillCommonNodeInfo(node, info); fillAnimationInfo(node, info); - const QSvgTinyDocument *doc = static_cast<const QSvgTinyDocument *>(node); + const QSvgDocument *doc = static_cast<const QSvgDocument *>(node); info.size = doc->size(); info.viewBox = doc->viewBox(); info.isPathContainer = isPathContainer(node); @@ -1476,7 +1476,7 @@ bool QSvgVisitorImpl::visitDocumentNodeStart(const QSvgTinyDocument *node) return m_generator->generateRootNode(info); } -void QSvgVisitorImpl::visitDocumentNodeEnd(const QSvgTinyDocument *node) +void QSvgVisitorImpl::visitDocumentNodeEnd(const QSvgDocument *node) { handleBaseNodeEnd(node); qCDebug(lcQuickVectorImage) << "REVERT" << node->nodeId() << node->type() << (styleResolver->painter().pen().style() != Qt::NoPen) diff --git a/src/quickvectorimage/generator/qsvgvisitorimpl_p.h b/src/quickvectorimage/generator/qsvgvisitorimpl_p.h index 9e907ac04c..a537bed03f 100644 --- a/src/quickvectorimage/generator/qsvgvisitorimpl_p.h +++ b/src/quickvectorimage/generator/qsvgvisitorimpl_p.h @@ -25,7 +25,7 @@ QT_BEGIN_NAMESPACE class QTextStream; -class QSvgTinyDocument; +class QSvgDocument; class QSvgFeFilterPrimitive; class QString; class QQuickItem; @@ -55,8 +55,8 @@ protected: bool visitMaskNodeStart(const QSvgMask *node) override; void visitMaskNodeEnd(const QSvgMask *node) override; - bool visitDocumentNodeStart(const QSvgTinyDocument *node) override; - void visitDocumentNodeEnd(const QSvgTinyDocument *node) override; + bool visitDocumentNodeStart(const QSvgDocument *node) override; + void visitDocumentNodeEnd(const QSvgDocument *node) override; bool visitSwitchNodeStart(const QSvgSwitch *node) override; void visitSwitchNodeEnd(const QSvgSwitch *node) override; diff --git a/tests/auto/quickshapes/designhelpers/qquickellipseshape/tst_qquickellipseshape.cpp b/tests/auto/quickshapes/designhelpers/qquickellipseshape/tst_qquickellipseshape.cpp index 46f668c426..9140bbbf8c 100644 --- a/tests/auto/quickshapes/designhelpers/qquickellipseshape/tst_qquickellipseshape.cpp +++ b/tests/auto/quickshapes/designhelpers/qquickellipseshape/tst_qquickellipseshape.cpp @@ -45,7 +45,6 @@ void tst_QQuickEllipseShape::basicShape() QCOMPARE(ellipseShape->height(), 200); QCOMPARE(ellipseShape->cornerRadius(), 10); QCOMPARE(ellipseShape->innerArcRatio(), 0); - QCOMPARE(ellipseShape->hideLine(), false); QCOMPARE(ellipseShape->strokeWidth(), 1); QCOMPARE(ellipseShape->dashOffset(), 0); QCOMPARE(ellipseShape->capStyle(), QQuickShapePath::SquareCap); @@ -70,8 +69,6 @@ void tst_QQuickEllipseShape::changeSignals_data() QTest::newRow("innerArcRatio") << QVariant::fromValue(0.5f) << QMetaMethod::fromSignal(&QQuickEllipseShape::innerArcRatioChanged); - QTest::newRow("hideLine") << QVariant::fromValue(true) - << QMetaMethod::fromSignal(&QQuickEllipseShape::hideLineChanged); QTest::newRow("strokeColor") << QVariant::fromValue( QColor(Qt::blue)) << QMetaMethod::fromSignal(&QQuickEllipseShape::strokeColorChanged); QTest::newRow("strokeWidth") << QVariant::fromValue( diff --git a/tests/baseline/scenegraph/data/designhelpers/designhelpers_ellipseshape.qml b/tests/baseline/scenegraph/data/designhelpers/designhelpers_ellipseshape.qml index 905c31ba39..24a61c1c78 100644 --- a/tests/baseline/scenegraph/data/designhelpers/designhelpers_ellipseshape.qml +++ b/tests/baseline/scenegraph/data/designhelpers/designhelpers_ellipseshape.qml @@ -176,15 +176,14 @@ Rectangle { sweepAngle: 270 cornerRadius: 0 strokeWidth: 2 - hideLine: true - fillColor: "transparent" + innerArcRatio: 1 } TestEllipseShape { startAngle: 0 sweepAngle: 270 cornerRadius: 0 strokeWidth: 2 - hideLine: false + innerArcRatio: 0 fillColor: "transparent" } TestEllipseShape { |
