Questions tagged [qgraphicspathitem]
11 questions
1
vote
1 answer
QGraphicsPathItem between two movable QGraphicsRectItem
I'm trying to follow this example and eyllanesc's answer here
Weird behaviour when dragging QGraphicsItem to draw a line ending with an arrow between two draggable/movable QGraphicsRectItems
Here is my code:
The customized QGraphicsPathItemclass…

aNormalPerson
- 53
- 7
1
vote
1 answer
How can I draw a transparent line continues inside the QGraphicsview without overlap?
I'm trying to draw a path made up of lines in two ways:
the first, the path is made of straight lines, which have their extremities in common. The problem with using this methodology is that the lines overlap in their extremities causing an…

cap
- 21
- 4
1
vote
1 answer
Problem in shape method of QGraphicsPathItem
In below figure I have QGraphicsPathItem on scene as red portion and override it's shape as blue portion. I want when the red space is dragged and moved then the item is lengthened or shortened linearly, and when the blue space is dragged then the…

Sumit
- 83
- 7
1
vote
1 answer
QGraphicsPathItem .setPen() impacts text style
stack overflow community. Let me explain my question refering to the code snipped below
from PyQt5 import QtCore, QtGui, QtWidgets
class PortItem(QtWidgets.QGraphicsPathItem):
def __init__(self, parent=None):
super().__init__(parent)
…

EGuy
- 211
- 1
- 3
- 10
1
vote
1 answer
QGraphicsPathItem issue with computing boundingRect
I am puzzled by a difference of behaviour between Qt5 (PySide2) and Qt4 (PySide). I get the impression that Qt5 has a bug but perhaps I do something wrong?
In short: when applying a computed QPainterPath to a QGraphicsPathItem (using setPath), the…

maxime-esa
- 215
- 1
- 9
1
vote
1 answer
how can I move the points in a Qt QPainterPath after creation?
I created a QGraphicsPathItem by passing the constructor a QPainterPath with about 10 QPoint's in it. Now how can I move the points in the path around?
For example:
This to create a box:
path = QtGui.QPainterPath()
path.moveTo(0, 0)
path.lineTo(10,…

Spencer
- 1,931
- 1
- 21
- 44
0
votes
1 answer
How to display a text on mouseHover event on a QGraphicsPathItem in PyQt5?
I am trying to show a connection by a line (using QGraphicsPathItem) and display a text when I mouse hover on that line.
However, I am not able to bring up a text during mouse hover on the line.
A basic working version of the application code is…

A.G.Progm.Enthusiast
- 846
- 14
- 29
0
votes
1 answer
PyQt5 QGraphicsPathItem to draw a Resistor
I am coding an app to solve electrical circuits and I need to model the circuit. To do so, I need to draw Resistors and other shapes on a scene, being able to move it and so on.
The thing is that I am tryng to show a resistor en the scene and I…

Dani RedRain
- 1
- 1
0
votes
1 answer
QGraphicsPathItem eraser / Splitting QGraphicsPathItem into two new ones
I am working on an application using Qt5 in which you can free hand draw arbitrary shapes in vector graphics, move them and and partially remove parts (just like an eraser in Microsoft paint).
I draw the shapes in QGraphicsScene by adding…

DonHexagon
- 9
- 1
0
votes
1 answer
pyside2 QGraphicsPathItem WindingFill
Hi i have a question about how to properly fill a QGraphicsPathItem in pyside2 (pyqt). currently i am writing a gerber file visualizer and for shapes with multiple geometry i am using a path to have these as one object.
although when filling the…

Daniel Law
- 23
- 5
0
votes
2 answers
Mouse hover over a PySide QGraphicsPathItem
I'm experiencing strange behaviour when I attempt to register mouse hover events on a QGraphicsPathItem.
In the example code (which I hacked from the qt5 elastic nodes example) I draw a simple curve. Hovering over the curve will change the colour…

chengxudude
- 35
- 9