Allow me to take this one step ant at time.
Do you see this message? Note that connect() does not return a bool, it returns an object of type QMetaObject::Connection. However, this class does have a bool() cast operator, which does return true if the connection was made. So you lucked out with this.
Yes I see the message.
"if" construct been checking for VALIDITY of content of parenthesis NOT for bool which is NOT basic C construct since conception.
( All these "false " "bool" etc. are crutches to make think complicated , not helpful...)
The "connect" returns "handle" (YUCK ) and Qt implementation of language is doing exactly what it suppose to do - checks for VALIDITY of "handle".
Changing the connect to EXACTLY match the SIGNAL / SLOT "signature" did not change the results - no message.
Adding some more scaffolding I actually get helpful errors
if(
(bool)
connect(
deviceIquiry,
SIGNAL(sendStatus
(const QString &)),
this,
SLOT(displayStatusMessage
(QString &)) )
)
std::cout <<"SUCCESS SIGNALS / SLOTS CONNECTED "<< std::endl;
else
{
std::cout <<"FAILED CONNECTION " <<std::endl;
exit(-1);
}
if(
(bool)
connect(
deviceIquiry,SIGNAL(sendStatus(const QString &)),
this,SLOT(displayStatusMessage(QString &))
)
)
std::cout <<"SUCCESS SIGNALS / SLOTS CONNECTED "<< std::endl;
else
{
std::cout <<"FAILED CONNECTION " <<std::endl;
exit(-1);
}
To copy to clipboard, switch view to plain text mode
function BT_FormDeviceInquiry
file ../CAT_BT/bt_formdeviceinquiry.cpp
line # 143
SUCCESS SIGNALS / SLOTS CONNECTED
FAILED CONNECTION
BT_FormDeviceInquiry *deviceIquiry : No such device or address
BT_FormDeviceInquiry *deviceIquiry : Resource temporarily unavailable
TEST: Resource temporarily unavailable
QObject::connect: No such slot MainWindow::displayStatusMessage(QString &) in ../CAT_BT/mainwindow.cpp:62
QObject::connect: (sender name: 'DeviceDiscovery')
QObject::connect: (receiver name: 'MainWindow')
/media/z/DEV_COPY_LABEL/Qt/QT/qtconnectivity/examples/bluetooth/build-CAT_BT-Desktop-Debug/btscanner exited with code 255
I'll check the other stuff soon.
Again, appreciate your support.
Bookmarks