QGraphicsView简单Demo

int main(int argc, char *argv[])

{
    QApplication a(argc, argv);
    MainWindow w;
    //w.show();
    QGraphicsScene scene;
    QLineF line(0,0,500,500);
    scene.addLine(line);
    scene.addText("Hello, world!");
    QGraphicsView view(&scene);
    view.show();
    return a.exec();
}
image
posted @ 2020-03-23 14:21  Werial  阅读(1331)  评论(0编辑  收藏  举报