Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Qt Academy Launch in California!

    ToolButton not showing icon

    General and Desktop
    2
    5
    1664
    Loading More Posts
    • 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
      GregWilsonLindberg last edited by

      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 Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        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 Reply Quote 0
        • G
          GregWilsonLindberg last edited by

          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 Reply Quote 0
          • G
            GregWilsonLindberg last edited by

            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 Reply Quote 0
            • SGaist
              SGaist Lifetime Qt Champion last edited by

              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 Reply Quote 0
              • First post
                Last post