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. Scrolless but draggable widget
Qt 6.11 is out! See what's new in the release blog

Scrolless but draggable widget

Scheduled Pinned Locked Moved General and Desktop
6 Posts 3 Posters 1.7k 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.
  • V Offline
    V Offline
    vivinonoc
    wrote on last edited by
    #1

    I'm willing to create a widget that draw graphics using OpenGL that doesn't have a scroll but you can drag it to show the rest of the graphic. This image describes more or less what I'm talking about:

    !http://i.imgur.com/Sfl1Qcp.png(http://i.imgur.com/Sfl1Qcp.png)!

    As you can see there's an arrow which points the direction that the user can drag and the rest of the graphic is showing.

    From where I can start? Is there a tutorial or example that has something similar?

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

      Hi,

      You can implement your widget's mouseMoveEvent and update your OpenGL scene coordinate from there.

      Hope it helps

      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
      0
      • sierdzioS Offline
        sierdzioS Offline
        sierdzio
        Moderators
        wrote on last edited by
        #3

        Or you could render the whole scene (if you really need OpenGL. The raster engine is pretty fast and can be used for charts/ graphs) and then use QScroller::grabGesture()

        (Z(:^

        1 Reply Last reply
        0
        • V Offline
          V Offline
          vivinonoc
          wrote on last edited by
          #4

          Maybe I can do that using canvas as well.

          I'm trying to draw a waveform from a raw audio file. I demuxed/decoded an audio file using FFmpeg and I have those informations: samples buffer, the size of the samples buffer, the duration of the audio file (in seconds), sample rate (44100, 48000, etc), sample size, sample format (uint8, int16, int32, float, double), and the raw audio data itself.

          The thing is: how to draw those informations in order to become a waveform, allow dragging, zoom and so on.

          !http://i.stack.imgur.com/M3QLO.png!

          1 Reply Last reply
          0
          • sierdzioS Offline
            sierdzioS Offline
            sierdzio
            Moderators
            wrote on last edited by
            #5

            Simple: use the Qwt library, or Qt Commercial Charts. No need to reinvent the wheel.

            (Z(:^

            1 Reply Last reply
            0
            • V Offline
              V Offline
              vivinonoc
              wrote on last edited by
              #6

              The thing is that I want to learn, that is the propose here. I will Qwt library and others common to it.

              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