PDA

View Full Version : showMinimized() steals the focus



The Storm
22nd January 2009, 16:49
Hi all,

I have a bit nasty problem. I have main application that in some predefined situations shows a minimized window. The problem is that the new minimized window must not steal the focus from the main application window( or other applications ). setFocusPolicy( Qt::NoFocus ); doesn't have effect in this case. I will be glad to hear to some succestions. :)

Regards,
Nikolay

fanat9
22nd January 2009, 18:58
You could always set focus to any window or widget manually by QWidget::setFocus().

Regards

The Storm
23rd January 2009, 08:11
Yep this solution is easy one when we are talking for the application itself, but this showMinimized() function also takes focus from other programs, and sinse I can't take QWidget pointer for example of the Firefox window how I will return the focus to it? :)

Edit: Some info that I should give at the bigining:

OS: Windows XP SP2
Qt: 4.4.3
Compiler: Visual C++ 2008