qpainterpath

QPainterPath drawing and placering items along multiple paths

限于喜欢 提交于 2019-12-24 08:01:42
问题 I have from previous codelines developed and added some special behaviour. The idea is to draw small circle shapes on a certain path inside rectangular shape and circular shape and place them according to the distance given in advance. I want to draw automatically and programmatically based on given distance by user. ie. distance and number will vary. I have looked myself at this exercise, and reached to solve this with very complicated for-loops and long codelines. I am afraid of repeating

Animate ellipses along QPainterPath

不羁的心 提交于 2019-12-11 16:59:58
问题 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 check if it passed the end of the path and move it back to the beginning? class Animation : public QAbstractAnimation { public: Animation(const QPainterPath& path, QObject *parent = Q_NULLPTR); virtual void updateCurrentTime(int ms) override; virtual

How to draw a smooth curved line that goes through several points in QT?

*爱你&永不变心* 提交于 2019-12-05 01:03:29
问题 Is there a way to draw a smooth line through a set of points in QT? The number and position of the points is set during run time. Currently, I draw a QPainterPath which contains lineTo's going from point to point, creating a path. I do use render-hints antialiasing but the path is still jagged. I've seen QSplineSeries which seems to give this kind of curved path but it is not available in Qt4.8, which is the QT Version I'm using. Another option that is being suggested often is using Bezier