Hi everyone!
A simple question, but cannot find any solution.

I have a class:
Qt Code:
  1. class Test: public QThread
  2. {
  3. Q_OBJECT
  4. public:
  5. Test();
  6. int port; //An UDP port to bind to
  7. void run() override; // creates, assigns an QUdpSocket object to the so variable, and binds it to some initial port.
  8.  
  9. public slots:
  10. void reconnect(); // Should bind socket to some other port, than the one bound while initializing.
  11. void receive(); // Called to receive datagram. Works fine.
  12. };
To copy to clipboard, switch view to plain text mode 
The run() function looks like (simplyfied):
Qt Code:
  1. void Test::run()
  2. {
  3. so = new QUdpSocket();
  4. so->bind(port);
  5. this->exec();
  6. so->deleteLater();
  7. }
To copy to clipboard, switch view to plain text mode 
As a result, the QUdpSocket *so lives in its own thread.
Is there some way to run reconnect() slot inside this same thread, where the run() function and UdpSocket *so live in? Otherwise the bind to another port isn't allowed:
QSocketNotifier: Socket notifiers cannot be enabled or disabled from another thread
QObject: Cannot create children for a parent that is in a different thread.
I've tried a lot. Always ending with running the SLOT reconnect() inside the SIGNALs thread.

Please, give me any suggestion, because I stuck out of ideas - since days now.