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

Improve QImage support #746

Merged
merged 22 commits into from
Dec 15, 2023
Merged

Conversation

Montel
Copy link
Contributor

@Montel Montel commented Nov 20, 2023

No description provided.

@Montel Montel self-assigned this Nov 20, 2023
@Montel Montel force-pushed the improve_qimage_support branch from 66b9630 to 5b391a6 Compare November 21, 2023 08:59
@Montel Montel force-pushed the improve_qimage_support branch from 5b391a6 to 166fc07 Compare November 21, 2023 10:29
@Montel Montel marked this pull request as ready for review November 21, 2023 10:31
Copy link
Collaborator

@LeonMatthesKDAB LeonMatthesKDAB left a comment

Choose a reason for hiding this comment

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

There are some small things we should still add.
Apart from that, looks great 😊

It's really cool how easy it is to add new types with CXX 🥳

One thing we'll want to figure out in another PR is how to support the additional constructors specified by QImage. Especially the ones that take raw data and don't do any conversions.
Those may be performance-critical for some applications.
However, we should make sure that they are lifetime-safe and format-safe.
Introducing something like QImageRef<'a> may work.
Or maybe just taking the data (e.g. Vec<u8>/Box<[u8]>) by-value is good enough if we use the clean-up functions to clean up later.

crates/cxx-qt-lib/src/gui/qimage.rs Outdated Show resolved Hide resolved
crates/cxx-qt-lib/src/gui/qimage.rs Show resolved Hide resolved
@LeonMatthesKDAB
Copy link
Collaborator

Oh, I also forgot to mention; we're completely missing tests for QImage atm!

With proper support in this PR, we should at least have some tests to ensure the basics actually work and we don't i.e. crash when moving a QImage around!

Then you can also remove this warning in the documentation 😉

/// > ⚠ **Warning**: The QImage API in CXX-Qt-lib is not yet complete and subject to change.
///

@LeonMatthesKDAB
Copy link
Collaborator

When writing the 0.6 release notes, we just remembered: QImage isn't in the changelog, please add it as you're now making it a proper feature :)

@ahayzen-kdab
Copy link
Collaborator

@Montel while adding QImage into the changelog, you could also mention QLine / QLineF ;-)

CHANGELOG.md Outdated Show resolved Hide resolved
@Montel Montel force-pushed the improve_qimage_support branch from 541afe1 to 33aae31 Compare November 24, 2023 13:48
Copy link
Collaborator

@LeonMatthesKDAB LeonMatthesKDAB left a comment

Choose a reason for hiding this comment

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

LGTM

@LeonMatthesKDAB LeonMatthesKDAB merged commit 5745154 into KDAB:main Dec 15, 2023
6 checks passed
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