Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to draw a balloon using code
QtWS25 Last Chance

How to draw a balloon using code

Scheduled Pinned Locked Moved General and Desktop
7 Posts 2 Posters 4.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • X Offline
    X Offline
    xhsoldier
    wrote on last edited by
    #1

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

    Thanks

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

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

      1 Reply Last reply
      0
      • X Offline
        X Offline
        xhsoldier
        wrote on last edited by
        #3

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

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andre
          wrote on last edited by
          #4

          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.

          1 Reply Last reply
          0
          • X Offline
            X Offline
            xhsoldier
            wrote on last edited by
            #5

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

            1 Reply Last reply
            0
            • A Offline
              A Offline
              andre
              wrote on last edited by
              #6

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

              1 Reply Last reply
              0
              • X Offline
                X Offline
                xhsoldier
                wrote on last edited by
                #7

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

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved