diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index 83de88bd7ec..43576b4aa40 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -922,6 +922,18 @@ qt_internal_extend_target(Core time/qtimezoneprivate_win.cpp ) +qt_internal_extend_target(Core + CONDITION QT_FEATURE_timezone_locale + SOURCES + time/qtimezonelocale.cpp time/qtimezonelocale_p.h +) + +qt_internal_extend_target(Core + CONDITION QT_FEATURE_timezone_locale AND NOT QT_FEATURE_icu + SOURCES + time/qtimezonelocale_data_p.h +) + qt_internal_extend_target(Core CONDITION QT_FEATURE_datetimeparser SOURCES time/qdatetimeparser.cpp time/qdatetimeparser_p.h diff --git a/src/corelib/configure.cmake b/src/corelib/configure.cmake index be628fcf048..58329d3b8f0 100644 --- a/src/corelib/configure.cmake +++ b/src/corelib/configure.cmake @@ -805,6 +805,12 @@ qt_feature("timezone" PUBLIC PURPOSE "Provides support for time-zone handling." CONDITION NOT WASM AND NOT VXWORKS ) +qt_feature("timezone_locale" PRIVATE + SECTION "Utilities" + LABEL "QTimeZone" + PURPOSE "Provides support for localized time-zone display names." + DISABLE ON # Implementation is currently incomplete, so leave turned off +) qt_feature("datetimeparser" PRIVATE SECTION "Utilities" LABEL "QDateTimeParser" diff --git a/src/corelib/time/qtimezonelocale.cpp b/src/corelib/time/qtimezonelocale.cpp new file mode 100644 index 00000000000..5757e55d285 --- /dev/null +++ b/src/corelib/time/qtimezonelocale.cpp @@ -0,0 +1,29 @@ +// Copyright (C) 2024 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 + +#include +#include + +#if !QT_CONFIG(icu) // Use data generated from CLDR: +# include +# include +#endif + +QT_BEGIN_NAMESPACE + +#if QT_CONFIG(icu) // Get data from ICU: +namespace QtTimeZoneLocale { + +} // QtTimeZoneLocale +#else // No ICU, use QTZ[LP}_data_p.h data for feature timezone_locale. +namespace { +using namespace QtTimeZoneLocale; // QTZL_data_p.h +using namespace QtTimeZoneCldr; // QTZP_data_p.h +// Accessors for the QTZL_data_p.h + +// Accessors for the QTZP_data_p.h + +} // nameless namespace +#endif // ICU + +QT_END_NAMESPACE diff --git a/src/corelib/time/qtimezonelocale_data_p.h b/src/corelib/time/qtimezonelocale_data_p.h new file mode 100644 index 00000000000..1cdbbaa952a --- /dev/null +++ b/src/corelib/time/qtimezonelocale_data_p.h @@ -0,0 +1,39 @@ +// Copyright (C) 2024 The Qt Company Ltd. +// SPDX-License-Identifier: Unicode-3.0 + +#ifndef QTIMEZONELOCALE_DATA_P_H +#define QTIMEZONELOCALE_DATA_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of internal files. This header file may change from version to version +// without notice, or even be removed. +// +// We mean it. +// + +// Only qtimezonelocale.cpp should #include this (after other things it needs), +// and even that only when feature icu is disabled. +#include "qtimezonelocale_p.h" + +QT_REQUIRE_CONFIG(timezone_locale); +#if QT_CONFIG(icu) +# error "This file should only be needed (or seen) when ICU is not in use" +#endif + +QT_BEGIN_NAMESPACE + +namespace QtTimeZoneLocale { + +// GENERATED PART STARTS HERE + +// GENERATED PART ENDS HERE + +} // QtTimeZoneLocale + +QT_END_NAMESPACE + +#endif // QTIMEZONELOCALE_DATA_P_H diff --git a/src/corelib/time/qtimezonelocale_p.h b/src/corelib/time/qtimezonelocale_p.h new file mode 100644 index 00000000000..2b2c4451d80 --- /dev/null +++ b/src/corelib/time/qtimezonelocale_p.h @@ -0,0 +1,30 @@ +// Copyright (C) 2024 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 QTIMEZONELOCALE_P_H +#define QTIMEZONELOCALE_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of internal files. This header file may change from version to version +// without notice, or even be removed. +// +// We mean it. +// + +#include + +QT_REQUIRE_CONFIG(timezone_locale); + +namespace QtTimeZoneLocale { +#if QT_CONFIG(icu) +#else +// Define data types for QTZL_data_p.h + +#endif +} + +#endif // QTIMEZONELOCALE_P_H