PDA

View Full Version : why do gradient borders overlap in QPushButton??



nernst
28th April 2014, 13:54
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:


btn2->setStyleSheet("QPushButton { "
"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));"
"border-radius:10px;"
"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);"
"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);"
"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);"

}

The result looks like this:
http://www.directupload.net/file/d/3606/ht8facrr_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.

slackman
31st March 2017, 09:51
border-radius: 0px;