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. Styling QPushButton border doesn't work properly on latest Qt with MacOS??
QtWS25 Last Chance

Styling QPushButton border doesn't work properly on latest Qt with MacOS??

Scheduled Pinned Locked Moved Solved General and Desktop
macosqpushbuttstylesheet
2 Posts 2 Posters 1.3k 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.
  • L Offline
    L Offline
    legitnameyo
    wrote on last edited by
    #1

    my code

    button->setStyleSheet(QString("QPushButton {color: #444444; background: #e6e6e6; border: 2px solid #cccccc;} QPushButton:hover {border-bottom: 2px black solid; color: #333333;background: #F7F7F7;} QPushButton:pressed {background: #e6e6e6;}"));
    

    The above styles ALL the borders. If I use the style below

    border: 0px 0px 2px 0px solid #000000
    

    it styles no border at all! I am using Qt Creator 4.8.1, Based on Qt 5.12.0 (Clang 10.0 (Apple), 64 bit) on a MacOS Mojave 10.14

    1 Reply Last reply
    0
    • Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #2

      That's not valid css. border does not take 4 separate width parameters, only one shared across all sides. If you want to set borders different for each side you need to use border-width:

      border: solid #000000; border-width: 0px 0px 2px 0px;
      
      1 Reply Last reply
      4

      • Login

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