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. [SOLVED] Customizing QPushButton - using Bootstrap css

[SOLVED] Customizing QPushButton - using Bootstrap css

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 4.2k 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
    maximus
    wrote on last edited by
    #1

    I would like to customize a QPushButton to look like this :
    https://www.dropbox.com/s/grhhaty92pnl41a/ButtonBootstrap.png

    This button is made with bootstrap and is used on my website.
    Here is the .css code (from bootstrap .css)
    @.btn-default {
    color: #333;
    background-color: #fff;
    border-color: #ccc;
    }@

    I want to emulate the same kind of button for my Qt app, I used the same .css, but the button shows no color and no border at all.
    I know Qt stylesheet syntax is different, is there a documentation explaining the differences. It would be perfect if it could be like css3 so we could reuse web stuff directly inside Qt.. Right now it's hard to code nice looking widgets, Or maybe i'm missing an open-source library like bootstrap that is made for Qt?

    Thanks!


    Free Indoor Cycling Software - https://maximumtrainer.com

    1 Reply Last reply
    0
    • M Offline
      M Offline
      maximus
      wrote on last edited by
      #2

      I did it by hand with Qt and it's not too bad..
      Using gimp and getting the color palette the hard way ;)

      @QPushButton.boutonVert {
      color : white;
      background-color: #5cb85c;
      border: 2px solid #4cae4c;
      border-radius: 3px;
      padding: 5px;
      min-width: 80px;
      }

      QPushButton.boutonVert:hover {
      background-color: #47a447;
      border: 2px solid #398439;
      }

      QPushButton.boutonVert:pressed {
      border: 3px solid #398439;
      }
      /*
      QPushButton.boutonVert:disabled {
      color : red;
      background-color: #5cb85c;
      border: 2px solid #4cae4c;
      }
      */@


      Free Indoor Cycling Software - https://maximumtrainer.com

      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