Results 1 to 4 of 4

Thread: How to raise/lower a Qt application behind an other Qt application

  1. #1
    Join Date
    Nov 2011
    Location
    Belgium
    Posts
    5
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default How to raise/lower a Qt application behind an other Qt application

    Hi,

    I have two apps, one of which has to start _behind_ the other. I tried doing this using the `showMinimized()` call for the behind one, but this has an undesired side-effect: when switching to it later on, the application is 'animated' to maximum size.

    The current code:

    Qt Code:
    1. if( iAmMaster() )
    2. mainWindow->show();
    3. else
    4. mainWindow->showMinimized();
    To copy to clipboard, switch view to plain text mode 

    In both apps, I known the window handle of the other one.

    Is there a better way?

    Thanks!

    xtofl

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

    Default Re: How to raise/lower a Qt application behind an other Qt application

    Which platform?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Nov 2011
    Location
    Belgium
    Posts
    5
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to raise/lower a Qt application behind an other Qt application

    I was hoping the platform wouldn't matter. But I'm on a WinXP with Qt4.6.3.

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

    Default Re: How to raise/lower a Qt application behind an other Qt application

    If you are on Windows then you can use WinAPI PostMessage() call to post a message to the other application to raise/lower its window. For that you can either use WinAPI calls or QWidget::raise(), QWidget::lower() if they are both Qt apps.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


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


Similar Threads

  1. How to raise application from background?
    By oficjalne100 in forum Qt Programming
    Replies: 17
    Last Post: 10th October 2013, 08:30
  2. Replies: 9
    Last Post: 18th July 2012, 12:45
  3. Replies: 3
    Last Post: 5th October 2011, 16:45
  4. Replies: 1
    Last Post: 30th May 2011, 13:46
  5. Replies: 3
    Last Post: 6th January 2010, 16:55

Tags for this Thread

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.