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

QObject::connect(): clarify what a valid method is, in the string-based overloads

XMLWordPrintable

    • fddf130ad (6.10), 8a81dd0aa (6.9), 5c77e9835 (tqtc/lts-6.8), bcfb0eec1 (tqtc/lts-6.5), 3b0da20d1 (dev), 70181731a (6.10), 304183cd1 (tqtc/lts-6.8), de721cf59 (tqtc/lts-6.5), 612009956 (dev), 7f6d53808 (dev), 6bcb1a43d (6.10), beb3e9644 (tqtc/lts-6.8)

      In the string-based overloads:

      bool QObject::{dis,}connect(const QObject *sender, const char *signal,
                               const QObject *receiver, const char *method)
      

      For testing, method must be a function declared as a signal or as a slot, not other member functions work with these overloads. Unlike the pointer-to-member-function overloads, where "method" can be any member function that can be connected to the signal, regardless of whether it's declared as a slot or not.

      I propose adding something like:

          \a signal must be a function declared as a signal in \a sender.
          \a method must be a function declared as a signal or a slot in \a receiver.
      

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

            ahmad.samir Ahmad Samir
            ahmad.samir Ahmad Samir
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: