Results 1 to 2 of 2

Thread: why do gradient borders overlap in QPushButton??

  1. #1
    Join Date
    Mar 2014
    Posts
    18
    Thanks
    3
    Qt products
    Qt3 Qt4 Qt/Embedded

    Default why do gradient borders overlap in QPushButton??

    Hi,

    i am new here and have a question concerning gradient borders.

    I created a QPushButton and want it to have rounded corners with gradient borders. So I worte a StyleSheet as follows:

    Qt Code:
    1. btn2->setStyleSheet("QPushButton { "
    2. "background-color: qlineargradient(spread:pad, x1:1, y1:0.302, x2:1, y2:0.057, stop:0.647727 rgba(217, 217, 217, 255), stop:1 rgba(250, 250, 250, 255));"
    3. "border-radius:10px;"
    4. "border-top: 6px solid qlineargradient(spread:pad, x1:1, y1:1, x2:1, y2:0.057, stop:0.64 rgba(217, 217, 217, 255), stop:0.955 rgba(106, 106, 106, 255), stop:1 rgba(0, 0, 0, 255));"//rgb(180,180,180);"
    5. "border-right: 6px outset qlineargradient(spread:pad, x1:1, y1:0, x2:0, y2:0, stop:0 rgba(0, 0, 0, 255), stop:0.045 rgba(106, 106, 106, 255), stop:0.64 rgba(217, 217, 217, 255));"//rgb(170,170,170);"
    6. "border-bottom: 6px solid qlineargradient(spread:pad, x1:1, y1:1, x2:1, y2:0.057, stop:0.64 rgba(106, 106, 106, 255), stop:0.955 rgba(217, 217, 217, 255), stop:1 rgba(250, 250, 250, 255));"//rgb(140,140,140);"
    7.  
    8. }
    To copy to clipboard, switch view to plain text mode 

    The result looks like this:
    http://www.directupload.net/file/d/3...8facrr_png.htm

    Can anybody tell me, why the corners of the border-right and the border-top gradient overlap and are getting black?
    And does anybody know, how to realize a smooth transition?

    Thanks.
    Last edited by nernst; 28th April 2014 at 14:05. Reason: spelling corrections

  2. #2

    Default Re: why do gradient borders overlap in QPushButton??

    border-radius: 0px;

Similar Threads

  1. Removing gradient from QPushButton
    By Lexrst in forum Newbie
    Replies: 12
    Last Post: 1st January 2019, 19:27
  2. multiple toolbars overlap
    By bittuthegr8 in forum Newbie
    Replies: 1
    Last Post: 2nd October 2010, 07:58
  3. Can I Programatically Overlap Dock Widgets?
    By bieber in forum Qt Programming
    Replies: 0
    Last Post: 29th June 2010, 19:42
  4. Axis Tick Labels Overlap
    By amoswood in forum Qwt
    Replies: 3
    Last Post: 8th June 2010, 15:52
  5. Widget overlap
    By Oleg in forum Qt Programming
    Replies: 1
    Last Post: 29th March 2010, 19:53

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.