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
Qt 6.11 is out! See what's new in the release blog

Making transparent buttons

Scheduled Pinned Locked Moved General and Desktop
5 Posts 4 Posters 10.4k 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.
  • N Offline
    N Offline
    nicky j
    wrote on 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 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 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
        0
        • N Offline
          N Offline
          nicky j
          wrote on last edited by
          #4

          Ok, thanks both of you!

          1 Reply Last reply
          0
          • N natiahc

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