Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-100071

QtFuture::connect fails to compile if the passed signal takes a std::tuple as argument

    XMLWordPrintable

Details

    • 5
    • f2f5c7d2b7 (qt/qtbase/dev) f2f5c7d2b7 (qt/tqtc-qtbase/dev) a5fa1ee822 (qt/qtbase/6.3) a5fa1ee822 (qt/tqtc-qtbase/6.3) 8c1d506a21 (qt/qtbase/6.2) 8c1d506a21 (qt/tqtc-qtbase/6.2)
    • Team One Foundation Sprint 50

    Description

      The following code fails to compile:

      class Sender : public QObject
      {
          Q_OBJECT
      
      signals:
          void testSignal(std::tuple<int, int>);
      };
      
      auto future = QtFuture::connect(&obj, &Sender::testSignal);
      

      with the following error:

      ../qtbase/src/corelib/thread/qfuture_impl.h:913: error: no matching function for call to ‘QFutureInterface<std::tuple<int, int> >::reportResult(std::tuple<std::tuple<int, int> >)’
      ../../cmake-build/qtbase/include/QtCore/../../../../qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:360:29:   required from ‘struct QtPrivate::ComputeFunctorArgumentCount<QtFuture::connect(Sender*, Signal) [with Sender = Sender; Signal = void (Sender::*)(std::tuple<int, int>); <template-parameter-1-3> = void; typename QtPrivate::ArgResolver<Callable>::AllArgs = std::tuple<int, int>]::<lambda(auto:30 ...)>, QtPrivate::List<std::tuple<int, int> > >’
      ../../cmake-build/qtbase/include/QtCore/../../../../qt5/qtbase/src/corelib/kernel/qobject.h:326:19:   required from ‘static typename std::enable_if<((QtPrivate::FunctionPointer<Func2>::ArgumentCount == -1) && (! is_convertible_v<Func2, const char*>)), QMetaObject::Connection>::type QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, const QObject*, Func2, Qt::ConnectionType) [with Func1 = void (Sender::*)(std::tuple<int, int>); Func2 = QtFuture::connect(Sender*, Signal) [with Sender = Sender; Signal = void (Sender::*)(std::tuple<int, int>); <template-parameter-1-3> = void; typename QtPrivate::ArgResolver<Callable>::AllArgs = std::tuple<int, int>]::<lambda(auto:30 ...)>; typename std::enable_if<((QtPrivate::FunctionPointer<Func2>::ArgumentCount == -1) && (! is_convertible_v<Func2, const char*>)), QMetaObject::Connection>::type = QMetaObject::Connection; typename QtPrivate::FunctionPointer<Func>::Object = Sender]’
      ../../cmake-build/qtbase/include/QtCore/../../../../qt5/qtbase/src/corelib/thread/qfuture_impl.h:909:46:   required from ‘QFuture<typename QtPrivate::ArgResolver<Callable>::AllArgs> QtFuture::connect(Sender*, Signal) [with Sender = Sender; Signal = void (Sender::*)(std::tuple<int, int>); <template-parameter-1-3> = void; typename QtPrivate::ArgResolver<Callable>::AllArgs = std::tuple<int, int>]’
      ../untitled3/mainwindow.cpp:14:62:   required from here
      ../../cmake-build/qtbase/include/QtCore/../../../../qt5/qtbase/src/corelib/thread/qfuture_impl.h:913:51: error: no matching function for call to ‘QFutureInterface<std::tuple<int, int> >::reportResult(std::tuple<std::tuple<int, int> >)’
        913 |                                                   promise.reportResult(QtPrivate::createTuple(
            |                                                   ^~~~~~~
      

      Attachments

        For Gerrit Dashboard: QTBUG-100071
        # Subject Branch Project Status CR V

        Activity

          People

            sonakur Sona Kurazyan
            sonakur Sona Kurazyan
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes