#include static QGraphicsTextItem* createItem(QPointF pos) { QGraphicsTextItem* text = new QGraphicsTextItem(); text->setPlainText("Note"); text->setFlag(QGraphicsItem::ItemIsMovable); text->setPos(pos); return text; } int main(int argc, char** argv) { QApplication app(argc, argv); QGraphicsScene scene; scene.setSceneRect(0, 0, 400, 280); scene.addItem(createItem(QPointF(20, 20))); scene.addItem(createItem(QPointF(100, 20))); scene.setBackgroundBrush(Qt::darkGreen); QGraphicsView view(&scene); view.setTransform(QTransform::fromScale(10, 10)); view.verticalScrollBar()->setValue(0); view.horizontalScrollBar()->setValue(0); view.show(); return app.exec(); }