April 28, 2011

xhsoldier xhsoldier
Lab Rat
29 posts

How to draw a balloon using code

 

I try to use the cubic Bezier curve, but I do not know how to do this.
Is there any other options?

Thanks

6 replies

April 28, 2011

Andre Andre
Area 51 Engineer
6031 posts

Is there any reason why an image is not an option? Not even SVG?

 Signature 

Looking for Qt developers to join our team @ i-Optics: https://qt-project.org/forums/viewthread/25393/

April 29, 2011

xhsoldier xhsoldier
Lab Rat
29 posts

Can QT render SVG format? which class? Where can I find SVG balloon?

April 29, 2011

Andre Andre
Area 51 Engineer
6031 posts

Yes, Qt (not QT) can render SVG. One way is to use QSvgRenderer, but if you just want a widget, you might as well use QSvgWidget.

Balloons in SVG format can be found at the other end of Google search, or on your hard disk after you draw one with any SVG editing tool.

 Signature 

Looking for Qt developers to join our team @ i-Optics: https://qt-project.org/forums/viewthread/25393/

April 29, 2011

xhsoldier xhsoldier
Lab Rat
29 posts

Thanks Andre. I buy your suggestion.
Btw, for cubic Bezier curve, it requires 4 points, why Qt API QPainterPath::cubicTo() only have 3 points?

April 29, 2011

Andre Andre
Area 51 Engineer
6031 posts

xhsoldier wrote:
Thanks Andre. I buy your suggestion.

At what price? ;-)

Btw, for cubic Bezier curve, it requires 4 points, why Qt API QPainterPath::cubicTo() only have 3 points?

Because you already have the starting point in your path, and can set that separately if you want.

 Signature 

Looking for Qt developers to join our team @ i-Optics: https://qt-project.org/forums/viewthread/25393/

April 29, 2011

xhsoldier xhsoldier
Lab Rat
29 posts

the cubic curve in Qt is different from the standard cubic curve. I have tested.

 
  ‹‹ how to fix conversion from ‘QString*’ to non-scalar type ‘QString’ requested      dialog and xine ››

You must log in to post a reply. Not a member yet? Register here!