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. QPushButton.setStyleSheet("border:none;")
Qt 6.11 is out! See what's new in the release blog

QPushButton.setStyleSheet("border:none;")

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 3.5k 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.
  • sonichyS Offline
    sonichyS Offline
    sonichy
    wrote on last edited by
    #1

    The QPushButton.Icon padding is too big, and the white bakcgournd gray border is too ugly.
    If QPushButton.setStyleSheet("border:none;"), the press down gray background will disappear.

    https://github.com/sonichy

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by mrjj
      #2

      Hi
      You can change it
      http://doc.qt.io/qt-5/stylesheet-reference.html
      http://doc.qt.io/qt-5/stylesheet-customizing.html#box-model
      Also the icon size set the size of the icon. ( but NOT bigger than the actual bitmap)
      alt text

      And yes, when you style a button, it will NOT draw as normally for the rest.
      You must define full style for it.
      Which means set a color for the pressed state if you still want that.

      QPushButton:pressed { 
      background-color: rgb(118, 170, 50);
      } 
      
      
      1 Reply Last reply
      3

      • Login

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