linuxqtqtembedded

Qt 4.8.4 QWS Server Programmatically Set Focus With Multiple Client Apps


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 -


Solution

  • If you are trying to do it using QWSServer::clientWindows (), then forget about it. QWSWindow and QWSClient are just providing interfaces to get information about client windows. You can not control them from the server application.

    There are two ways to do what you want :