QXmlString: fix ADL swap

The classical Q_DECLARE_SHARED assumes it's placed right next to the
class in the same namespace as its argument type. If that is not the
case, then the free swap() function might not be found using ADL,
since it was defined in  an outer namespace. Since 6.8, we have
NS-aware Q_DECLARE_SHARED versions, so use that.

Change-Id: I2969c641b501b07b4ebb9fce46d2544bf788fc9b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 877fe0e7b3aada3f99bbf0415cba9daf97b067db)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Marc Mutz 2024-08-27 18:40:26 +02:00 committed by Qt Cherry-pick Bot
parent 5d23f03860
commit 3b7f21996e

View File

@ -36,7 +36,7 @@ public:
};
}
Q_DECLARE_SHARED(QtPrivate::QXmlString)
Q_DECLARE_SHARED_NS_EXT(QtPrivate, QXmlString)
class QXmlStreamReaderPrivate;