I have used this code and seems that works fine:

Qt Code:
  1. QPixmap qPix = QPixmap::grabWidget(ui->myWidget);
  2. QImage image(qPix.toImage());
  3. QColor color(image.pixel(0, 1));
To copy to clipboard, switch view to plain text mode 

Thanks!