Problems with Open-Source Downloads read and

[BeagleBone Black] Image not appears in Tool Button

  • Hi,

    I've got this problem: When i compile my code on desktop, all my icons are displayed on my screen and
    when i try to compile my code on my embedded system, no one of my icons appears.

    I'm using an absolute path of the image, so the Tool Button loads the image properly when i'm on desktop. The same
    doesn't works on my embbeded system.
    I used the "Qt resources system" to store the images, but this method didn't work properly, for this reason i'm
    using the absolute path.

    So, i'm using the following setup:

    • QT Creator v2.5.2
    • Ubuntu 12.04 LTS
    • Final target: Beaglebone Black Qt v4.8.5
    • I'm using my personal buildroot system files, so my beaglebone doesn't have the original linux distribution Angstrom.
    • The support for gif, jpeg and png was enabled on buildroot.

    More information:

    • The image was transfered to my beaglebone using ftp.
    • When the image gets transfered, i change the url to match the beaglebone file system.


    ui->myButton->setStyleSheet("QToolButton {image: url('/home/usr/Desktop/img/img.png');}") //it works

    ui->myButton->setStyleSheet("QToolButton {image: url('/home/img/img.png');}") // not working

    To finish, i want to show the image using the absolute path just to ensure that the beaglebone can
    load and show the images, and later i'll use the "Qt resources system" again.

    Thanks for your support.

  • Hi,
    note: I got sucess in my tests with images on format .bmp

  • but yet not works with png format

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Unless you changed something on your configure command and IIRC png should be built-in. How did you configure your cross-compiled Qt ? Did you properly deploy all plugins ?

  • Hi SGaist, tankyou for your reply,

    I'm using buildroot to cross-compile the QT, so configure file is auto generated, and i enabled support to png, jpeg and gif in buildroot.
    I uploaded the files for you see.

    config.status >>
    configure >>

    I do not understand. What is IIRC? is the .pro file?

  • Lifetime Qt Champion

    IIRC means If I Recall Correctly

    You should write a little dummy program that dumps the supported image types on the console just to see if that part is working correctly.

  • Yes, I've tested with a simple program and the same problem happened, only ".bmp" format is working, then I think the problem is some plugin or library that supports the png and jpeg formats.

    One thing maybe help, I found some tutorials on internet teaching the following:

    QTPLUGIN += qpng

    QString sDir = QCoreApplication::applicationDirPath();
    //in this case I copied the folder with libs to project directory

    #include <QtPlugin>


    But got the error:
    cannot find -lqpng
    collect2: error: ld returned 1 exit status

  • Lifetime Qt Champion

    That's the technique you have to use if you built Qt statically.

    You should run your program with QT_DEBUG_PLUGINS=1 to see what happens with the plugins

Log in to reply