Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. [BeagleBone Black] Image not appears in Tool Button
Forum Updated to NodeBB v4.3 + New Features

[BeagleBone Black] Image not appears in Tool Button

Scheduled Pinned Locked Moved Mobile and Embedded
8 Posts 2 Posters 2.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    ChupetaGUI
    wrote on last edited by
    #1

    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.

    i.e:

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

    ON BEAGLEBONE BLACK:
    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.

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChupetaGUI
      wrote on last edited by
      #2

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

      1 Reply Last reply
      0
      • C Offline
        C Offline
        ChupetaGUI
        wrote on last edited by
        #3

        but yet not works with png format

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          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 ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • C Offline
            C Offline
            ChupetaGUI
            wrote on last edited by
            #5

            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 >> https://www.dropbox.com/s/d4j1fa2hkpyn027/config.status
            configure >> https://www.dropbox.com/s/f2azhflb8b2fpr6/configure

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

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              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.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • C Offline
                C Offline
                ChupetaGUI
                wrote on last edited by
                #7

                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:

                [.pro]
                QTPLUGIN += qpng

                [main]
                QString sDir = QCoreApplication::applicationDirPath();
                a.addLibraryPath(sDir+"/plugins/imageformats");
                //in this case I copied the folder with libs to project directory

                [mainwindow]
                #include <QtPlugin>

                Q_IMPORT_PLUGIN(qpng)

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

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  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

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved