Skip to content

Add qelapsedtimer support #762

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

Closed
wants to merge 2 commits into from
Closed

Conversation

Montel
Copy link
Contributor

@Montel Montel commented Nov 28, 2023

No description provided.

@Montel Montel requested a review from ahayzen-kdab November 28, 2023 15:54
@Montel Montel self-assigned this Nov 28, 2023
/// The QRect struct defines a rectangle in the plane using integer precision.
#[derive(Debug, Clone, PartialEq, Eq)]
#[repr(C)]
pub struct QElapsedTimer {
Copy link
Collaborator

Choose a reason for hiding this comment

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

assume we want a QElapsedTimer in Rust and you don't just use the std stuff, guess it's still useful to have the Qt ones?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it's useful to have Qt class for user which wants to use cxx-qt

Copy link
Collaborator

Choose a reason for hiding this comment

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

Having not needed QElapsedTimer yet, I'd prefer if this was in cxx-qt-lib-extra.
As you've already wrapped it for this PR, there's no reason to throw this away, but I also don't know if it's worth adding it to our maintenance list.

In my opinion, CXX-Qt-lib should only wrap the most fundamental types without which Qt as a framework is hardly usable. The main benefit of CXX-Qt as a framework is not to provide the most exhaustive list of wrapped Qt API, but rather that it provides you with the bare minimum and makes it easy to wrap everything else you may need yourself.
Of course wrapping more in CXX-Qt is going to be easier for our users,, but I think not maintainable, given the enormous size of Qt.

Overall, we need a good guideline to decide which types to wrap in CXX-Qt-lib and which not.
I agree that stuff like QMargins is not really fundamental, so probably shouldn't have been added to CXX-Qt-lib. We could even consider moving it out of lib for 0.7.
A first draft of such a guideline:

  • Default to adding anything you think may be useful to CXX-Qt-lib-extra
  • Only add types to CXX-Qt-lib directly, if they're both:
    • Hard to wrap optimally (i.e. should be trivial/templates, etc.)
    • Are often used as parameters/return values within the Qt codebase
  • We can then always promote types from lib-extra to lib, if/when people request this.

I've added an issue about this, see: #766

@Montel Montel closed this Feb 23, 2024
@Montel
Copy link
Contributor Author

Montel commented Feb 23, 2024

Merge in #860

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