QPainterPath is a class from the Qt Toolkit which provides a container for painting operations, enabling graphical shapes to be constructed and reused.
Questions tagged [qpainterpath]
53 questions
0
votes
1 answer
QPainter takes much more time to draw thicker curves?
I am drawing a sine wave (as a test) to check the time it takes to draw a curve using either QPainter::drawPolyline() or QPainter::drawPath(). In either case, if I set the pen width to more than 1, then the time it takes to draw the sine wave…

Chaitanya
- 177
- 2
- 9
0
votes
1 answer
Drawing Bezier curve with multiple off curve points in PyQt
I would like to draw a TrueType Font glyph with PyQt5 QPainterPath. Example glyph fragment: (data from Fonttools ttx )

ajlogo
- 3
- 2
0
votes
1 answer
How to change QPainterPath color after clicking on QPushButton
I subclassed a QPushButton so that I was able to re-implement the paintEvent(QPaintEvent *paint) method also advised by the official documentation.
Below is the sequence of operations:
a) After I launch the application the button is below:
b) This…

EsoMars
- 337
- 3
- 14
0
votes
1 answer
PyQt drawing a QPixmap along QPainterPath
I want to draw patterns (preferable as QPixmap) along a QGraphicsPathItem inside my QGraphicsView. This should work similar to filling a QBrush with a texture by using QBrush.setTexture("example.png"). Is there a way to do this on a QPen? I couldn't…

bravestarr
- 1
- 1
0
votes
1 answer
QPainterPath toFillPolygon() returns more points than the points used to draw the path itself
I have been trying to draw skeletal points of a human using 18 different joints. So, i decided to use QGraphicsPathItem. I could successfully generate the item which looks something like this: (pardon my drawing skills)
To achieve this i…

MarKS
- 494
- 6
- 22
0
votes
0 answers
A bad spatial partitioning using quadtree
I am working on a path planning algorithm for a mobile robot.
I am trying to implement a quadtree algorithm to model the spatial information.
Each node contains a boolean variable that is true if the quad intersects with the path.
For a path like…

billyDev
- 1
- 1
0
votes
1 answer
how enable widget moved when window size changed with paint event?
I am try to create a widget to animate a line, the when the windows size is changed, the animation always play the size.
I know the PainterPath is always same, but i have no any simple idea to do?
from PyQt5.QtGui import *
from PyQt5.QtCore import…

jett chen
- 1,067
- 16
- 33
0
votes
1 answer
Draw text around QPainterPath efficiently
The following code draws text around a QPainterPath:
QString text = "Short text";
QPainterPath rawPath;
// fill path ...
while (...)
{
double percent = ...;
double angle = rawPath.angleAtPercent(percent);
QPointF point =…

Hyndrix
- 4,282
- 7
- 41
- 82
0
votes
1 answer
Animate ellipses along QPainterPath
I have a bunch of ellipses that initially are lined on top of a path and should move along the QPainterPath. I have it working for the first ellipse but I can't figure out how to get the correct position for the other ellipses.
Is there a way to…

user2246120
- 1,453
- 2
- 17
- 38
0
votes
1 answer
QPainterPath stroke artifacts
I am putting together a QPainterPath with text, then I'm drawing it, first with QPainter::strokePath, then with QPainter::fillPath. However, the stroke exhibits artefacts, as shown in the image. Anything I am doing wrong/how to prevent this? Should…

Danol
- 368
- 1
- 15
0
votes
1 answer
QPainterPath PyQt5 draw difficult figures
Hellow. How can i draw smth like figure on pic using the qpainter path ? Does anybody have some code examples?

V.Nosov
- 93
- 3
- 10
0
votes
1 answer
QPainterPath union of shapes (single stroke)
I'm trying to create the union of two shapes with QPainterPath to draw a comic balloon:
const int kb = 4;
QRectF br = text_->boundingRect().adjusted(-kb, -kb, kb, kb);
// anchor on bottom side
qreal y = br.bottom();
qreal x = 0.5 * (br.left() -…

fferri
- 18,285
- 5
- 46
- 95
0
votes
2 answers
how to clear memory from deleted object in c++?
I want to develop my own signal scope in C++. So I use qt for this purpose.
I add a graphicsView and a push Button in ui. At connected method to push button I update the graphicsView(finally I'll pass this method to a thread).
Each time that I press…

M.Hu
- 121
- 1
- 14
0
votes
1 answer
How to draw triangle and rhombus shapes using QT
I need to draw triangle shape and rhombus shapes like this image.In this code which design triangle shape (figure 1) but I need to add this shape to text "TRI" . And I also need to implement this code to design rhombus shape like (figure 2). please…

Gamma
- 317
- 1
- 6
- 22
0
votes
1 answer
QML : What is the equivalent of QPainterPath?
In order to convert one GUI interface written in C++ with the Qt libraries to QML, I've to find an alternative to QPainterPath in QML. Indeed, for now, a bunch of shapes are drawn in the GUI interface and the C++ code modifies the color of those…

Getter
- 765
- 2
- 6
- 15