I guess you want to get pixel from a given position. Assume the given position comes from mouse position.
Say, a class inherited from QGraphicsView:
MyView::MyView( QWidget *parent=0 ) : QGraphicsView(parent)
{
setScene( new QGraphicsScene( this ) );
this->scene()->addPixmap(QPixmap::fromImage(this->image)); // this->image is a QImage
}
Then, implement mouse event
void MyView::mouseMoveEvent( QMouseEvent* event )
{
QPointF pos = mapToScene( event->pos() );
QRgb rgb = this->image.pixel( ( int )pos.x(), ( int )pos.y() );
}