December 15, 2010

Sorin Sorin
Lab Rat
66 posts

Timeline widget

 

I want to implement this [img146.imageshack.us] control. I’ve implemented the ruler widget, Do you think that a QGraphicScene is good for the graphical part? the items can be expandable, movable…
Thanks!

 Signature 

There are only 10 types of people in the world: Those who understand binary, and those who don’t

10 replies

December 15, 2010

peppe peppe
Ant Farmer
1028 posts

No. Use a plain QWidget (+ subwidgets).

 Signature 

Software Engineer
KDAB (UK) Ltd., a KDAB Group company

December 15, 2010

Andre Andre
Robot Herder
6416 posts

peppe wrote:
No. Use a plain QWidget (+ subwidgets).

Why?

I think it could be done in either QML, GraphicsView or plain-old widgets. They all have their strongpoints.

December 15, 2010

Sorin Sorin
Lab Rat
66 posts

forgot to add that I’ll have a line over that control that will move horizontally over the control when I’ll press a button. This [img152.imageshack.us] is how the final widget should look,I’ve implemented the tree control too.

 Signature 

There are only 10 types of people in the world: Those who understand binary, and those who don’t

December 15, 2010

peppe peppe
Ant Farmer
1028 posts

Andre wrote:
peppe wrote:
No. Use a plain QWidget (+ subwidgets).

Why?

I think it could be done in either QML, GraphicsView or plain-old widgets. They all have their strongpoints.

I simply think that plain, good ol’ QWidgets are simply what he needs: they’re easy to draw in a style-compliant manner, they’re easy to lay out properly (especially in a “grid” like fashion, without any strange transformation applied), they work in integer coordinates, they’re fast, they don’t require too much memory nor any gpu acceleration to work properly, etc.

Of course, I’m not saying that it’s an easy job — such a complex widget will probably require a lot of time to be written and tested :)

 Signature 

Software Engineer
KDAB (UK) Ltd., a KDAB Group company

December 15, 2010

Andre Andre
Robot Herder
6416 posts

OK, so I guess it depends on the actual needs of Sorin. Personally, I think that if I’d have to write such a widget at this moment, I would give creating a widget based on a QDeclarativeView and implemented with QML serious considderation. That can be combined with custom drawing bits that need that, such as the wave forms. I don’t see too many items in this widget where style compliance is of key importance.

You name working with integers and not dealing with transformations a benefit, but I think it might be a drawback. If you have long timeline, zooming may be needed. Transformations are a real benefit to have available then, I think.

December 15, 2010

peppe peppe
Ant Farmer
1028 posts

The problem is that you don’t simply “zoom in” such widgets by transforming them. All the text and many other drawings must not be scaled when zooming in/out; the waveform and the ruler must change their level of detail while we zoom; we must guarrantee pixel exactness at each and every zoom factor; and so on. These things drive me to QWidget instead of QGraphicsView/QML.

I know that it’s perfectly doable even with them, and all in all, it’s up to what one feels more comfortable to deal with :)
That was my opinion and should be taken as such, and I don’t want to make anyone change his/her mind :)

 Signature 

Software Engineer
KDAB (UK) Ltd., a KDAB Group company

December 15, 2010

Andre Andre
Robot Herder
6416 posts

I am quite open to having my mind changed by good arguments, so thanks for providing them! Providing arguments for all possible approaches can only help Sorin (or anyone else interested) in making the right choice for his or her use case.

March 24, 2011

jefa55 jefa55
Lab Rat
2 posts

Hi.
I am facing the same problem than some of you. Wondering what’s the best approach in order to develop an advanced timeline component, with images, graphics, texts, etc, within it, with zoom in/out capabilities, custom background/colors, etc.

Is there any sample code that i could use based on the discussion you had before in this thread? I assume is going to be some sort of mix of QTimeline, QSlider, QGraphics, and some other advanced graphics control usage.

hope you can help me and eventually, share some pieces of code.

thanks,

javier

March 24, 2011

Andre Andre
Robot Herder
6416 posts

I don’t know of anything concrete that came out of this discussion. However, you seem to have the wrong idea about what QTimeLine is. It is something to control animations, not a graphical widget.

March 24, 2011

jefa55 jefa55
Lab Rat
2 posts

I know what QTimeLine is and his purpose. I am just trying to build an advanced timeline control (Widget?) built with advanced graphical components (images, text, etc) and have the timeline itself move over that complex graphic (something like Movie Maker or Sony Vegas does with his timeline moving over photos and videos you add to the project).

this is the sony vegas timeline for example, with several “channels” for audio and video. the vertical bar is where the time is:
!http://jefa55.zapto.org/images/vegas timeline.JPG!

 
  ‹‹ QStackedWidget vs. QStackedLayout      qtTelnet error in compilation ››

You must log in to post a reply. Not a member yet? Register here!