mirror of
https://github.com/qmlnet/qmlnet.git
synced 2026-05-15 14:15:54 -06:00
[GH-ISSUE #15] Support for accessing embedded .NET resources within Qml. #12
Labels
No labels
bug
enhancement
help wanted
help wanted
pull-request
question
todo
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/qmlnet#12
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @pauldotknopf on GitHub (Jul 18, 2018).
Original GitHub issue: https://github.com/qmlnet/qmlnet/issues/15
https://wiki.qt.io/QtResources
We'd have to pinvoke the data into a special C struct that Qt can use to register it as a resource that can be loaded in Qml (whether it's other Qml files, or images, etc).
@pauldotknopf commented on GitHub (Jul 18, 2018):
Here is how to get a raw pointer to the embedded resource for usage in Qt: https://stackoverflow.com/questions/51406733/net-embedded-resource-getting-an-intptr-to-the-raw-memory-location-for-use-in/51407990#51407990
@shartte commented on GitHub (Apr 13, 2020):
While true, having to copy the resource data in-memory and keep it around (because it needs to be in the RCC format apparently) seems wasteful.
Here's what I'll actually attempt for my project:
@pauldotknopf commented on GitHub (Apr 13, 2020):
The pointer to the embedded resource is a static non-changing pointer. I believe it's in memory at all times, the moment the .NET dll is loaded.
I do like your idea though, the more we can set on top of traditional/supported APIs, the better, and manually building that struct sounds problematic.
@shartte commented on GitHub (Apr 13, 2020):
The challenge of making this developer-friendly will most likely be providing a NuGet package that has:
I might look into this soon.
@pauldotknopf commented on GitHub (Apr 13, 2020):
Are you using unmanaged hosting or unmanaged hosting?
@shartte commented on GitHub (Apr 14, 2020):
I am using managed hosting with some extra custom native glue.
@vadi2 commented on GitHub (May 10, 2021):
@shartte did you get this working? Would like to embed resources for quicker startup performance.
@shartte commented on GitHub (May 10, 2021):
I don't think I actually completed this. I had to go back and search and couldn't find it :-(
The general idea however should still be sound. But writing MSBuild tasks is certainly not "fun".