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. How to make a McIntosh style (Candy Style) QPushButton for Windows application using stylesheets ?
Forum Updated to NodeBB v4.3 + New Features

How to make a McIntosh style (Candy Style) QPushButton for Windows application using stylesheets ?

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

    I want to make that kind of button but i dont know how to do it

    raven-worxR 1 Reply Last reply
    0
    • E Eduardo12l

      I want to make that kind of button but i dont know how to do it

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @Eduardo12l
      can you link to an example image/screenshot?

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      E 1 Reply Last reply
      1
      • raven-worxR raven-worx

        @Eduardo12l
        can you link to an example image/screenshot?

        E Offline
        E Offline
        Eduardo12l
        wrote on last edited by Eduardo12l
        #3

        @raven-worx

        ( http://doc.qt.io/qt-4.8/gallery-macintosh.html ) There is a QPushbutton ("Cancel") that is blue and transparent

        1 Reply Last reply
        0
        • E Offline
          E Offline
          Eduardo12l
          wrote on last edited by Eduardo12l
          #4

          I've just found how to make a Candy Button but its not what i want, anyway i post it:
          You can write it at Stylesheet

          QPushButton {
          color: white;
          background-color: QLinearGradient(spread:pad x1: 0, y1: 0, x2: 0, y2: 1, stop: 0.0 rgba(156,152,215,200),  stop: 0.4 rgba(58,52,151,200), stop: 1.0 rgba(78,70,190,200));
          border-width: 1px;
          border-color: #339;
          border-style: solid;
          border-radius: 7;
          padding: 3px;
          padding-left: 5px;
          padding-right: 5px;
          
          }
          

          Its a candy button purple

          raven-worxR 1 Reply Last reply
          0
          • E Eduardo12l

            I've just found how to make a Candy Button but its not what i want, anyway i post it:
            You can write it at Stylesheet

            QPushButton {
            color: white;
            background-color: QLinearGradient(spread:pad x1: 0, y1: 0, x2: 0, y2: 1, stop: 0.0 rgba(156,152,215,200),  stop: 0.4 rgba(58,52,151,200), stop: 1.0 rgba(78,70,190,200));
            border-width: 1px;
            border-color: #339;
            border-style: solid;
            border-radius: 7;
            padding: 3px;
            padding-left: 5px;
            padding-right: 5px;
            
            }
            

            Its a candy button purple

            raven-worxR Offline
            raven-worxR Offline
            raven-worx
            Moderators
            wrote on last edited by
            #5

            @Eduardo12l
            probably the most easiest way would be to use a border-image, like this one for example. See the related docs.

            Alternatively you can go the stylesheet-only way, which might not fully result in what you want though.

            --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
            If you have a question please use the forum so others can benefit from the solution in the future

            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