Re: Create Thought Balloons
Quote:
I try to do something like this with a strange results that probably depends from the painterpath position:
I take you mean the line that goes through the balloons...
Do you call QPainterPath::closeSubpath () somewhere?
Re: Create Thought Balloons
No, I never call closeSubpath.
The problem is exactly the lines that start from some ellipse (circle) of the stem.
I try to add some closeSubpath calls but the problem still remains.
To create the stem polygon I use the following code block :
Code:
p1.
addEllipse(QRect(apex.
x()-5,apex.
y()-20,
10,
10));
p1.
addEllipse(QRect(apex.
x()-10,apex.
y()-45,
20,
20));
p1.
addEllipse(QRect(apex.
x()-20,apex.
y()-90,
30,
30));
QList<QPolygonF> list = p1.toFillPolygons();
for(int i=0;i<list.size();i++)
{
polygon = polygon.united(list.at(i));
}
...
...
return polygon;
Any suggestions ?
Re: Create Thought Balloons
I think that if you unite shapes, they get closed and that's where the line comes from. I'd say you should use a simple SVG file instead of rendering those paths. It would give you much more flexibility. If not, then just don't unite those polygons and see if the line is still there.
Re: Create Thought Balloons
I surely prefer to use SVG but I need to modify the balloon stem so I cannot modify very easily an svg file.
Probably the best solution is to use directly a lot of cubicTo calls (Bezier Curve) in order to create the right shape. Is not so easy to manage a lot of points and make it linked with the object dimension.. but I'll try.
I think that will be very useful to create a sort of editor that allows to draw curves, edit control points and export the values with the possibility to add some kind of constraint, etc.
If I have some free time I will create something like that !
Angelo