Results 1 to 3 of 3

Thread: QProgressBar in a new window

  1. #1
    Join Date
    Nov 2007
    Posts
    103
    Thanks
    71
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default QProgressBar in a new window

    Hi,

    Whenever my program is doing something that takes a long time, I'd like it to show a progress bar. Every time progress bar is called, I'd like the program to open a new small window on top of the main window and show a progress bar within that window. When the progress bar reaches 100%, I'd like the progress bar window to automatically close.

    What is the best way to do this? Is there an easy way or do I need to generate a new widget for that? So far I've done everything with one widget only. How do you share information between two widgets/windows?

    I'd be very thankful for any help!

  2. #2
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Thanks
    70
    Thanked 59 Times in 57 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QProgressBar in a new window

    Hi,

    Take a look at QProgessBar
    andQProgressDialog
    Òscar Llarch i Galán

  3. The following user says thank you to ^NyAw^ for this useful post:

    tommy (13th March 2009)

  4. #3
    Join Date
    Sep 2007
    Location
    Rome, GA
    Posts
    199
    Thanks
    14
    Thanked 41 Times in 35 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: QProgressBar in a new window

    Check out QProgressDialog. You can also do it yourself by subclassing QDialog, but maybe the built-in class already provides the functionality you need.

    To answer your question "how do you share information between two widgets/windows" you need to think about object composition. If your main window object "has-a" dialog object, then you should be able to easily connect signals/slots between them to pass information.

  5. The following user says thank you to JimDaniel for this useful post:

    tommy (13th March 2009)

Similar Threads

  1. How to set Qt window transparent?
    By montylee in forum Qt Programming
    Replies: 17
    Last Post: 24th December 2013, 20:11
  2. QMain Window Problem
    By maveric in forum Qt Programming
    Replies: 1
    Last Post: 24th May 2008, 15:51
  3. Set a window as child at runtime
    By sabeesh in forum Qt Programming
    Replies: 1
    Last Post: 26th November 2007, 09:30
  4. Change shape of window / animate window
    By sabeesh in forum Qt Programming
    Replies: 3
    Last Post: 31st October 2007, 08:16
  5. move parent window to the front.
    By hvengel in forum Qt Programming
    Replies: 4
    Last Post: 2nd February 2007, 08:41

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.