title: How to create hexagonal shaped pushButton in pyqt4?
body: <p>Currently I am using border-image to get the hexagonal shape. I want to change color of hexagon dynamically. If I try to change the color of the hexagon using background-color, only the square back-ground color changes. </p>
  
  <p>Here is the current code and the result. My requirement is to get a black hexagon like this:</p>
  
  <p><img src="https://i.stack.imgur.com/zgwZs.png" alt="figure">  </p>
  
  <pre><code>class ExampleApp(QtGui.QMainWindow):
  def __init__(self):
      super(self.__class__, self).__init__()
      self.myFunction()
  
  def myFunction(self):
      self.newWindow = design_3.Ui_MainWindow()
      self.newWindow.setupUi(self);
      self.newWindow.campusNameLabel.setStyleSheet("QLabel { color : white; }");
      self.newWindow.campusNameLabel.setText("Label 1") 
  
  
      gridLayout = QtGui.QGridLayout()
      gridLayout.setSpacing(5)
      gridLayout.setRowStretch(1,1)
      gridLayout.setVerticalSpacing(20)
  
  
      alertBtn = QtGui.QPushButton("myBtn",self)
      alertBtn.setAutoFillBackground(True)
      alertBtn.setFlat(True)
      alertBtn.setSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
      alertBtn.setMaximumWidth(150)
      alertBtn.setMaximumHeight(150)
      alertBtn.setMinimumWidth(150)
      alertBtn.setMinimumHeight(150)
  
  
      alertBtn.setStyleSheet("border-image: url(rsz_imagetest.png);background-color:black;")
      gridLayout.addWidget(alertBtn,0,0)
      self.newWindow.verticalLayout_2.addLayout(gridLayout)
  </code></pre>