title: How to round QWidget corners
body: <p><a href="https://i.stack.imgur.com/2Nxpi.png" rel="noreferrer"><img src="https://i.stack.imgur.com/2Nxpi.png" alt="enter image description here"></a></p>
  
  <p>I wonder if there is there a way to round Qt widget corners?</p>
  
  <pre><code>from PyQt4 import QtCore, QtGui
  
  class Custom(QtGui.QWidget):
      def __init__(self, *args, **kwargs):
          QtGui.QWidget.__init__(self, *args, **kwargs)
          self.setWindowOpacity(0.9)
          self.setWindowFlags(QtCore.Qt.Popup|QtCore.Qt.FramelessWindowHint)
          self.setWindowTitle('Custom')
          self.resize(440,220)
          self.move(QtGui.QCursor.pos())
  
      def closeEvent(self, event):
          event.accept()
          sys.exit(app.exec_())
  
      def mousePressEvent(self, event):
          self.close() 
  
  if __name__ == "__main__":
      app = QtGui.QApplication(sys.argv)
      w = Custom()
      w.show()
      sys.exit(app.exec_())
  </code></pre>