Skip to content

Commit a18034f

Browse files
committed
Add QLocale
1 parent e6ee353 commit a18034f

File tree

14 files changed

+724
-5
lines changed

14 files changed

+724
-5
lines changed

crates/cxx-qt-lib-extras/build.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ fn main() {
5656
"core/qelapsedtimer",
5757
"core/qcommandlineoption",
5858
"core/qcommandlineparser",
59+
"core/qlocale",
5960
"gui/qapplication",
6061
];
6162

@@ -67,6 +68,7 @@ fn main() {
6768
"core/qelapsedtimer",
6869
"core/qcommandlineoption",
6970
"core/qcommandlineparser",
71+
"core/qlocale",
7072
"gui/qapplication",
7173
];
7274

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// clang-format off
2+
// SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
3+
// clang-format on
4+
// SPDX-FileContributor: Nicolas Fella <nicolas.fella@kdab.com>
5+
//
6+
// SPDX-License-Identifier: MIT OR Apache-2.0
7+
#pragma once
8+
9+
#include <QtCore/QLocale>
10+
11+
#include "rust/cxx.h"
12+
13+
namespace rust {
14+
15+
template<>
16+
struct IsRelocatable<QLocale> : ::std::true_type
17+
{};
18+
19+
namespace cxxqtlib1 {
20+
21+
using QLocaleTagSeparator = QLocale::TagSeparator;
22+
using QLocaleCurrencySymbolFormat = QLocale::CurrencySymbolFormat;
23+
using QLocaleFormatType = QLocale::FormatType;
24+
using QLocaleLanguage = QLocale::Language;
25+
using QLocaleMeasurementSystem = QLocale::MeasurementSystem;
26+
27+
}
28+
}

crates/cxx-qt-lib-extras/src/core/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,9 @@ pub use qcommandlineoption::QCommandLineOption;
1111

1212
mod qcommandlineparser;
1313
pub use qcommandlineparser::QCommandLineParser;
14+
15+
mod qlocale;
16+
pub use qlocale::{
17+
QLocale, QLocaleCurrencySymbolFormat, QLocaleFormatType, QLocaleLanguage,
18+
QLocaleMeasurementSystem, QLocaleTagSeparator,
19+
};
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// clang-format off
2+
// SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
3+
// clang-format on
4+
// SPDX-FileContributor: Nicolas Fella <nicolas.fella@kdab.com>
5+
//
6+
// SPDX-License-Identifier: MIT OR Apache-2.0
7+
#include "cxx-qt-lib-extras/qlocale.h"
8+
#include <cxx-qt-lib/assertion_utils.h>
9+
10+
assert_alignment_and_size(QLocale, { ::std::size_t a0; });
11+
12+
static_assert(!::std::is_trivially_copy_assignable<QLocale>::value);
13+
static_assert(!::std::is_trivially_copy_constructible<QLocale>::value);
14+
15+
static_assert(!::std::is_trivially_destructible<QLocale>::value);
16+
17+
static_assert(QTypeInfo<QLocale>::isRelocatable);

0 commit comments

Comments
 (0)