I can change the top, left, right and bottom of borders using the setStyleSheet funcion:
self.button1.setStyleSheet("""border-bottom: 1px solid #654321; border-top: 1px solid #123456""")
and this creates a button like so:
However is it possible to create borders like the one below using qss stylesheets:
Where the bottom border in only not starting at the very edge.
Well, it is possible, but only whenever the following aspects are respected and considered:
border-left
and border-right
are set to none
);border radius
is only specified for the bottom corners, and it only sets the horizontal radius, while leaving the vertical one to 0; bottomMargin = 24
self.button1.setStyleSheet("""
QAbstractButton {{
border: 1px solid black;
border-left: none;
border-right: none;
border-bottom-left-radius: {margin}px 0;
border-bottom-right-radius: {margin}px 0;
}}
""".format(margin=bottomMargin)