Results 1 to 7 of 7

Thread: Not show the progress bars under another window

  1. #1
    Join Date
    Jan 2006
    Location
    Catalonia
    Posts
    266
    Thanks
    44
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Question Not show the progress bars under another window

    Hi all, I'm programming an application and in some cases I need to show QProgressBars when some lengthy process is running. This process can be started from another window that stays on the top of the window where the progress bars really have to be shown. The problem is that the progress bars are always shown even if I start the process from the other window, and in this case I want that the progress bars not appear under the current window because it's a bit annoying. I thougth setting the current window Qt::WindowStaysOnTopHint but it only works for top level windows. Another solution could be not showing the progress bars if the window is totally hidden by another window but I don't know how to make it. Any suggestions please?

    Thanks a lot.

  2. #2
    Join Date
    Jan 2006
    Location
    Paris, France
    Posts
    227
    Thanks
    3
    Thanked 21 Times in 21 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Not show the progress bars under another window

    You can use widget.isVisible(), to check if it is hidden by another one !

    And if the widget is hidden, you can hide also the progressbars.

    Guilugi.

  3. #3
    Join Date
    Jan 2006
    Location
    Catalonia
    Posts
    266
    Thanks
    44
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Not show the progress bars under another window

    Quote Originally Posted by guilugi
    You can use widget.isVisible(), to check if it is hidden by another one !
    Sorry guiluigi, that's not truth. Look what the docs says in the QWidget::visible() method:

    A widget that happens to be obscured by other windows on the screen is considered to be visible.
    I also had thought in this solution...

    Moreover, I'd like that the progress bar continues appearing but behind the current window
    Last edited by SkripT; 13th March 2006 at 17:07.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Not show the progress bars under another window

    Could you explain the situation a bit more? Is QProgressBar you want a part of another widget or a standalone one (like QProgressDialog)? You could probably use QApplication::activeWindow() to see if a widget of your choice is currently active.

  5. #5
    Join Date
    Jan 2006
    Location
    Catalonia
    Posts
    266
    Thanks
    44
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Not show the progress bars under another window

    Thanks wysota, You're right: when I said progress bars I really want to say progress dialog, sorry I will try it with QApplication::activeWindow () i think it will work to show or not the progress dialog. But do you know any other way to show the progress dialog but behind the current/active window? In this way if the current window is not at full screen may be some parts or the totality of the progress dialog is shown if it's not obscured by the current window
    Last edited by SkripT; 13th March 2006 at 17:20.

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Not show the progress bars under another window

    The only hint I can give you is that a child dialog is always shown on top of its parent. So a way to decide where a dialog should be shown is to give it a proper parent (and they say one doesn't choose his parents ). You could also use raise() and lower() to manipulate the order of dialogs in the stack.

  7. #7
    Join Date
    Jan 2006
    Location
    Catalonia
    Posts
    266
    Thanks
    44
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Not show the progress bars under another window

    Ok thanks again, I think that with all this hints I will find a solution.

Similar Threads

  1. QtItemDelegate for progress bars
    By maxpayne in forum Qt Programming
    Replies: 2
    Last Post: 19th November 2008, 13:26
  2. Show progress of a time consuming operation
    By rainman110 in forum Newbie
    Replies: 7
    Last Post: 10th February 2008, 12:07
  3. qtopia window decoration cannot show caption
    By qtopiahooo in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 13th March 2007, 08:09
  4. window decoration cannot show caption
    By qtopiahooo in forum Qt Programming
    Replies: 1
    Last Post: 31st January 2007, 08:17
  5. WYSIWYG html, Window show png icon mac no!
    By patrik08 in forum Qt Programming
    Replies: 10
    Last Post: 25th May 2006, 12:01

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.