QSharedMemoryLocker: make ctor explicit

A QSharedMemory* is not a faithful representation of a
QSharedMemoryLocker, so the resp. converting ctor should be explicit.

Found in API-review.

Pick-to: 6.7
Change-Id: I2267a193868c4d0979f59ed0847a0e4af64ffe76
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit 54a57b1e6a011450bc4549abb98141e2440c3f6a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Marc Mutz 2024-06-06 10:38:52 +02:00 committed by Qt Cherry-pick Bot
parent dbb945fd43
commit 1f34a9b270

View File

@ -43,7 +43,8 @@ class QSharedMemoryLocker
{
Q_DISABLE_COPY(QSharedMemoryLocker)
public:
Q_NODISCARD_CTOR QSharedMemoryLocker(QSharedMemory *sharedMemory) : q_sm(sharedMemory)
Q_NODISCARD_CTOR explicit QSharedMemoryLocker(QSharedMemory *sharedMemory)
: q_sm(sharedMemory)
{
Q_ASSERT(q_sm);
}