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 would I implement the following curve editor in QT? (link inside)
QtWS25 Last Chance

How would I implement the following curve editor in QT? (link inside)

Scheduled Pinned Locked Moved Unsolved General and Desktop
graph
8 Posts 5 Posters 1.8k 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.
  • S Offline
    S Offline
    sol_aries
    wrote on last edited by
    #1

    CurveEdit

    Googling and looking through forums did not help. I'm not sure where to start with it.

    Link starts in an item list, then expands into a pop-up with a curve editor that the user can edit by dragging the curve around. The dragging the curve around in a graph is what I would like to know how to do. Thanks.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Do you mean something like this ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • S Offline
        S Offline
        sol_aries
        wrote on last edited by
        #3

        Thanks for the link. Seems like that particular implementation has external dependencies. It also works by moving control points around. In my example there are no control points. Left mouse dragging anywhere on the graph area will move the curve based on your x/y movements. Hmm, maybe the control point can be as big as the window and invisible?

        kshegunovK 1 Reply Last reply
        0
        • S sol_aries

          Thanks for the link. Seems like that particular implementation has external dependencies. It also works by moving control points around. In my example there are no control points. Left mouse dragging anywhere on the graph area will move the curve based on your x/y movements. Hmm, maybe the control point can be as big as the window and invisible?

          kshegunovK Offline
          kshegunovK Offline
          kshegunov
          Moderators
          wrote on last edited by
          #4

          You'd still probably need some dependency. If you don't want the spline evaluation one, at least you'd need a matrix solver. The simplest to implement is actually to use a cubic (or log-square) polyharmonic spline.

          Read and abide by the Qt Code of Conduct

          S 1 Reply Last reply
          2
          • kshegunovK kshegunov

            You'd still probably need some dependency. If you don't want the spline evaluation one, at least you'd need a matrix solver. The simplest to implement is actually to use a cubic (or log-square) polyharmonic spline.

            S Offline
            S Offline
            sol_aries
            wrote on last edited by
            #5

            @kshegunov How about the part in my link where you drag the curve around? The link provided by SGaist works by moving control points around. My link has no control points. Clicking and dragging anywhere in the pop up window will move the curve, and update the value in both the original box and the popup.

            1 Reply Last reply
            0
            • VRoninV Offline
              VRoninV Offline
              VRonin
              wrote on last edited by
              #6

              The drag part is the easy part to implement. What we are suggesting is how to get the curve, i.e. given a number of the "attenuation" parameter, are you able to draw the corresponding curve?

              "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
              ~Napoleon Bonaparte

              On a crusade to banish setIndexWidget() from the holy land of Qt

              S 1 Reply Last reply
              0
              • VRoninV VRonin

                The drag part is the easy part to implement. What we are suggesting is how to get the curve, i.e. given a number of the "attenuation" parameter, are you able to draw the corresponding curve?

                S Offline
                S Offline
                sol_aries
                wrote on last edited by sol_aries
                #7

                @VRonin I appreciate pointing me at curve functions, I guess I didn't make clear that the dragging part is the part I can't figure out. Widgets are not normally 'live' like in the link example - clicking anywhere on the graph and dragging the mouse causes a change. Can I capture mouse deltas while in the widget?

                aha_1980A 1 Reply Last reply
                0
                • S sol_aries

                  @VRonin I appreciate pointing me at curve functions, I guess I didn't make clear that the dragging part is the part I can't figure out. Widgets are not normally 'live' like in the link example - clicking anywhere on the graph and dragging the mouse causes a change. Can I capture mouse deltas while in the widget?

                  aha_1980A Offline
                  aha_1980A Offline
                  aha_1980
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  Hi @sol_aries

                  Just read about QMouseEvent

                  Qt has to stay free or it will die.

                  1 Reply Last reply
                  3

                  • Login

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