Questions tagged [qt-resource]

From Qt website : « The Qt resource system is a platform-independent mechanism for storing binary files in the application's executable. This is useful if your application always needs a certain set of files (icons, translation files, etc.) and you don't want to run the risk of losing the files. »

From Qt website : « The Qt resource system is a platform-independent mechanism for storing binary files in the application's executable. This is useful if your application always needs a certain set of files (icons, translation files, etc.) and you don't want to run the risk of losing the files. »

Useful link

29 questions
11
votes
3 answers

Image from resource file not loading in Qt

I'm trying to insert an image to my program via resource file, which is like: green.png other files and when I'm trying to load it using QImage or…
didgogns
  • 255
  • 1
  • 2
  • 7
9
votes
2 answers

Compiling 10MB+ resource files with qrc in cmake results in heap space allocation failures

I'm trying to compile large resource files with qrc using CMake. This is well known to chew up all of a computers RAM (>32GB) and cause the compiler to exit with heap allocation errors (see QTBUG-50468, QTBUG-55293, and QTBUG-54357) Apparently if…
Nicolas Holthaus
  • 7,763
  • 4
  • 42
  • 97
7
votes
1 answer

How to convert Qt file path from resource to absolute path?

I need to receive the absolute file path like C:/Users/Dima/YandexDisk/_Application/WeldAnalysis/ExperimentDefaults.xlsx from path of QRC file like :/Data/ExperimentDefaults.xlsx. How can I do this?
Dima Gurov
  • 73
  • 1
  • 4
4
votes
1 answer

Can i read from .ini file which located in resources files?

#include "mainwindow.h" #include "ui_mainwindow.h" #include #include MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); QSettings * qsettings = new…
ratojakuf
  • 708
  • 1
  • 11
  • 21
4
votes
3 answers

How to properly remove a QML File from a QT project

I am trying to remove a QML file from my project. It is no longer needed. However, when I delete from the resource then attempt to compile through the IDE, I receive the following error: :-1: error: No rule to make target '../MAST/fileList.qml',…
Bear35645
  • 193
  • 1
  • 3
  • 14
3
votes
1 answer

How to change all path of resource file on Qt?

I draw GUI for the app and use many icons with resource file path prefix: /ico and path file in the folder of the project: Resources/Images/*.png So, each uses them in GUI, I must call::/ico/Resources/Images/*.png Now, I want to call them with a…
kien bui
  • 1,760
  • 2
  • 17
  • 33
3
votes
1 answer

Read translator file .ts/.qm on translations.qrc file

I'm trying to import translator file on my Qt project (Qt 5.6 on Linux system), but I can't upload translation file because the QTranslator::load method always returns false. I have the following "testTrl" project structure: On project root I have…
daniele86
  • 147
  • 3
  • 14
3
votes
1 answer

How to map a resource file in Qt?

Is it possible to map a resource file in Qt? For example: QFile file(resource_name); file.open(QIODevice::ReadOnly); uchar* ptr = file.map(0, file.size()); When I try this, ptr == 0, indicating an error. It works fine if I try to map a regular…
Karl Voigtland
  • 7,637
  • 34
  • 29
2
votes
2 answers

What is the advantage of prefix over filesystem path in Qt resource system?

The Qt resource file .qrc allows to split the embedded files into different prefixes qml/CustomWidget.qml
ymoreau
  • 3,402
  • 1
  • 22
  • 60
2
votes
1 answer

Q_INIT_RESOURCE not working

Im developing a static library, and I use a qrc file. I read the documentation and found, that I have to call Q_INIT_RESOURCE to make it work, but no success so far. I called Q_INIT_RESOURCE in main, directly after creating the QApplication (I…
Felix
  • 6,885
  • 1
  • 29
  • 54
1
vote
1 answer

Common resource file in PyQt/ PySide and resource file location

When a resource file is created via Qt Designer in a Form, the python code generated by the Qt Designer includes the following import statement: import icons_rc This import statement is same irrespective of the qrc file location (say shared…
Ajay
  • 344
  • 3
  • 15
1
vote
2 answers

QWebEngineView does not load relative resources from an html page if the page is loaded from Qt RCC resource system

edit: Following @eyllanesc comment, here is a minimal example hosted on github. The test is run on Qt5.9, on OS X 10.12. Base HTML Let's create a minimal example HTML loading an image by relative path, test.html: …
Ad N
  • 7,930
  • 6
  • 36
  • 80
1
vote
2 answers

Force rcc-ing of qrc file on each build

How to force rcc-ing of a qrc file on each build in Visual Studio 2015? We are embedding the resources in the binary, so if something like qml or image assets change, we need to run rcc to get a fresh .cpp file for the current state. I see several…
Rudolfs Bundulis
  • 11,636
  • 6
  • 33
  • 71
1
vote
0 answers

QResource register multiple resources, resource loading principle, which is the last available resource?

Let's say I have 3 qrc files. The first 2 contain the same resource path and the 3rd one doesn't contain that path, for eg: qrc1: res/image.png qrc2:
Ispas Claudiu
  • 1,890
  • 2
  • 28
  • 54
1
vote
1 answer

How to pack images in Qt resource to be accessible from a static HTML resource

I have a Qt Widgets project that employs QWebEngineView to show a static HTML page. That page will show an image that needs to be "packed" with the Qt executable/installer. Can I use the QRC file to add an image and refer to it from the HTML file? I…
rubmz
  • 1,947
  • 5
  • 27
  • 49
1
2