On 10/16/2023 9:31 AM, Trevor Orr via Discuss wrote:
qt.svg: Cannot open file ':/icons/svg-default/export-lbrn.svg',
because: No such file or directory
qt.svg: Cannot open file ':/icons/svg-default/export-lbrn.svg',
because: No such file or directory
Segmentation fault
What's that colon at the front of the string?
not sure, that is what I get in the shell when I run OpenSCAD
On Monday, October 16, 2023 at 10:36:18 AM PDT, Jordan Brown <openscad@jordan.maileater.net> wrote:
On 10/16/2023 9:31 AM, Trevor Orr via Discuss wrote:
qt.svg: Cannot open file ':/icons/svg-default/export-lbrn.svg', because: No such file or directory qt.svg: Cannot open file ':/icons/svg-default/export-lbrn.svg', because: No such file or directory Segmentation fault
What's that colon at the front of the string?
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
On Mon, Oct 16, 2023 at 12:36 PM Jordan Brown openscad@jordan.maileater.net
wrote:
What's that colon at the front of the string?
That is how Qt resources are referenced.
"By default, resources are accessible in the application under the same
file name as they have in the source tree, with a :/ prefix, or by a URL
with a qrc scheme."
from:
https://doc.qt.io/qt-5/resources.html#resource-collection-files-op-op-qrc
The Qt resource compiler "rcc" is automatically invoked by cmake since we
set AUTORCC https://cmake.org/cmake/help/latest/prop_tgt/AUTORCC.html ON
What it does behind the scenes is basically turn those icon files etc into
a bunch of byte arrays (generated C++ code) that can be compiled directly
into the app, and looked up with their resource paths as keys.
You can see this generated source file under build/objects/resources.cxx
(or something like that, trying to remember off the top of my head at the
moment).
I was confused at first since the original post subject (file export)
doesn't really match with the actual issue (loading a Qt Resource, icon),
and had to re-read a couple times to understand the problem.
I thought the problem was a file could not be open for writing (export),
but really it's more of a "virtual" file (resource) that couldn't be opened
for reading.
I assume the export is using an added button/menu item in the GUI, with its
own icon.
Yeah I guess I could have put a better subject that was more directed to the actual issue was. Adding the new icon to the common.qrc.in file seems to have fixed the issue.
Yes, I added a new export option under File -> Export. On Monday, October 16, 2023 at 01:02:34 PM PDT, Hans L thehans@gmail.com wrote:
On Mon, Oct 16, 2023 at 12:36 PM Jordan Brown openscad@jordan.maileater.net wrote:
What's that colon at the front of the string?
That is how Qt resources are referenced.
"By default, resources are accessible in the application under the same file name as they have in the source tree, with a :/ prefix, or by a URL with a qrc scheme."
from: https://doc.qt.io/qt-5/resources.html#resource-collection-files-op-op-qrc
The Qt resource compiler "rcc" is automatically invoked by cmake since we set AUTORCC ON
What it does behind the scenes is basically turn those icon files etc into a bunch of byte arrays (generated C++ code) that can be compiled directly into the app, and looked up with their resource paths as keys.
You can see this generated source file under build/objects/resources.cxx (or something like that, trying to remember off the top of my head at the moment).
I was confused at first since the original post subject (file export) doesn't really match with the actual issue (loading a Qt Resource, icon), and had to re-read a couple times to understand the problem.I thought the problem was a file could not be open for writing (export), but really it's more of a "virtual" file (resource) that couldn't be opened for reading.I assume the export is using an added button/menu item in the GUI, with its own icon.
_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org