Solved Resources not found (Cross compiling)
-
Hi all,
I have run into a problem with the QT resource system. I have a .qrc with a single .png file that appears to work perfectly fine on the IDE side (found in the project files and used in the UI editor) but the image does not display on the remote host that runs the program. The file is in my .pro file and I have checked build directories/build output to make sure the qrc file is being parsed and compiled (qrc_assets.o). I have also added a small qDebug output for iterating over ":" and the path/file are simply not there.
Some screenshots:
QDirIterator it(":", QDirIterator::Subdirectories); while (it.hasNext()) { if(it.next().contains("qt-project.org") != true) { qDebug() << it.next(); } }
Output:
Some background: I am cross compiling using linaro-toolchain v7.5 and and running on the remote host over SSH. So far everything else has been smooth sailing.
As a quick test I tried using absolute path to the same png file and it worked.
ui->label->setPixmap(QPixmap("/home/debian/run/VatCtrl/bin/cog-icon.png"));
Ideally I would like to avoid having to do this.
Any pointers for sorting this out would be great.
Thanks in advance
-
Hi and welcome to devnet,
Might be a silly question but is it working properly on your desktop machine ? You explained that everything is good IDE wise but did not say if it executes properly.
-
@dtrit
some silly questions also from my side:
what is the type of the host platform where it is working? Is it windows? If so check the case-sensitivity of the file paths, since this doesn't matter for rcc on Windows side.
Also make sure to rerun qmake, to update the makefile and ensuring that rcc is invoked again with the new file list. -
thanks for the response.
So I am running linux mint on a virtual machine. I have not installed a desktop kit to test it on the build machine - which I will setup ASAP.
My QT versions were mismatched - cross compiling in the virtual machine on QT5.15.2 and the beaglebone was using the debian supplied 5.11.3. I am currently in the process of building 5.15.2 on the beaglebone natively. - I believe this mismatch resulted in incompatible QSocketNotifier libs also.
Will report back if this fixes the issue or not.
-
Have Built QT 5.15.2 for the target hardware. Resources now working correctly. closing issue as it was my own fault mismatching versions.