Signals and Slot Problem
-
in socketudp.cpp
ipDataReceived(datagram) is emittedIn main.cpp
socketudp UnderUDP;
UnderUDP object created.
If i create object in mainwindow.cpp, UDP data cannot received (TCP no problem)
(strange problem, i tried debugging many times and this is the symptom.in mainwindow.cpp
connect(&UnderUDP,SIGNAL(ipDataReceived(QByteArray)),this,SLOT(onPortDataReceived(QByteArray)));doing debug, i found my SLOT is never call. Why is this so?
I did experiment 2.
I move slot and QObject::connect to main.cpp but can't declare slot in main.cpp. Pls Help ..
I am out of idea. -
Hi,
Without any code it's pretty much Crystal Ball (™).
IRCC, debugging, so can you share it ?
-
Depends, you can use C++11 lambda as slots