Skip to content
QtWS25 Last Chance
  • Qtquick\Qml Arc

    Unsolved QML and Qt Quick arc shape canvas beginner help
    4
    0 Votes
    4 Posts
    2k Views
    ndiasN
    Hi @fallouthase, Please find bellow a simple example using PathAngleArc: https://doc.qt.io/qt-6/qml-qtquick-pathanglearc.html import QtQuick.Shapes Shape { width: 200 height: 200 anchors.top: parent.top anchors.left: parent.left // Enable multisampled rendering layer.enabled: true layer.samples: 4 // Outer gray arc: ShapePath { fillColor: "transparent" strokeColor: "gray" strokeWidth: 20 capStyle: ShapePath.RoundCap PathAngleArc { centerX: 100; centerY: 100 radiusX: 100-20/2; radiusY: 100-20/2 startAngle: 135 sweepAngle: 270 } } // Inner blue arc: ShapePath { fillColor: "transparent" strokeColor: "blue" strokeWidth: 20 capStyle: ShapePath.RoundCap PathAngleArc { centerX: 100; centerY: 100 radiusX: 100-20/2; radiusY: 100-20/2 startAngle: 135 sweepAngle: 180 } } } [image: 512e5cf8-7b1e-4b4c-aa93-d98a1b78f9c0.png] You can also use already implemented customizable QML Circular Slider: https://github.com/arunpkqt/CircularSlider Best Regards
  • Click on ShapePath

    Unsolved QML and Qt Quick qml shapes shape shapepath mousearea
    1
    0 Votes
    1 Posts
    374 Views
    No one has replied
  • QML Shape and ShapePath

    Unsolved QML and Qt Quick qml shapes shape pathline
    1
    0 Votes
    1 Posts
    649 Views
    No one has replied
  • 0 Votes
    2 Posts
    1k Views
    mrjjM
    Hi I just keep a pointer to the "white lines" and adjust if i move yellow. class ColorItem : public QGraphicsItem { .. ConnectorLine* line = nullptr; .. protected: QVariant itemChange(GraphicsItemChange change, const QVariant& value) override { if (change == ItemPositionChange && scene()) { if (line) { line->adjust(); } } return QGraphicsItem::itemChange(change, value); } private: QColor color; }; line->Adjust() alters its endpoints. You could just adjust it directly here.
  • 0 Votes
    11 Posts
    5k Views
    H
    @Asperamanca No, I didn't set these two flags ItemClipsToShape, ItemClipsChildrenToShape. Then I tried setting only one flag ItemClipsToShape, and both of ItemClipsToShape, ItemClipsChildrenToShape. For each, it still check if the point is in the boundingrect() firstly, and then check the shape() which means if point is not in boundingrect(), it wouldn't bother to check shape(). So now my solution is still enlarging the boundingrect() area.
  • QPainterPath from list of points

    Solved General and Desktop qpainterpath qgraphicsitem shape
    24
    0 Votes
    24 Posts
    13k Views
    Joel BodenmannJ
    @mrjj Well, thanks to you and @kshegunov too. You guys are amazing!