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. I need a very simple example how to connect QPointF with curves
Qt 6.11 is out! See what's new in the release blog

I need a very simple example how to connect QPointF with curves

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 886 Views 1 Watching
  • 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.
  • H Offline
    H Offline
    heatblazer
    wrote on last edited by
    #1

    Hello, I have a QList of QPoints which I need to connect with curves and lines. Can you point me the simpliest way to do this, and one important thing, is the line drawn between collision detectable? Thanks in advance.
    P.S. I am usign QGraphics* all things

    1 Reply Last reply
    0
    • M Offline
      M Offline
      melghawi
      wrote on last edited by
      #2

      Hi heatblazer.

      I might be wrong but are you looking for something like "this"?:http://qt-project.org/doc/qt-4.8/qpainterpath.html#details

      I have used QPainterPath to create curves and lines and then render them using QPainter.

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

        Connecting all the dots with straight lines is trival. Fitting curves through them is not. The curves that Qt provides use control points (standard bezier stuff), but do not do curve fitting (finding a curve that goes through the provided points). If you need that, you will need to do your own math algorithms for that.

        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