How to check whether the windows are already open..
-
Hi...
im designing a Messenger,and more like a yahoo messenger
When a message comes at the client side,it should check whether the chat box pertaining to that user is already open or not.
If i had the instance with me,i would have checked it by any means.But the problem is chat boxes are created some where else.
Is there any way to check all the windows that are open in the program...
Thanks in advance..
-
If you mean topLevel widgets, you can try "QApplication::topLevelWidgets()":http://doc.qt.nokia.com/4.7/qapplication.html#topLevelWidgets
-
You should have a "container class":http://doc.qt.nokia.com/latest/containers.html holding your chat windows. I'd suggest a "QHash":http://doc.qt.nokia.com/latest/qhash.html with the nickname as key and a pointer to the messenger window/widget as value.