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.
  • M Offline
    M Offline
    M4RZB4Ni
    wrote on 21 Apr 2016, 14:03 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 21 Apr 2016, 14:10 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
      • M Offline
        M Offline
        M4RZB4Ni
        wrote on 21 Apr 2016, 17:00 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

        M 1 Reply Last reply 21 Apr 2016, 17:09
        0
        • M M4RZB4Ni
          21 Apr 2016, 17:00

          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

          M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 21 Apr 2016, 17:09 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.

          M 1 Reply Last reply 21 Apr 2016, 18:34
          0
          • M mrjj
            21 Apr 2016, 17:09

            @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.

            M Offline
            M Offline
            M4RZB4Ni
            wrote on 21 Apr 2016, 18:34 last edited by
            #5

            @mrjj
            can you more explain about this?
            tnx

            Thanks
            M4RZB4Ni

            M 1 Reply Last reply 21 Apr 2016, 18:40
            0
            • M M4RZB4Ni
              21 Apr 2016, 18:34

              @mrjj
              can you more explain about this?
              tnx

              M Offline
              M Offline
              mrjj
              Lifetime Qt Champion
              wrote on 21 Apr 2016, 18:40 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.

              M 1 Reply Last reply 21 Apr 2016, 18:42
              1
              • M mrjj
                21 Apr 2016, 18:40

                @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.

                M Offline
                M Offline
                M4RZB4Ni
                wrote on 21 Apr 2016, 18:42 last edited by
                #7

                @mrjj
                Thanks so Much Bro :)

                Thanks
                M4RZB4Ni

                1 Reply Last reply
                1

                1/7

                21 Apr 2016, 14:03

                • Login

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