14 int main(
int argc,
char** argv)
16 QApplication app(argc, argv);
17 QGraphicsScene scene(QRectF(-100, -100, 300, 300));
18 QGraphicsView view(&scene);
20 QGraphicsRectItem* pRectItem =
21 scene.addRect(QRectF(-30, -30, 120, 80),
25 pRectItem->setFlags(QGraphicsItem::ItemIsMovable);
27 QGraphicsPixmapItem* pPixmapItem =
28 scene.addPixmap(QPixmap(
":/haus.jpg"));
29 pPixmapItem->setFlags(QGraphicsItem::ItemIsMovable);
31 QGraphicsTextItem* pTextItem =
32 scene.addText(
"Move us with your mouse");
33 pTextItem->setFlags(QGraphicsItem::ItemIsMovable);
35 QGraphicsLineItem* pLineItem =
36 scene.addLine(QLineF(-10, -10, -80, -80), QPen(Qt::red, 2));
37 pLineItem->setFlags(QGraphicsItem::ItemIsMovable);
int main(int argc, char **argv)