Results 1 to 9 of 9

Thread: add time line widget

  1. #1
    Join Date
    Jul 2012
    Posts
    24
    Qt products
    Qt4
    Platforms
    Windows

    Default add time line widget

    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)


    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

  2. #2
    Join Date
    Jul 2012
    Posts
    40
    Thanks
    12
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: add time line widget

    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.

  3. #3
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: add time line widget

    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.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  4. #4
    Join Date
    Jul 2012
    Posts
    24
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: add time line widget

    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 ?
    Last edited by robel; 27th July 2012 at 13:45.

  5. #5
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: add time line widget

    any advice to do that ?
    What do you mean?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  6. #6
    Join Date
    Jul 2012
    Posts
    24
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: add time line widget

    can you give me advice how i program it ? (i mean how i get widget in my interface like that picture)

  7. #7
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: add time line widget

    You just program it by typing code.
    If you get in to problems ask here.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  8. #8
    Join Date
    Jul 2012
    Posts
    24
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: add time line widget

    hi again ,
    you mean by code with qpainter i draw the lines and the numbers ? i do know just how i start it

  9. #9
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: add time line widget

    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, especially examples such as Analog Clock 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.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. write in a file next line each time
    By muskan in forum Qt Programming
    Replies: 2
    Last Post: 30th August 2011, 06:54
  2. Replies: 32
    Last Post: 29th January 2011, 22:14
  3. Draw a line between widget and mouse?
    By AyaKoshigaya in forum Qt Programming
    Replies: 6
    Last Post: 26th April 2010, 06:32
  4. Replies: 0
    Last Post: 28th February 2009, 23:18
  5. Time widget
    By bruccutler in forum Newbie
    Replies: 1
    Last Post: 12th April 2007, 15:08

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.