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

Fix various QSignalSpy issues

    XMLWordPrintable

Details

    • Task
    • Resolution: Fixed
    • P2: Important
    • 6.8.0 FF
    • None
    • Testing: qtestlib
    • None
    • 8
    • b97bcdd77 (dev), d5d2688ac (dev), edb8bac39 (dev), 0c343c4c8 (6.7), e68edd6a0 (dev), 2f3902723 (dev), b4c588793 (dev), d2dbe2d7f (dev), fa5cb8406 (dev), b13131027 (6.7), 7bff20c9f (dev), d2436f729 (dev), 88b5b1bce (dev), ad755020e (dev), 8ab63278e (dev)
    • Foundation Sprint 103, Foundation Sprint 104, Foundation Sprint 105, Foundation Sprint 106

    Description

      The review of dfaure_kdab's race condition fix¹ reminded me that QSignalSpy is on the blockers for adding -Wweak-vtable (², QTBUG-45582). In fact, the whole class can and should be de-inlined, and if we'd manage to make the args and sig members const, we'd be able to move the mutex lock out of initArgs() and, in appendArgs(), move it lower, covering just the QList::append() there, which, incidentally, should use the rvalue append() overload. The template ctor could use a dose of DRY/SCARY.

      We could also think about removing the QObject inheritance (and use a private QObject for that), or at least make the inheritance private. There's really no reason for users of the class to treat it as a QObject.

      Acceptance criteria:

      • Use topic:QSignalSpy
      • QSignalSpy is completely de-inlined into a new .cpp file
        • incl. newly-added dtor
        • except trivial functions like isValid() or signature().
      • template ctor is SCARY
      • args and sig members are const
      • mutex use is limited to absolutely necessary
      • the QVariantList in appendArgs() is moved into *this

      References:

      1. https://codereview.qt-project.org/c/qt/qtbase/+/547140
      2. https://codereview.qt-project.org/c/qt/qtbase/+/242624

      Attachments

        Issue Links

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

          Activity

            People

              mmutz Marc Mutz
              mmutz Marc Mutz
              Vladimir Minenko Vladimir Minenko
              Alex Blasche Alex Blasche
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes