I understand ( How does windowing work in qt embedded? ) that you should run one Application as the QWS Server to provide window management facilities, but that you can run other Apps with graphical interfaces as well in Qt Embedded for Linux.
I want to programmatically switch focus between windows without requiring mouse / keyboard interaction to achieve focus. I've searched the following docs but am not seeing any way to make a different window 'active':
http://qt-project.org/doc/qt-4.8/qwsserver.html
http://qt-project.org/doc/qt-4.8/qapplication.html
http://qt-project.org/doc/qt-4.8/qsessionmanager.html#details
http://qt-project.org/doc/qt-4.8/qwswindow.html
QWSServer has a method:
const QList<QWSWindow *> & QWSServer::clientWindows ()
Which returns a list of QWSWindows, but I don't see how I can make one of those windows the currently active window. How can I do this? Thanks -
The accepted answer is false in some sense. I think solution is to find needed window by clientWindows, then call QWSWindow::setActiveWindow() and then QWSWindow::raise().
QWSWindow provides the undocumented raise() method. See: qwindowsystem_qws.h definition of QWSWindow. You need this type of functionality if you want to make any sort of window manager.
Undocumented can beat impossible in some situations.
It is even more complex and difficult, if you wish to let non-Qt applications have focus, etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With