Here are two QWidget painted black. The painting on left QWidget was performed using QPainter(overriding ::paintEvent(...)). The right widget was "painted" using QStyleSheet.



This work was done in PyQt4 (Python: 2.7.11+/Qt: 4.8.7/PyQt4: 4.11.4). But you I have achieved the same result using PyQt5 and C++ Qt4/Qt5.
The code I used to paint the left QWidget is
Qt Code:
  1. def paintEvent( self, pEvent ) :
  2. painter = QPainter( self )
  3. painter.setRenderHints( QPainter.HighQualityAntialiasing )
  4.  
  5. painter.setPen( Qt.black )
  6. painter.setBrush( Qt.black )
  7.  
  8. painter.drawRoundedRect( self.rect(), 10.0, 10.0 )
  9.  
  10. painter.end()
  11.  
  12. pEvent.accept()
To copy to clipboard, switch view to plain text mode 

The stylesheet used on the right widget is

Qt Code:
  1. setStyleSheet( "border-radius: 10px; border: 1px solid black; background: black;" )
To copy to clipboard, switch view to plain text mode 

Why is there a difference between the two, especially the rounded part drawn by QStyleSheet far more smoother than the one done by QPainter despite using QPainter.HighQualityAntialiasing render hint? You could use just QPainter.Antialiasing or QPainter.TextAntialiasing and still the situation does not improve.