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. Making transparent buttons
QtWS25 Last Chance

Making transparent buttons

Scheduled Pinned Locked Moved General and Desktop
5 Posts 4 Posters 9.9k 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.
  • N Offline
    N Offline
    nicky j
    wrote on 14 Jun 2013, 22:20 last edited by
    #1

    Hey, how can I set a QPushButton to be transparent, but the text inside to be visible. I have tried setting it transparent, but it turns black. I am trying to set it up where you cant see the button, allowing it to blend in with the background better. Thanks!

    1 Reply Last reply
    0
    • M Offline
      M Offline
      Max13
      wrote on 14 Jun 2013, 23:29 last edited by
      #2

      What about setting it "flat":http://qt-project.org/doc/qt-5.0/qtwidgets/qpushbutton.html#flat-prop ?

      We all have started by asking questions. Then after some time, we can begin answering them.

      1 Reply Last reply
      0
      • N Offline
        N Offline
        natiahc
        wrote on 15 Jun 2013, 04:48 last edited by
        #3

        if nothing works, u can make use of qstylesheet

        pushButton->setStyleSheet("QPushButton { border-image: url(:/icon/image.png); }");

        and the image being transparent

        this is not the right way, but it should work !!

        N 1 Reply Last reply 18 Jun 2021, 19:51
        0
        • N Offline
          N Offline
          nicky j
          wrote on 15 Jun 2013, 06:17 last edited by
          #4

          Ok, thanks both of you!

          1 Reply Last reply
          0
          • N natiahc
            15 Jun 2013, 04:48

            if nothing works, u can make use of qstylesheet

            pushButton->setStyleSheet("QPushButton { border-image: url(:/icon/image.png); }");

            and the image being transparent

            this is not the right way, but it should work !!

            N Offline
            N Offline
            Nihal
            wrote on 18 Jun 2021, 19:51 last edited by
            #5

            @natiahc
            It worked, thank u , you've saved my life......

            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