this is my code:
Qt Code:
  1. void FigureEditor::contentsMousePressEvent(QMouseEvent* e)
  2. {
  3. QPoint p = inverseWorldMatrix().mp(e->pos());
  4. QPoint tmpPointEdit = e->pos();
  5. QCanvasItemList l=canvas()->collisions(p);
  6. QCanvasItemList::Iterator it = l.begin();
  7. ImageItem *item;
  8. for (it; it!=l.end(); ++it) {
  9. if ( (*it)->rtti() == imageRTTI ) {
  10. item = (ImageItem*)(*it);
  11. if ( !item->hit( p ) )
  12. continue;
  13. }
  14.  
  15. tmpPointEdit = p;
  16. moving = *it;
  17. moving_start = p;
  18. break;
  19. }
  20. int ix = tmpPointEdit.x();
  21. int iy = tmpPointEdit.y();
  22. QImage *img = (QImage*)(*it);
  23. QRgb newPixel = img -> pixel( ix, iy );
  24. }
To copy to clipboard, switch view to plain text mode 
this code is one part of example: http://doc.trolltech.com/3.3/canvas-example.html
i have edited code in pressmouse method .
RUN:
+ First: i draw Rect with Red color on canvas. and use canvasview to show it.
+Second: i click on Rect. I want to get color at position when i press mouse. And save it into newPixel variable.
--> i wrong?