Qt client/server architecture doesn't work for my embedded linux platform
Hello, guys
I want to make my Qt embedded app work as client-server architecture,
a QApplication that start with "-qws" or create with "QApplication::GuiServer" would play as a server, and the others QApplication the create with "QApplication::GuiClient" play as a client.
start the server app first, and then start the client app.
the problems is:
1. In server code, I set the max window rect to QRect(100, 100, 400, 300) via QWSServer::setMaxWindowRect();
In server application, the rect of widget_1 is QRect(100, 100, 400, 300), that is correct.
But in client app, the label_2 show full screen. I think this is wrong.
if I use QWSServer::setMaxWindowRect in client app, the max rect of label_2 is ok.
2. I connect the qws window event signal to my custom slot, and debug the window name, the server widget_1(QWidget) come into this slot, but I don't see the label_2(QLabel) come.
It seems that the client application play as a server itself, not a client of my server app, so the client doesn't respond to the server.
what is going wrong with my code ?
see code below:
server code:
Code:
int main(int argc, char *argv[])
{
Server srv;
widget_1.showMaximized();
return app.exec();
}
#ifndef _SERVER_H_
#define _SERVER_H_
{
Q_OBJECT
public:
~Server();
Q_SIGNALS:
public Q_SLOTS:
protected:
private Q_SLOTS:
private:
};
#endif // _SERVER_H_
{
// init qws server
}
Server::~Server()
{
}
{
qDebug() << "Server::windowEventHandler" << window->name();
}
client code:
Code:
int main(int argc, char *argv[])
{
label_2.showMaximized();
return app.exec();
}
1 Attachment(s)
Re: Qt client/server architecture doesn't work for my embedded linux platform
and something I need to mention is I running Qt-4.5.3 on a arm-linux platform,
for Qt performance, I had most of Qt feature disabled.
Is this could be the problem?
see my qconfig file attached.
/WX
Re: Qt client/server architecture doesn't work for my embedded linux platform
1. I also tried QProcess to start my client app, got the same result.
2. I testing the QCopChannel communication. It is ok if two channel object in the same QApplication(process), but if I create the channels in different QApplication(process), they can not receive each other.
So, it sound like that QCopChannel are broken by something ?
/WX
Re: Qt client/server architecture doesn't work for my embedded linux platform
OK, after looking the fucking source code, I found that this is because I disable the QWS MultiProcess feature in my qconfig file.
It seems that the Qt maybe unstable if I disable lots of features.
Could somebody please help me to check my qconfig file(attached in this thread), and found out if any critical Qt kernel features are disabled?
Thanks....
/WX