Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions crates/cxx-qt-lib-extras/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ fn main() {
"core/qelapsedtimer",
"core/qcommandlineoption",
"core/qcommandlineparser",
"core/qlocale",
"gui/qapplication",
];

Expand All @@ -67,6 +68,7 @@ fn main() {
"core/qelapsedtimer",
"core/qcommandlineoption",
"core/qcommandlineparser",
"core/qlocale",
"gui/qapplication",
];

Expand Down
28 changes: 28 additions & 0 deletions crates/cxx-qt-lib-extras/include/core/qlocale.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// clang-format off
// SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
// clang-format on
// SPDX-FileContributor: Nicolas Fella <nicolas.fella@kdab.com>
//
// SPDX-License-Identifier: MIT OR Apache-2.0
#pragma once

#include <QtCore/QLocale>

#include "rust/cxx.h"

namespace rust {

template<>
struct IsRelocatable<QLocale> : ::std::true_type
{};

namespace cxxqtlib1 {

using QLocaleTagSeparator = QLocale::TagSeparator;
using QLocaleCurrencySymbolFormat = QLocale::CurrencySymbolFormat;
using QLocaleFormatType = QLocale::FormatType;
using QLocaleLanguage = QLocale::Language;
using QLocaleMeasurementSystem = QLocale::MeasurementSystem;

}
}
6 changes: 6 additions & 0 deletions crates/cxx-qt-lib-extras/src/core/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,9 @@ pub use qcommandlineoption::QCommandLineOption;

mod qcommandlineparser;
pub use qcommandlineparser::QCommandLineParser;

mod qlocale;
pub use qlocale::{
QLocale, QLocaleCurrencySymbolFormat, QLocaleFormatType, QLocaleLanguage,
QLocaleMeasurementSystem, QLocaleTagSeparator,
};
17 changes: 17 additions & 0 deletions crates/cxx-qt-lib-extras/src/core/qlocale.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// clang-format off
// SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
// clang-format on
// SPDX-FileContributor: Nicolas Fella <nicolas.fella@kdab.com>
//
// SPDX-License-Identifier: MIT OR Apache-2.0
#include "cxx-qt-lib-extras/qlocale.h"
#include <cxx-qt-lib/assertion_utils.h>

assert_alignment_and_size(QLocale, { ::std::size_t a0; });

static_assert(!::std::is_trivially_copy_assignable<QLocale>::value);
static_assert(!::std::is_trivially_copy_constructible<QLocale>::value);

static_assert(!::std::is_trivially_destructible<QLocale>::value);

static_assert(QTypeInfo<QLocale>::isRelocatable);
Loading
Loading