Skip to content

How do I render a QSvgWidget? #58

Answered by shirakaba
LukeyBeachBoy asked this question in Q&A
Discussion options

You must be logged in to vote

It looks like QSvgWidget is supported in NodeGUI, but not in React NodeGUI, meaning that nobody has made a DOM interface for it yet and therefore we don't support it via HTML syntax in Svelte NodeGUI.

How to use it via imperative APIs?

The imperative APIs are all documented here, as you'll probably have seen: https://docs.nodegui.org/docs/api/generated/classes/qsvgwidget/

Calling the NSVElement.prototype.appendChild() API will only work when appending another NSVElement, e.g. NSVElement<RNSvg> (which doesn't exist – see the next section on how to implement it).

To add an SVG to the window, you'd need to check how it normally appends children under-the-hood, which appears to be via setCent…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@LukeyBeachBoy
Comment options

Answer selected by LukeyBeachBoy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants