[Qt-interest] understanding QWSServer
linux newbie
linux.newbie79 at gmail.com
Mon Nov 23 07:36:49 CET 2009
Hi,
I read the documents related to QWSServer online and currently working
on it to get better understanding.
I created a application (-qws server), which installed Event Filter.
On pressing ALT+Fn keys, I want the server application window to come
foreground.
I invoked an example application (which wil act as client) in my
embedded platform. currently this client window is in foreground.
I wrote the following code in Event Filter of server application in
order to bring it to foreground, but Event Filter routine is not
called( I believe any keypress, must comes to server and then moves to
client).
can anyone let me know, the mistake I made.
bool mainApp::eventFilter(QObject *obj, QEvent *event)
{
if (event->type() == QEvent::KeyPress)
{
QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
if (keyEvent->modifiers() == Qt::ShiftModifier)
{
QList<QWSWindow*> windowList = QWSServer::instance()->clientWindows();
if (keyEvent->key() == Qt::Key_F1)
{
if (windowList.size() > 1)
{
QWSWindow *win = windowList.at(0);
win->show();
}
return true;
}
}
}
return QObject::eventFilter(obj, event);
}
More information about the Qt-interest-old
mailing list