Hi!
Sorry if this is a dumb question but I have no past experience with threads and/or network communication.
I'm making a simple tcp communication: I have a sender and I have a receiver.
For now I have 2 different project in QtCreator, one for the sender and one for the receiver. I'm testing the network communication in this way: I open the receiver and then and I open the sender.
But I'd like to have a single progect called SenderReceiverTest that open 2 window, one for the receiver, one for the sender, in the same QtCreator project.
First question: Is this single-project stuff a good idea?

Then...
If i have something like this:

Qt Code:
  1. #include <QtGui/QApplication>
  2. #include "windowsender.h"
  3. #include "windowreceiver.h"
  4.  
  5. int main(int argc, char *argv[])
  6. {
  7.  
  8. QApplication a(argc, argv);
  9. QApplication a(argc, argv);
  10.  
  11. WindowReceiver r;
  12. r.show();
  13. WindowSender s;
  14. s.show();
  15.  
  16. QObject::connect(&r, SIGNAL(windowClosed()), // custom virtual void closeEvent(QCloseEvent *e)
  17. &s, SLOT(close()));
  18. QObject::connect(&s, SIGNAL(windowClosed()), // custom virtual void closeEvent(QCloseEvent *e)
  19. &r, SLOT(close()));
  20.  
  21. return a.exec();
  22. }
To copy to clipboard, switch view to plain text mode 

Second question:
The two window are in the same thread, aren't they? I'd like to have the two windows in different thread for testing real async communication.. and for that I should have two dirrefent thread.. right? How can I do this?