From 4fa9f13397abf5da44a0fbd70692fa2c8f79ac13 Mon Sep 17 00:00:00 2001 From: Rym Bouabid Date: Fri, 29 Sep 2023 18:12:21 +0200 Subject: [PATCH] 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 --- src/corelib/CMakeLists.txt | 2 +- ...ollback_p.h => qatomicscopedvaluerollback.h} | 17 +++-------------- .../tools/qatomicscopedvaluerollback.qdoc | 3 +-- .../qatomicscopedvaluerollback/CMakeLists.txt | 2 -- .../tst_qatomicscopedvaluerollback.cpp | 2 +- tests/auto/corelib/tools/qlist/tst_qlist.cpp | 2 +- 6 files changed, 7 insertions(+), 21 deletions(-) rename src/corelib/tools/{qatomicscopedvaluerollback_p.h => qatomicscopedvaluerollback.h} (91%) diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index 0edec96c994..70f6347546c 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -271,7 +271,7 @@ qt_internal_add_module(Core tools/qarraydata.cpp tools/qarraydata.h tools/qarraydataops.h tools/qarraydatapointer.h - tools/qatomicscopedvaluerollback_p.h + tools/qatomicscopedvaluerollback.h tools/qbitarray.cpp tools/qbitarray.h tools/qcache.h tools/qcontainerfwd.h diff --git a/src/corelib/tools/qatomicscopedvaluerollback_p.h b/src/corelib/tools/qatomicscopedvaluerollback.h similarity index 91% rename from src/corelib/tools/qatomicscopedvaluerollback_p.h rename to src/corelib/tools/qatomicscopedvaluerollback.h index c3b48f8855b..84162ddffe4 100644 --- a/src/corelib/tools/qatomicscopedvaluerollback_p.h +++ b/src/corelib/tools/qatomicscopedvaluerollback.h @@ -1,19 +1,8 @@ // 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 -#ifndef QATOMICSCOPEDVALUEROLLBACK_P_H -#define QATOMICSCOPEDVALUEROLLBACK_P_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. -// +#ifndef QATOMICSCOPEDVALUEROLLBACK_H +#define QATOMICSCOPEDVALUEROLLBACK_H #include #include @@ -135,4 +124,4 @@ QAtomicScopedValueRollback(QBasicAtomicPointer &, std::memory_order) QT_END_NAMESPACE -#endif // QATOMICASCOPEDVALUEROLLBACK_P_H +#endif // QATOMICASCOPEDVALUEROLLBACK_H diff --git a/src/corelib/tools/qatomicscopedvaluerollback.qdoc b/src/corelib/tools/qatomicscopedvaluerollback.qdoc index 76b27399320..7d5344cb607 100644 --- a/src/corelib/tools/qatomicscopedvaluerollback.qdoc +++ b/src/corelib/tools/qatomicscopedvaluerollback.qdoc @@ -5,12 +5,11 @@ QT_BEGIN_NAMESPACE /*! \class QAtomicScopedValueRollback - \internal \inmodule QtCore \brief Provides a QScopedValueRollback for atomic variables. \ingroup misc \ingroup tools - \since 6.5 + \since 6.7 The QAtomicScopedValueRollback class resets an atomic variable to its prior value on destruction. It can be used to revert state when an diff --git a/tests/auto/corelib/tools/qatomicscopedvaluerollback/CMakeLists.txt b/tests/auto/corelib/tools/qatomicscopedvaluerollback/CMakeLists.txt index a67bfcc4cd4..b20e56421f4 100644 --- a/tests/auto/corelib/tools/qatomicscopedvaluerollback/CMakeLists.txt +++ b/tests/auto/corelib/tools/qatomicscopedvaluerollback/CMakeLists.txt @@ -10,6 +10,4 @@ endif() qt_internal_add_test(tst_qatomicscopedvaluerollback SOURCES tst_qatomicscopedvaluerollback.cpp - LIBRARIES - Qt::CorePrivate ) diff --git a/tests/auto/corelib/tools/qatomicscopedvaluerollback/tst_qatomicscopedvaluerollback.cpp b/tests/auto/corelib/tools/qatomicscopedvaluerollback/tst_qatomicscopedvaluerollback.cpp index 8a56d957bd2..cbc4eb43d4c 100644 --- a/tests/auto/corelib/tools/qatomicscopedvaluerollback/tst_qatomicscopedvaluerollback.cpp +++ b/tests/auto/corelib/tools/qatomicscopedvaluerollback/tst_qatomicscopedvaluerollback.cpp @@ -1,7 +1,7 @@ // Copyright (C) 2022 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 -#include +#include #include diff --git a/tests/auto/corelib/tools/qlist/tst_qlist.cpp b/tests/auto/corelib/tools/qlist/tst_qlist.cpp index 743028351c7..d731d9e311a 100644 --- a/tests/auto/corelib/tools/qlist/tst_qlist.cpp +++ b/tests/auto/corelib/tools/qlist/tst_qlist.cpp @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include