title: Split Button and Menu to Button
body: <p>I want to get dropdown when I click on button and pick up a some action. 
  How could these behaviour shown on images below achieve with <code>QPushbutton</code> and <code>PyQt5</code>:</p>
  
  <p><strong>There are 2 ways to do it as below:</strong></p>
  
  <blockquote>
    <p>1- Split Button</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/5WDuT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5WDuT.png" alt="enter image description here"></a></p>
  
  <blockquote>
    <p>2 - Menu and subnemu to button.</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/VKSmp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VKSmp.png" alt="enter image description here"></a></p>
  
  <pre><code>class Button(QtWidgets.QWidget):
      def __init__(self, parent=None):
          super(Button, self).__init__(parent)
          self.setGeometry(500,500,200,100)
  
          self.button = QtWidgets.QPushButton("button with menu")
          lay = QtWidgets.QVBoxLayout(self)
          lay.addWidget(self.button)
  
  if __name__ == "__main__":
      app = QtWidgets.QApplication(sys.argv)
      w = Button()
      w.show()
      sys.exit(app.exec_())
  </code></pre>
  
  <p>How could I achieve those behaviour? Thanks for any support.</p>