Don't double post, please.

QPixmap::grabWidget() has been deprecated and is no longer in Qt5, so this code wouldn't compile even in C++. However, there is an alternative. I am not too familiar with PyQt5, but the code should look something like this (where "widget" the is one you want the pixels from):

Qt Code:
  1. pixMap = QPixmap( widget.width(), widget.height() )
  2. widget.render( pixMap )
  3. image = pixMap.toImage()
  4. color = image.pixelColor( 0, 0 )
To copy to clipboard, switch view to plain text mode