Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Please help me find my "connect" error

Please help me find my "connect" error

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 439 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Anonymous_Banned275
    wrote on last edited by
    #1

    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)
                ^
    
    Christian EhrlicherC 1 Reply Last reply
    0
    • A Anonymous_Banned275

      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)
                  ^
      
      Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @AnneRanch said in Please help me find my "connect" error:

      localDevice

      connect() needs a pointer as first and third argument, not an object

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      1
      • Christian EhrlicherC Christian Ehrlicher referenced this topic on

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved