I've got a program with 2 windows that are open. When I programmatically change the window that's on top, it doesn't have focus.

Qt Code:
  1. SecondWindow->raise();
  2. SecondWindow->setFocus();
To copy to clipboard, switch view to plain text mode 

The second window comes to the top, but doesn't have focus
Since I'm working in windows if I add

Qt Code:
  1. HWND WinHandle = (HWND)SecondWindow->winID();
  2. SetFocus(WinHandle);
To copy to clipboard, switch view to plain text mode 

It gets focus. Is there a way to do it using strictly Qt?