Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

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:
    75ff0867-52f6-4a4f-a528-092cecc479c2-image.png
    4a8bdfc1-08e5-450c-81a9-5c523555c36c-image.png

        QDirIterator it(":", QDirIterator::Subdirectories);
        while (it.hasNext()) {
            if(it.next().contains("qt-project.org") != true)
            {
                qDebug() << it.next();
            }
        }
    

    Output:
    1314d958-4c9d-4b8c-b999-33f1c413ba74-image.png

    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


  • Lifetime Qt Champion

    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.


  • Moderators

    @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.


Log in to reply