PDA

View Full Version : add time line widget



robel
27th July 2012, 13:32
Hi,
i am new in the uses of Qt , i want add to my application a time line (i work in animation field) like that (not the same)
http://uploads.siteduzero.com/thb/261001_262000/261541.png

for that i ask you is there somthing in Qt like that ? or i must program it ? i read that is there "timeline widget" BUT i do not know if it give me as i want or now
thanks for repling and i am sorry for my english

Qtonimo
27th July 2012, 13:36
Use a QTimer and set its interval to 1000.
Then every second timeout signal gets fired and you can update(in the slot connected to timeout()) your timeline.

high_flyer
27th July 2012, 13:37
for that i ask you is there somthing in Qt like that ?
No.
But all the various elements to build such a thing, yes.

or i must program it ?
Yes you do.

robel
27th July 2012, 13:39
thanks for repling

BUT i want add widget in my interface that represent the line of time as the picture , not just update the time


Yes you do.
any advice to do that ?

high_flyer
27th July 2012, 13:58
any advice to do that ?
What do you mean?

robel
27th July 2012, 14:15
can you give me advice how i program it ? (i mean how i get widget in my interface like that picture)

high_flyer
27th July 2012, 15:40
You just program it by typing code.
If you get in to problems ask here.

robel
27th July 2012, 17:50
hi again ,
you mean by code with qpainter i draw the lines and the numbers ? i do know just how i start it

d_stranz
29th July 2012, 16:08
So what you are saying is you don't understand how to get started writing a custom widget, right?

Qt has many, many examples of how to use standard widgets as well as how to write custom widgets. Why don't you start here: Widget Examples (http://qt-project.org/doc/qt-4.8/examples-widgets.html), especially examples such as Analog Clock (http://qt-project.org/doc/qt-4.8/widgets-analogclock.html) that show how to use QPainter within a paint event to draw customized things inside a widget.

A hint: Start simple. Instead of trying to paint a beautiful time line widget like the screen shot you showed, do something simple - make a long rectangle with some numbers inside. Once you figure out how to draw and scale it properly, then you can add the other features to make it pretty.

I am also assuming that what you mean by the "time line" is only the part in the top-half of your screen shot. The menus, buttons, and other things in the toolbar below that can be done with standard Qt widgets inside of a layout.