Please help me find my "connect" error
-
I have copied this from working QT example and cannot make it work.
I am obviously lost interpreting the error and could use help to fix it.Thanks
My definitions / declarations:
connect(localDevice,SIGNAL(pairingFinished(QBluetoothAddress,QBluetoothLocalDevice::Pairing)),this,SLOT(pairingDone(QBluetoothAddress,QBluetoothLocalDevice::Pairing))); private slots: void pairingDone(const QBluetoothAddress, QBluetoothLocalDevice::Pairing); void BT_SPP_Connect_MainWindow::pairingDone(const QBluetoothAddress &address, QBluetoothLocalDevice::Pairing pairing) {........ and the error given
/mnt/07b7c3f8-0efb-45ab-8df8-2a468771de1f/PROJECTS/JAN21/BT_JAN26_LIST/CCC_SOURCE/Bluetoooth_SPP_Connect/bt_spp_connect_mainwindow.cpp:400: error: no matching member function for call to 'connect' bt_spp_connect_mainwindow.cpp:400:1: error: no matching member function for call to 'connect' connect(localDevice,SIGNAL(pairingFinished(QBluetoothAddress&,QBluetoothLocalDevice::Pairing)),this,SLOT(pairingDone(QBluetoothAddress,QBluetoothLocalDevice::Pairing))); ^~~~~~~ /home/nov25-1/Qt/Nov26/5.15.2/gcc_64/include/QtCore/qobject.h:222:36: note: candidate function not viable: no known conversion from 'QBluetoothLocalDevice' to 'const QObject *' for 1st argument; take the address of the argument with & static QMetaObject::Connection connect(const QObject *sender, const char *signal, ^ /home/nov25-1/Qt/Nov26/5.15.2/gcc_64/include/QtCore/qobject.h:225:36: note: candidate function not viable: no known conversion from 'QBluetoothLocalDevice' to 'const QObject *' for 1st argument; take the address of the argument with & static QMetaObject::Connection connect(const QObject *sender, const QMetaMethod &signal, ^ /home/nov25-1/Qt/Nov26/5.15.2/gcc_64/include/QtCore/qobject.h:481:41: note: candidate function not viable: no known conversion from 'QBluetoothLocalDevice' to 'const QObject *' for 1st argument; take the address of the argument with & inline QMetaObject::Connection QObject::connect(const QObject *asender, const char *asignal, ^ /home/nov25-1/Qt/Nov26/5.15.2/gcc_64/include/QtCore/qobject.h:242:43: note: candidate template ignored: substitution failure [with Func1 = const char *, Func2 = const char *]: no type named 'Object' in 'QtPrivate::FunctionPointer<const char *>' static inline QMetaObject::Connection connect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal, ^ ~~~~~~ /home/nov25-1/Qt/Nov26/5.15.2/gcc_64/include/QtCore/qobject.h:283:13: note: candidate template ignored: requirement 'int(QtPrivate::FunctionPointer<const char *>::ArgumentCount) >= 0 && !QtPrivate::FunctionPointer<const char *>::IsPointerToMemberFunction' was not satisfied [with Func1 = const char *, Func2 = const char *] connect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal, const QObject *context, Func2 slot, ^ /home/nov25-1/Qt/Nov26/5.15.2/gcc_64/include/QtCore/qobject.h:322:13: note: candidate template ignored: substitution failure [with Func1 = const char *, Func2 = const char *]: no type named 'Object' in 'QtPrivate::FunctionPointer<const char *>' connect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal, const QObject *context, Func2 slot, ^ ~~~~~~ /home/nov25-1/Qt/Nov26/5.15.2/gcc_64/include/QtCore/qobject.h:274:13: note: candidate function template not viable: requires 3 arguments, but 4 were provided connect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal, Func2 slot) ^ /home/nov25-1/Qt/Nov26/5.15.2/gcc_64/include/QtCore/qobject.h:314:13: note: candidate function template not viable: requires 3 arguments, but 4 were provided connect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal, Func2 slot) ^ -
I have copied this from working QT example and cannot make it work.
I am obviously lost interpreting the error and could use help to fix it.Thanks
My definitions / declarations:
connect(localDevice,SIGNAL(pairingFinished(QBluetoothAddress,QBluetoothLocalDevice::Pairing)),this,SLOT(pairingDone(QBluetoothAddress,QBluetoothLocalDevice::Pairing))); private slots: void pairingDone(const QBluetoothAddress, QBluetoothLocalDevice::Pairing); void BT_SPP_Connect_MainWindow::pairingDone(const QBluetoothAddress &address, QBluetoothLocalDevice::Pairing pairing) {........ and the error given
/mnt/07b7c3f8-0efb-45ab-8df8-2a468771de1f/PROJECTS/JAN21/BT_JAN26_LIST/CCC_SOURCE/Bluetoooth_SPP_Connect/bt_spp_connect_mainwindow.cpp:400: error: no matching member function for call to 'connect' bt_spp_connect_mainwindow.cpp:400:1: error: no matching member function for call to 'connect' connect(localDevice,SIGNAL(pairingFinished(QBluetoothAddress&,QBluetoothLocalDevice::Pairing)),this,SLOT(pairingDone(QBluetoothAddress,QBluetoothLocalDevice::Pairing))); ^~~~~~~ /home/nov25-1/Qt/Nov26/5.15.2/gcc_64/include/QtCore/qobject.h:222:36: note: candidate function not viable: no known conversion from 'QBluetoothLocalDevice' to 'const QObject *' for 1st argument; take the address of the argument with & static QMetaObject::Connection connect(const QObject *sender, const char *signal, ^ /home/nov25-1/Qt/Nov26/5.15.2/gcc_64/include/QtCore/qobject.h:225:36: note: candidate function not viable: no known conversion from 'QBluetoothLocalDevice' to 'const QObject *' for 1st argument; take the address of the argument with & static QMetaObject::Connection connect(const QObject *sender, const QMetaMethod &signal, ^ /home/nov25-1/Qt/Nov26/5.15.2/gcc_64/include/QtCore/qobject.h:481:41: note: candidate function not viable: no known conversion from 'QBluetoothLocalDevice' to 'const QObject *' for 1st argument; take the address of the argument with & inline QMetaObject::Connection QObject::connect(const QObject *asender, const char *asignal, ^ /home/nov25-1/Qt/Nov26/5.15.2/gcc_64/include/QtCore/qobject.h:242:43: note: candidate template ignored: substitution failure [with Func1 = const char *, Func2 = const char *]: no type named 'Object' in 'QtPrivate::FunctionPointer<const char *>' static inline QMetaObject::Connection connect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal, ^ ~~~~~~ /home/nov25-1/Qt/Nov26/5.15.2/gcc_64/include/QtCore/qobject.h:283:13: note: candidate template ignored: requirement 'int(QtPrivate::FunctionPointer<const char *>::ArgumentCount) >= 0 && !QtPrivate::FunctionPointer<const char *>::IsPointerToMemberFunction' was not satisfied [with Func1 = const char *, Func2 = const char *] connect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal, const QObject *context, Func2 slot, ^ /home/nov25-1/Qt/Nov26/5.15.2/gcc_64/include/QtCore/qobject.h:322:13: note: candidate template ignored: substitution failure [with Func1 = const char *, Func2 = const char *]: no type named 'Object' in 'QtPrivate::FunctionPointer<const char *>' connect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal, const QObject *context, Func2 slot, ^ ~~~~~~ /home/nov25-1/Qt/Nov26/5.15.2/gcc_64/include/QtCore/qobject.h:274:13: note: candidate function template not viable: requires 3 arguments, but 4 were provided connect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal, Func2 slot) ^ /home/nov25-1/Qt/Nov26/5.15.2/gcc_64/include/QtCore/qobject.h:314:13: note: candidate function template not viable: requires 3 arguments, but 4 were provided connect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal, Func2 slot) ^@AnneRanch said in Please help me find my "connect" error:
localDevice
connect() needs a pointer as first and third argument, not an object
-
C Christian Ehrlicher referenced this topic on