Questions tagged [qresource]

The QResource class provides an interface for reading directly from resources.

QResource is an object that represents a set of data (and possibly children) relating to a single resource entity. QResource gives direct access to the bytes in their raw format. In this way direct access allows reading data without buffer copying or indirection. Indirection is often useful when interacting with the resource entity as if it is a file, this can be achieved with QFile. The data and children behind a QResource are normally compiled into an application/library, but it is also possible to load a resource at runtime. When loaded at run time the resource file will be loaded as one big set of data and then given out in pieces via references into the resource tree.

45 questions
0
votes
1 answer

How can I access images from qrc.py into reportlab?

I have converted "image_fonts.qrc" into image_fonts_rc.py file. It has one image named as "image.png" How can I use an image into reportlab PDF in Python from qrc.py file. File image_fonts.qrc
Mano
  • 27
  • 6
0
votes
1 answer

Load Jinja2 templates from Qt Resource System

I'm trying to load some Jinja2 templates from the Qt Resource System. I'm using Python 3.8.3, Jinja 2.11.2 and PyQt 5.15. The problem is that I can't even detect the qrc paths to load the templates. QRC only works with Qt classes? Python code: from…
Eduardo
  • 687
  • 1
  • 6
  • 24
0
votes
1 answer

QAction icon is not showing in Qtoolbar

I have a problem with QToolbar and QAction. I'm trying to show an action with a icon but the icon is not showing. This is my qrc and code example (I'm using PySide2):
Eduardo
  • 687
  • 1
  • 6
  • 24
0
votes
0 answers

Why do my icons not appear in the main window of my PySide2 project?

I have a basic Pyside2 project with the following main.py code: import sys import resources_rc from PySide2.QtUiTools import QUiLoader from PySide2.QtWidgets import QApplication class MyApp(): def __init__(self): super().__init__() …
Joey Kleingers
  • 297
  • 1
  • 4
  • 13
0
votes
1 answer

VS 2019 keeps finding qrc cpp files as modified even when they are not

I work in a project using Qt compiled with Visual Studio C++ compiler. I noticed after migrating from VS2017 to VS2019 that when building the application, VS always find qrc cpp files as modified and try to rebuild them. Is not happening for all…
Javier De Pedro
  • 2,219
  • 4
  • 32
  • 49
0
votes
1 answer

qt resources what is the correct form to use resource in qml qrc:///bg.png vs ../bg.png

Good morning i have a question for qt experts, i want to know what is the correct form and best for performance to use a resource inside qrc, for example i have: 1- Image { id: bg anchors.bottomMargin: 60 anchors.fill:…
Samuaz
  • 295
  • 2
  • 13
0
votes
0 answers

Use an editable Qt resource

I'm working on a syntax highlighter getting styles to apply from an xml file. I wanted to add this file in the qrc but I would like this file to be editable by the user. How to get the benefit of the qrc to avoid path management from the exe ?
Maluna34
  • 245
  • 1
  • 16
0
votes
1 answer

How to set qrc compression settings in a qbs project?

In a qmake based project, I could do this: #QMAKE_RESOURCE_FLAGS += -threshold 0 -compress 1 But searching around, I don't seem to find how to do this for a qbs project. Any ideas?
dtech
  • 47,916
  • 17
  • 112
  • 190
0
votes
1 answer

Removing/modifying static Qt resources in run-time

As part of a Qt Designer hacking, I'm interested in removing a resource in runtime (specifically :/trolltech/widgetbox/widgetbox.xml). Refer to the end of the post for more detail about the context. My obvious (and failed) attempt…
cbuchart
  • 10,847
  • 9
  • 53
  • 93
0
votes
2 answers

QResource: unregister .rcc files

We have an application with multiple themes, whom calls other minor apps. So, on main app there is something like that: // User opens app with theme A QResource::registerResource("theme_a.rcc"); // returns TRUE // User changes theme to…
Rômulo M. Farias
  • 1,483
  • 1
  • 15
  • 29
0
votes
1 answer

get original file name of resource in qrc file

Problem: How can I get the original file name from the qrc resource file? More Info: Using fileName() and absoluteFilePath() methods, I implemented the following example: qrc entry: :/my/file (somefile.txt) Here, I expect to see…
CybeX
  • 2,060
  • 3
  • 48
  • 115
0
votes
0 answers

copy file from resource to disk keeping folder structure (platform independant)

Problem: How do I copy resource files, while preserving file names, to the disk in a platform independent way? Example and Explanation: I have files in my Resource File (.qrc file) e.g.: :/student/stud_temp …
CybeX
  • 2,060
  • 3
  • 48
  • 115
0
votes
2 answers

QT 5.4, Unable to access Resource from code

I try to include style images of my app into a q-resource file. When I include the file directly in the code, it work, but when i try to use QResource, it fail (do not load the file). I have the resource file in the main directory: AppFolder |-…
Adrian Maire
  • 14,354
  • 9
  • 45
  • 85
-1
votes
1 answer

Qt filename to bundled resource

I have built a package in Qt that uses the external gdal library to query a raster file. I want to bundle the raster with my application and had hoped to do that in a qrc resource file. Problem is that gdal wants a filename:- const char *pzFileName…
CitizenFish
  • 312
  • 2
  • 13
-1
votes
2 answers

External binary resource opened but not existing in QML

I have the following main.qml file: import QtQuick 2.5 import QtQuick.Controls 1.4 Item { anchors.centerIn: parent Label { id: textLabel anchors.fill: parent x: 200 y: 400 } CustomObject { …
Grégoire Borel
  • 1,880
  • 3
  • 33
  • 55
1 2
3