Results 1 to 2 of 2

Thread: Focus application for mac

  1. #1
    Join Date
    Aug 2009
    Posts
    14
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Focus application for mac

    Hi all. I use qt for develop mac. My programm run to system tray. If i open window of tray icon and focus on my app that window normal open. If i open window and focus on the other app, window open but it is under other window. How i can set the focus my window ?

    P.S.: Sorry for my english

  2. #2
    Join Date
    Aug 2009
    Posts
    14
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Focus application for mac

    I found it

    Qt Code:
    1. ProcessSerialNumber psn;
    2. OSErr err;
    3.  
    4. err = ::GetCurrentProcess(&psn);
    5. if (err == noErr)
    6. ::SetFrontProcess(&psn);
    7.  
    8. QWidget::show()
    To copy to clipboard, switch view to plain text mode 

    this help me

Similar Threads

  1. Best way to set focus to the application?
    By hakermania in forum Newbie
    Replies: 3
    Last Post: 19th January 2012, 19:50
  2. Check If Application now has focus again
    By ShapeShiftme in forum Qt Programming
    Replies: 7
    Last Post: 21st July 2011, 06:20
  3. Making my Application sole focus !
    By fassage in forum Qt Programming
    Replies: 3
    Last Post: 11th November 2009, 10:13
  4. How detective lost focus application ?
    By Torsten in forum Qt Programming
    Replies: 2
    Last Post: 6th August 2008, 14:19
  5. removing focus of application?
    By triperzonak in forum Qt Programming
    Replies: 0
    Last Post: 16th July 2008, 15:17

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.