Make QAtomicScopedValueRollback public API

Move the private header to public.
Make documentation a part of public interface.

[ChangeLog][QtCore][QAtomicScopedValueRollback] New class.

Task-number: QTBUG-115107
Change-Id: I6c9f5448e74a5b62f4d97ee079944f4b1b731121
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
This commit is contained in:
Rym Bouabid 2023-09-29 18:12:21 +02:00
parent d784c14d10
commit 4fa9f13397
6 changed files with 7 additions and 21 deletions

View File

@ -271,7 +271,7 @@ qt_internal_add_module(Core
tools/qarraydata.cpp tools/qarraydata.h tools/qarraydata.cpp tools/qarraydata.h
tools/qarraydataops.h tools/qarraydataops.h
tools/qarraydatapointer.h tools/qarraydatapointer.h
tools/qatomicscopedvaluerollback_p.h tools/qatomicscopedvaluerollback.h
tools/qbitarray.cpp tools/qbitarray.h tools/qbitarray.cpp tools/qbitarray.h
tools/qcache.h tools/qcache.h
tools/qcontainerfwd.h tools/qcontainerfwd.h

View File

@ -1,19 +1,8 @@
// Copyright (C) 2022 The Qt Company Ltd. // Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QATOMICSCOPEDVALUEROLLBACK_P_H #ifndef QATOMICSCOPEDVALUEROLLBACK_H
#define QATOMICSCOPEDVALUEROLLBACK_P_H #define QATOMICSCOPEDVALUEROLLBACK_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
// of qapplication_*.cpp, qwidget*.cpp and qfiledialog.cpp. This header
// file may change from version to version without notice, or even be removed.
//
// We mean it.
//
#include <QtCore/qglobal.h> #include <QtCore/qglobal.h>
#include <QtCore/qatomic.h> #include <QtCore/qatomic.h>
@ -135,4 +124,4 @@ QAtomicScopedValueRollback(QBasicAtomicPointer<T> &, std::memory_order)
QT_END_NAMESPACE QT_END_NAMESPACE
#endif // QATOMICASCOPEDVALUEROLLBACK_P_H #endif // QATOMICASCOPEDVALUEROLLBACK_H

View File

@ -5,12 +5,11 @@ QT_BEGIN_NAMESPACE
/*! /*!
\class QAtomicScopedValueRollback \class QAtomicScopedValueRollback
\internal
\inmodule QtCore \inmodule QtCore
\brief Provides a QScopedValueRollback for atomic variables. \brief Provides a QScopedValueRollback for atomic variables.
\ingroup misc \ingroup misc
\ingroup tools \ingroup tools
\since 6.5 \since 6.7
The QAtomicScopedValueRollback class resets an atomic variable to its The QAtomicScopedValueRollback class resets an atomic variable to its
prior value on destruction. It can be used to revert state when an prior value on destruction. It can be used to revert state when an

View File

@ -10,6 +10,4 @@ endif()
qt_internal_add_test(tst_qatomicscopedvaluerollback qt_internal_add_test(tst_qatomicscopedvaluerollback
SOURCES SOURCES
tst_qatomicscopedvaluerollback.cpp tst_qatomicscopedvaluerollback.cpp
LIBRARIES
Qt::CorePrivate
) )

View File

@ -1,7 +1,7 @@
// Copyright (C) 2022 The Qt Company Ltd. // Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include <QtCore/private/qatomicscopedvaluerollback_p.h> #include <QtCore/qatomicscopedvaluerollback.h>
#include <QTest> #include <QTest>

View File

@ -5,7 +5,7 @@
#include <QAtomicInt> #include <QAtomicInt>
#include <QThread> #include <QThread>
#include <QSemaphore> #include <QSemaphore>
#include <private/qatomicscopedvaluerollback_p.h> #include <QAtomicScopedValueRollback>
#include <qlist.h> #include <qlist.h>