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

Support move-only functors in QObject::connect

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Done
    • P2: Important
    • 5.10
    • 5.9
    • Core: Object Model
    • None

    Description

      Move-only functors don't seem to be supported by QObject::connect().

      E.g.

          QObject *o;
          auto f = [u = std::unique_ptr<int>()](){};
          QObject::connect(o, &QObject::destroyed, std::move(f));
      

      does not compile as an attempt of copying f is made.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              ogoffart Olivier Goffart (Woboq GmbH)
              peppe Giuseppe D'Angelo
              Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes