Load image out of the resource files
-
It's possible to load images out of resource file?
self.frame = QFrame(self.page_widgets) self.frame.setObjectName(u"frame") self.frame.setMinimumSize(QSize(122, 320)) self.frame.setMaximumSize(QSize(16777215, 16777215)) self.frame.setStyleSheet(u"background-color: rgb(27, 29, 35);\n" "border-radius: 5px;\n" "image: url(:/others/icons/printscreen.png);")
Basically I'll need to change this "printscreen.png" file multiple times, but every time that I need to change this file I need to save the new file in resources and reload the resource file and this is inviable to me.
1 - It's possible to load a image out of the resource file?
2 - It's possible to load a image to resources without Qt Designer?Thanks
-
It's possible to load images out of resource file?
self.frame = QFrame(self.page_widgets) self.frame.setObjectName(u"frame") self.frame.setMinimumSize(QSize(122, 320)) self.frame.setMaximumSize(QSize(16777215, 16777215)) self.frame.setStyleSheet(u"background-color: rgb(27, 29, 35);\n" "border-radius: 5px;\n" "image: url(:/others/icons/printscreen.png);")
Basically I'll need to change this "printscreen.png" file multiple times, but every time that I need to change this file I need to save the new file in resources and reload the resource file and this is inviable to me.
1 - It's possible to load a image out of the resource file?
2 - It's possible to load a image to resources without Qt Designer?Thanks
@Black-Cat
You can read resources out of a resource file. But you cannotbut every time that I need to change this file I need to save the new file in resources and reload the resource file and this is inviable to me.
even if it's what you say you have to have! Resource files are read-only, generated at compile time. You can of course change which file you read in that string, if you have a variety of files saved in the resources. But you cannot write back anything to a resource file at runtime.
Nor should you need to. Where are these "new file"s, how to you propose to generate them at runtime? If you do have to save to external file, you can save to the actual OS file system and then read that back as a
png
or whatever, but not as an embedded resource.