I understood why the image wasn't displayed. I should wrote QFrame instead of QGraphicsView.

Qt Code:
  1. view->setStyleSheet("QFrame { background-image: url(grid.png) ;"
  2. "background-repeat: repeat }");
To copy to clipboard, switch view to plain text mode 

But I don't understand what is doing background-repeat option.
Is it repeat background image without scaling??? (I don't think so)

Here I want to show how I do zoom operation.

Qt Code:
  1. void LayoutEditor::zoomIn()
  2. {
  3. scaleFactor *= 1.25;
  4. view->scale(1.25, 1.25);
  5. if(scaleFactor >= 1.0) {
  6. // which function to use??????
  7. //view->setBackgroundBrush(QBrush(QPixmap("Resources\\grid.png")));
  8. //view->setStyleSheet("QFrame { background-image: url(grid.png) ;"
  9. "background-repeat: repeat }");
  10. }
  11. ...
  12.  
  13. }
  14.  
  15. void LayoutEditor::zoomOut()
  16. {
  17. scaleFactor *= 0.8;
  18. view->scale(0.8, 0.8);
  19. if(scaleFactor < 1.0) {
  20. view->setBackgroundBrush(QBrush(Qt::black));
  21. }
  22. ...
  23.  
  24. }
To copy to clipboard, switch view to plain text mode