cxx-qt-lib: Add binding for QQmlApplicationEngine::addImageProvider#1142
Draft
cxx-qt-lib: Add binding for QQmlApplicationEngine::addImageProvider#1142
Conversation
Upstreamed from the patch in KDAB#785, this adds a way to add image providers written in Rust to the QML engine.
Contributor
Author
|
WIP, I would like to have some sort of example. Someone in the KDE community asked about this, so we should probably upstream the patch to cxx-qt. |
|
|
||
| /// Sets the provider to use for images requested via the image: url scheme, with host proveri_id. The QQmlEngine takes ownership of provider. | ||
| pub unsafe fn add_image_provider(self: Pin<&mut QQmlApplicationEngine>, provider_id: &QString, provider: QQmlImageProviderBasePointer) { | ||
| let ptr = match provider { |
Collaborator
There was a problem hiding this comment.
this is another case where having up/down casting would help out #562 (something we hope for this cycle). As then the method could just support the QQmlImageProviderBase* and in Rust you do upcast_ptr() when calling the method.
Collaborator
There was a problem hiding this comment.
So the casting has landed now, probably worth going through this together at some point to figure out the best way to make this work with the casting support.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Upstreamed from the patch in #785, this adds a way to add image providers written in Rust to the QML engine.