I'm trying to create a very simple pentagonal custom button in Qt. I'm using PyQt5, but the concepts and style-sheet code should be the same as C++ anyway.

My current code is this:
Qt Code:
  1. button = QPushButton()
  2. button.setFixedSize(QSize(20, 15))
  3. button.setSizePolicy(QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed))
  4. x = button.width()
  5. y = button.height()
  6. points = [QPoint(0, 0), QPoint(x/2, 0), QPoint(x, y/2), QPoint(x/2, y), QPoint(0, y)]
  7. button.setMask(QRegion(QPolygon(points)))
To copy to clipboard, switch view to plain text mode 

This almost works great, but unfortunately it ruins the dropshadow effect and the button just ends up looking weird:

Removing the border with

Qt Code:
  1. button.setStyleSheet("border-style: none")
To copy to clipboard, switch view to plain text mode 

doesn't work well because then the button is indistinguishable from the background. What I'm currently using is

Qt Code:
  1. button.setStyleSheet("background-color: darkBlue; border-style: none")
To copy to clipboard, switch view to plain text mode 

but this makes the button blue (which is not ideal) and it also removes the colour changes when hovering or clicking the button. Ideally, I would like to have

Qt Code:
  1. button.setStyleSheet("border-style: outset")
To copy to clipboard, switch view to plain text mode 

and keep colour changing functionality you'd expect from a button. However, the above line actually does the same as `border-style: none`, simply removing the border. Is there a way to get an outset border or at least fix the dropshadow effect of the original button?