PDA

View Full Version : list of client windows



sar_van81
26th December 2006, 05:14
hi...

i have a QWSServer application and some client applications. can anyone say me how to obtain the list of the client windows using the following function:

const QPtrList<QWSWindow> & QWSServer::clientWindows ()

i tried but could not get it work.

thanks in advance..

saravanan.....

maxpower
29th December 2006, 20:29
Not positive but I believe this should work:



const QPtrList<QWSWindow> windowList;
QWSServer server;
windowList = server.clientWindows();


mAx

sar_van81
11th January 2007, 05:53
hi...
thank for your suggesstion. but still a bit clarifications.
in the main.cpp of my application i had written as follows:

int main( int argc, char **argv )
{
QApplication a( argc, argv ,QApplication::GuiServer);

keyclass w;
//w.setWFlags(Qt::WStyle_Customize);
//w.setWFlags(Qt::WStyle_Tool);
a.setMainWidget( &w );
w.show();
a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );
return a.exec();
}.


so this is a server application right....? in that case i had altered the code as follows:

qwsServer->openKeyboard();
const QPtrList<QWSWindow> windowList;
windowList = qwsServer.clientWindows(); ...

is this correct...? else how...?

also when i compiled : there were errors as: "request for member ‘clientWindows’ in ‘qwsServer’, which is of non-class type ‘QWSServer*’".

so trying to find some other way.

if you have any more suggestions please let me know.

saravanan

sar_van81
11th January 2007, 05:54
opps soory i did not remove the statement"qwsServer->openKeyboard();"

sar_van81
13th January 2007, 04:25
hi ...:crying:

can anyone provide me solution to get the id of client windows. i had written as the following:
int winid=0;
QPtrList<QWSWindow> windowList;
windowList = qwsServer->clientWindows();
QWSWindow *ab;
ab=windowList.first();
printf("\n THE WINDOW ID:%x\n",ab->winId());

but it returns the id of the parent window...

can anyone say me where i'm going wrong....?is there anything wrong in my code...? is my main(in the earlier post) correct..? if please let me know what is wrong...

thanks in advance,

saravanan