Results 1 to 2 of 2

Thread: Change Active Window

  1. #1
    Join Date
    Mar 2014
    Location
    USA
    Posts
    85
    Thanks
    17
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Change Active Window

    I have 2 windows open. I want to programmiticaly make one window be on top and have focus from the other window. I'm calling
    Qt Code:
    1. window->setWindowState(Qt::WindowActive);
    2. window->setFocus();
    To copy to clipboard, switch view to plain text mode 
    but the window I'm calling it from stays in focus. Am I doing something wrong? They are both a QMainWindow

  2. #2
    Join Date
    Jul 2008
    Location
    Germany
    Posts
    507
    Thanks
    11
    Thanked 76 Times in 74 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Change Active Window

    Hi, have you tried QWidget::raise?

    Ginsengelf

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

    TonyInSoMD (3rd August 2017)

Similar Threads

  1. How to get QWidget as Child-Popup as active Window?
    By nernst in forum Qt Programming
    Replies: 0
    Last Post: 4th December 2015, 06:45
  2. How to set window to active window based on QProcess?
    By tahayassen in forum Qt Programming
    Replies: 1
    Last Post: 2nd April 2013, 09:28
  3. Replies: 0
    Last Post: 4th March 2011, 19:18
  4. Qt Designer Change active .ui file || Show a second window
    By MrRump in forum Qt Tools
    Replies: 4
    Last Post: 5th June 2010, 19:57
  5. Window Active
    By bismitapadhy in forum Qt Programming
    Replies: 1
    Last Post: 10th June 2009, 11:12

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.