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

Make QSharedPointer and QWeakPointer QT_NO_SHARED_POINTER'able

    XMLWordPrintable

Details

    Description

      The classes, annoyingly, are used in QPointer and QJniObject, so some version of them needs to stay around even when QT_NO_SHARED_POINTER is defined.

      It seems to me that one way would be to rename the current classes to QSharedPointerImpl and QWeakPointerImpl and derive QSharedPointer and QWeakPointer privately from them. This should be BC an SC (thiago did something similar with QJson/CBor iterators and mmutz with QVarLengthArray), and allow to continue using the -Impl classes in the implementation of QPointer and QJniObject while being able to hide QSP and QWP behind QT_NO_SHARED_POINTER. We cannot just make QSharedPointer a typedef to QSharedPointerImpl, as that would be BiC (changes function argument mangling), so we need a real class.

      The nice thing about this is that it allows us to introduce QT_NO_SHARED_POINTER sooner than Qt 7, when we could otherwise first do something about QJniObject and QPointer ,ensuring that new code doesn't add more uses.

      Acceptance criteria:

      • (old) QWeakPointer has been renamed to QWeakPointerImpl
      • (new) QWeakPointer inherits QWeakPointerImpl and is only defined when QT_NO_SHARED_POINTER isn't
      • ditto QSharedPointer/Impl
      • QJniObject and QPointer/QObject are ported to the Impl classes
      • QT_NO_SHARED_POINTER is enabled in all modules that already don't use QSharedPointer or QWeakPointer directly

      Attachments

        Activity

          People

            cnn Qt Core & Network
            mmutz Marc Mutz
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: