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 :
setCentralWidget(airview);
QPixmap pim
("./images/airport.jpg");
scene->setBackgroundBrush(pim.scaled(screen_width,screen_height,Qt::IgnoreAspectRatio,Qt::SmoothTransformation));
airview->setScene(scene);
int screen_width = QApplication::desktop()->width();
int screen_height = QApplication::desktop()->height();
scene = new QGraphicsScene(0,0,screen_width,screen_height);
airview = new QGraphicsView();
setCentralWidget(airview);
QPixmap pim("./images/airport.jpg");
scene->setBackgroundBrush(pim.scaled(screen_width,screen_height,Qt::IgnoreAspectRatio,Qt::SmoothTransformation));
airview->setScene(scene);
To copy to clipboard, switch view to plain text mode
Bookmarks