Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Add QLocale #1086

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

nicolasfella
Copy link

Not complete yet because:

  • It's a lot
  • I'm not sure how to wrap some API

#[rust_name = "first_day_of_week"]
fn firstDayOfWeek(self: &QLocale) -> DayOfWeek;

// QString QLocale::formattedDataSize(qint64 bytes, int precision = 2, QLocale::DataSizeFormats format = DataSizeIecFormat) const
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DataSizeFormats is QFlags, do we have prior art on how to model that?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We unfortunately don't have anything for flags yet i don't think, we support enums but not flags.

@LeonMatthesKDAB something to figure out for 0.8 ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, sounds useful to find an ergonomic way to use Flags for 0.8. We don't have anything yet though.

@nicolasfella nicolasfella force-pushed the work/nico/qlocale branch 2 times, most recently from 7a3503e to 66a08f2 Compare October 1, 2024 18:52
@nicolasfella
Copy link
Author

Added a test

@nicolasfella nicolasfella force-pushed the work/nico/qlocale branch 3 times, most recently from 05c8552 to 018040e Compare October 8, 2024 15:00
_cspec: MaybeUninit<usize>,
}

impl Default for QLocale {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As QLocale is not trivially copyable or destructible can you add a impl Clone for QLocale and a impl Drop for QLocale implementation similar to other places (note we have templates for those too eg see how QString is done)

}
}

fn construct_qlocale() -> QLocale {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

once you have Clone implemented you could add a clone test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants