Reflection Question ...
-
X: Scale on x axis to -1 and translate by height.
Y: Scale on y axis to -1 and translate by width. -
@
QPixmap batman("./batman.png");QGraphicsScene* scene = new QGraphicsScene(); QGraphicsPixmapItem* normalItem = scene->addPixmap(batman); QGraphicsPixmapItem* mirrorItem = scene->addPixmap(batman); QGraphicsScale* scale = new QGraphicsScale(scene); scale->setXScale(-1.0); mirrorItem->setTransformations(QList<QGraphicsTransform*>() << scale); ui->graphicsView->setScene(scene);
@
gives you this:
!http://img37.imageshack.us/img37/1167/batmanzq.jpg(batman picture)! -
If you ask about QGraphicsView I'd suggest reading through docs. They are really comprehensive.
Also check "Qt examples":http://qt-project.org/doc/qt-4.8/examples-graphicsview.htmlAs for batman I'd try "this link":http://www.dccomics.com/ :)
-
ok ok tnx alot :) . i have another question : how can i draw PolyLine in graphicsscene like other graphics object ? i want that can select and move it and other option like other object in graphic ?
i know that must create one class and inherit form QGrItem but i dont know how can i calculate bounding rect and shape and .... :(
-
Another name for polyline is path, and there's already a class for it in Qt: "QGraphicsPathItem":http://qt-project.org/doc/qt-5.0/qtwidgets/qgraphicspathitem.html