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. how to create an image button
Forum Updated to NodeBB v4.3 + New Features

how to create an image button

Scheduled Pinned Locked Moved Solved General and Desktop
imagebuttonqt 5.4.1
7 Posts 3 Posters 25.6k 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.
  • M4RZB4NiM Offline
    M4RZB4NiM Offline
    M4RZB4Ni
    wrote on last edited by
    #1

    hi,
    how i can create an image button in qt?
    tnx

    Thanks
    M4RZB4Ni

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

      Are you looking to have an image as the background on a button? If so, try:

      button->setStyleSheet("border-image:url(:/Icons/images/myImage.png);");
      

      Alternatively, you can use stylesheets. Take a look at the documentation here. Hope this helps!

      1 Reply Last reply
      1
      • M4RZB4NiM Offline
        M4RZB4NiM Offline
        M4RZB4Ni
        wrote on last edited by
        #3

        tnx
        but i does this but in stylesheet menu,in add resource menu
        my images dose not known and identify and just write root!
        what i must do?
        tnx so much

        Thanks
        M4RZB4Ni

        mrjjM 1 Reply Last reply
        0
        • M4RZB4NiM M4RZB4Ni

          tnx
          but i does this but in stylesheet menu,in add resource menu
          my images dose not known and identify and just write root!
          what i must do?
          tnx so much

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @M4RZB4Ni
          If you create a QResource file and added to project and and added
          the image to this Qres and its not showing then
          try to run qmake from the menu.

          M4RZB4NiM 1 Reply Last reply
          0
          • mrjjM mrjj

            @M4RZB4Ni
            If you create a QResource file and added to project and and added
            the image to this Qres and its not showing then
            try to run qmake from the menu.

            M4RZB4NiM Offline
            M4RZB4NiM Offline
            M4RZB4Ni
            wrote on last edited by
            #5

            @mrjj
            can you more explain about this?
            tnx

            Thanks
            M4RZB4Ni

            mrjjM 1 Reply Last reply
            0
            • M4RZB4NiM M4RZB4Ni

              @mrjj
              can you more explain about this?
              tnx

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by mrjj
              #6

              @M4RZB4Ni
              hi
              Not sure which part. :)
              This is how u get the qres file
              http://www.bogotobogo.com/Qt/Qt5_Resource_Files.php

              Do down to "Finish. "
              Then right click qres and Select Add existing file
              then point to ur image.

              Then up from Build menu, select qmake & build all

              then try to browse again and u should see ur image.

              M4RZB4NiM 1 Reply Last reply
              1
              • mrjjM mrjj

                @M4RZB4Ni
                hi
                Not sure which part. :)
                This is how u get the qres file
                http://www.bogotobogo.com/Qt/Qt5_Resource_Files.php

                Do down to "Finish. "
                Then right click qres and Select Add existing file
                then point to ur image.

                Then up from Build menu, select qmake & build all

                then try to browse again and u should see ur image.

                M4RZB4NiM Offline
                M4RZB4NiM Offline
                M4RZB4Ni
                wrote on last edited by
                #7

                @mrjj
                Thanks so Much Bro :)

                Thanks
                M4RZB4Ni

                1 Reply Last reply
                1

                • Login

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