Hi All !
I would like to create some vector graphics ballons that can be customized by the user (changing the scale factors and position of the stem.
Internally I use QPainter to draw all the balloons stuff including the balloons shapes.
For every type of balloon I create, on the fly, a QPainterPath from an union of several polygons. 
I try to do something like this with a strange results that probably depends from the painterpath position:

The code (very straightfoward and not optimize) is the following:
	
	{		
	int w = m_rect.width();
	int h = m_rect.height();
 
	QRect smallRect
(center.
x(),center.
y(),w
*0.5,h
*0.5);
  
	s2.addEllipse(smallRect.translated(w*0.2,0));
 
	s3.addEllipse(smallRect.translated(-w*0.2,0));
 
	s4.addEllipse(smallRect.translated(w*0.1,-h*0.2));
 
	s5.addEllipse(smallRect.translated(-w*0.1,-h*0.2));
 
	s6.addEllipse(smallRect.translated(w*0.1,h*0.2));
 
	s7.addEllipse(smallRect.translated(-w*0.1,h*0.2));
 
	QPolygonF p 
= s2.
united(s3
).
united(s4
).
united(s5
).
united(s6
).
united(s7
).
toFillPolygon();
 	return p;
}
        QPolygonF Balloon::getSoftPolygon()
{		
	int w = m_rect.width();
	int h = m_rect.height();
	QPoint center = m_rect.center()-QPoint(w*0.25,h*0.25);
	QRect smallRect(center.x(),center.y(),w*0.5,h*0.5);
		
	QPainterPath s2;
	s2.addEllipse(smallRect.translated(w*0.2,0));
		
	QPainterPath s3;
	s3.addEllipse(smallRect.translated(-w*0.2,0));
	
	QPainterPath s4;
	s4.addEllipse(smallRect.translated(w*0.1,-h*0.2));
	QPainterPath s5;
	s5.addEllipse(smallRect.translated(-w*0.1,-h*0.2));
	QPainterPath s6;
	s6.addEllipse(smallRect.translated(w*0.1,h*0.2));
	QPainterPath s7;
	s7.addEllipse(smallRect.translated(-w*0.1,h*0.2));
	QPolygonF p = s2.united(s3).united(s4).united(s5).united(s6).united(s7).toFillPolygon();
	return p;
}
To copy to clipboard, switch view to plain text mode 
  
Then in the paintEvent...
	
	 
	overallShape.addPolygon(getSoftPolygon().united(stemPolygon));
        QPolygonF stemPolygon = getStemPolygon();
	QPainterPath overallShape = QPainterPath();
	overallShape.addPolygon(getSoftPolygon().united(stemPolygon));
To copy to clipboard, switch view to plain text mode 
  
Probably exist a more simple way to create a "soft" balloon using QPainterPath. 
Any suggestions and different solution are welcome !!
Bye, bye !
				
			
Bookmarks