hi all:
I set a file(*.jpg) at the background of QGraphicsScene, but the picture as tiling on the scene , I want to tensilie the picture on the scene, what to do it?
thanks a lot.
the code :
Qt Code:
  1. int screen_width = QApplication::desktop()->width();
  2. int screen_height = QApplication::desktop()->height();
  3.  
  4. scene = new QGraphicsScene(0,0,screen_width,screen_height);
  5. airview = new QGraphicsView();
  6. setCentralWidget(airview);
  7. QPixmap pim("./images/airport.jpg");
  8. scene->setBackgroundBrush(pim.scaled(screen_width,screen_height,Qt::IgnoreAspectRatio,Qt::SmoothTransformation));
  9. airview->setScene(scene);
To copy to clipboard, switch view to plain text mode