Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. ToolButton not showing icon

ToolButton not showing icon

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 2.1k Views
  • 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.
  • G Offline
    G Offline
    GregWilsonLindberg
    wrote on last edited by
    #1

    I'm using QtCreator v2.6.2 on a Kubuntu system with the final target being a BeagleBone Black with Qt 4.8 installed.

    I've been trying out a test program to get the feel of Qt and I put a Tool Button in my top widget and then set the Normal, Active Off, & Active On icons to gif files. The Designer shows the Icons, but when I compile and run the program, either for the desktop or for the BBB the icons are not shown.

    I'm probably missing something obvious, anybody have any ideas what I might have missed?

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

      Hi and welcome to devnet,

      How are you giving the path to your gif files ? Are you embedding them in a qrc file ?

      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
      • G Offline
        G Offline
        GregWilsonLindberg
        wrote on last edited by
        #3

        Hi and thanks for the reply,

        I just entered the path in the ToolButton properties in the designer. The path show when I hover over the browse button is the complete path from the root.

        I haven't figured out yet how to create a resource file containing the gifs I'll be using.

        1 Reply Last reply
        0
        • G Offline
          G Offline
          GregWilsonLindberg
          wrote on last edited by
          #4

          My fault, I was not thinking correctly. I transferred the gifs over to the BBB in a directory with the same relative path as in the source code and all is now working correctly.

          I was making the assumption that the images would be embedded into the object code and that is not the case. Not really a problem in the end as long as I understand.

          Side question, is there some documentation that describe how to create a resource file containing gifs, jpgs, &/or pngs?

          Thanks for trying to help.

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

            The "The Qt Resource System" chapter from the documentation is what you are looking for. Qt Creator also provides an easy way to create a resource and add files to it.

            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