Scrolless but draggable widget
-
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?
-
Hi,
You can implement your widget's mouseMoveEvent and update your OpenGL scene coordinate from there.
Hope it helps
-
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()
-
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.
-
Simple: use the Qwt library, or Qt Commercial Charts. No need to reinvent the wheel.