Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

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



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



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



  • 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.



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



  • [quote author="xhsoldier" date="1304054041"]Thanks Andre. I buy your suggestion.[/quote]
    At what price? ;-)
    [quote]
    Btw, for cubic Bezier curve, it requires 4 points, why Qt API QPainterPath::cubicTo() only have 3 points?[/quote]
    Because you already have the starting point in your path, and can set that separately if you want.



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


Log in to reply