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

Comparison of function PMFs to virtual functions is flawed in QObject::disconnect

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.0.0, 5.7.0 RC
    • Core: Object Model
    • None

    Description

      Take the following excerpt:

          QVERIFY(QObject::connect(&sender, &SenderObject::signal1, &o, public_slot));
      
          // disconnect the *private* virtual
          QVERIFY(!QObjectPrivate::disconnect(&sender, &SenderObject::signal1, o.d_func(), private_slot));
      

      It's possible that the disconnect of the private will disconnect the public because public_slot and private_slot may have the same representation if they're both pointers to virtual member functions.

      Testcase patch attached, currently produces:

      FAIL!  : tst_QObject::disconnectPrivateVirtualSlots() '!QObjectPrivate::disconnect(&sender, &SenderObject::signal1, o.d_func(), private_slot)' returned FALSE. ()
      

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            thiago Thiago Macieira
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes