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
11
votes
5 answers

ImportError: No module named 'resource_rc'

I made a simple program with PyQt GUI, and compiled '.ui' file. # Form implementation generated from reading ui file 'main.ui' # # Created by: PyQt5 UI code generator 5.6 # # WARNING! All changes made in this file will be lost! from PyQt5 import…
QueN
  • 163
  • 1
  • 1
  • 13
7
votes
4 answers

How to specify wildcards in .qrc resource file of QML?

There are x number of .png files in a directory. Instead of adding all these manually I would want to specify the directory path in the .qrc file and let it include all of them on its own. What is the way to achieve this?
Aquarius_Girl
  • 21,790
  • 65
  • 230
  • 411
6
votes
3 answers

No resource file in Qt Creator

I am using Qt Creator and I have created a resource file. When I try to access the resource file when I am in designer mode, it says that resource root is empty. How can I specify the resource dir? How come it does not appear if it is in the same…
Sara
  • 833
  • 2
  • 9
  • 21
5
votes
0 answers

Is it possible to open an Qt resource using C library functions via FILE*?

I need to pass a binary resource that's compiled into my executable to some code that expects a file path, and then uses the C standard library FILE*-based API to access it. Of course if I pass a path recognized by Qt, like :/something.smt - it…
5
votes
1 answer

How can I read pickle file containing pandas data frame from qrc resource file with pandas read_pickle?

I have simple UI app created in PyQt5. I would like to have all of my resource files in the qrc resources. I am using pickle data structure to store previously created DataFrame. In my app I am reading the saved pickle with pandas. When I tried to…
critical_mass
  • 53
  • 2
  • 4
4
votes
1 answer

Getting paths of qrc files in Qt

I want to know how to access the paths of files in the qrc file in order to use them as strings in an array. An example of qrc file is: images/1.jpg
Kamalpreet Grewal
  • 822
  • 1
  • 13
  • 28
3
votes
0 answers

Different compression settings for different qrc files

Some qml files benefit from compression quite a lot (source files), others do not (already compressed data like png or mp3). The resource compiler itself can specify the compression level for each resource file when invoked manually. Is it possible…
dtech
  • 47,916
  • 17
  • 112
  • 190
3
votes
1 answer

QtCreator - Import folders into resources?

Is it somehow possible to import a folder structure into a resources file? I have folders such as: - JS - Lots of JS files - Images - Lots of images etc. I can only seem to import one file at a time, I have around 80 files. Any ideas?
user3490755
  • 955
  • 2
  • 15
  • 33
2
votes
1 answer

How to display dynamically created images in QWebView?

I'm working with QtWebKit where I'm displaying dynamically created HTML content, and I need to display the images that I retrieve from the database. For example, if I need to display an image from the resource, I add this line to the content I use…
Dmitry Kuzminov
  • 6,180
  • 6
  • 18
  • 40
2
votes
1 answer

How to use qrc resources in qss in qtdesigner?

I need to create QLineEdit with the search icon on the left side and i'm doing it in QtDesigner. I've added my search_icon.svg to my resources.qrc file and assigned this qrc as a resource of my application using resource browser of QtDesigner. The…
Tymofii Koval
  • 153
  • 1
  • 8
2
votes
0 answers

Unable to load .qml and .js files with qrc

I am using qChart.js in my QML project, and was able to access the libraries just fine by importing it into QML with import jbQuick.Charts 1.0 and adding the resource path by hard-coding the file path QQmlApplicationEngine…
Kiwi
  • 235
  • 2
  • 7
2
votes
1 answer

How to rightly add resources in Qt application

I am trying to deploy windows application in Qt, so I change mode to release, but when I execute it, all it writes is file::/qml/Main.qml: File is empty I have already tried multiple times to rework resources.qrc, but with no…
Brykyz
  • 587
  • 4
  • 30
2
votes
1 answer

Qt: empty content of opened QFile for a .txt file from the project resources

I tried this in my project in mainwindow.cpp: QString dir = ":/nodesDir/nodesDir/"; QFile baseFile(dir + "allNodeNames.txt"); qDebug() << baseFile.exists(); // true qDebug() << baseFile.readAll(); // "" but it is wrong, the content of the file…
mep
  • 341
  • 2
  • 11
2
votes
1 answer

C++ / Qt - Cannot Open .txt from qrc file

I tryed a lot of things but they didnt work. I'm using Qt 5.9.1 and i wouldlike to open a .txt file (which is in a qrc file) in a QFile variable, like this : QFile file(":/txt/config"); I also tried to use QFile file("qrc:/txt/config");  Here's…
NicoTine
  • 51
  • 3
  • 12
2
votes
2 answers

Redirecting the output of QProcess when running a resource file

fairly new to Qt. I'm using QProcess to run an external shell script and redirecting the output to a textBrowser on my GUI. Code: In mainwindow.h: private: QProcess *myProcess; and mainwindow.cpp: void MainWindow::onButtonPressed(){ myProcess…
Sphics
  • 88
  • 1
  • 9
1
2 3