Hello, I am trying to send a signal from one class to another class. For this, I am using a connect line such as this:
USB *USBInstance = new USB;
connect(this,
SIGNAL(sendChosenComPort
(QString)),USBInstance,
SLOT(receiveChosenComPort
()));
USB *USBInstance = new USB;
connect(this,SIGNAL(sendChosenComPort(QString)),USBInstance,SLOT(receiveChosenComPort()));
To copy to clipboard, switch view to plain text mode
But after I add these lines, when I run, "The program has unexpectedly finished." error appears.
Then I tried to add
USB* USBInstance ;
USB* USBInstance ;
To copy to clipboard, switch view to plain text mode
to the header file and
USBInstance = new USB()
USBInstance = new USB()
To copy to clipboard, switch view to plain text mode
to cpp. file. But again that gives an error. How can I connect 2 different classes in order to send a signal? Thanks beforehand.
P.S: I am a total newbie to QT, so please explain it accordingly .
Bookmarks