QT画图

if (0)
    {
        QApplication a(argv, args);

        QGraphicsScene scene;
        scene.setSceneRect(-300,-300,600,600);
        scene.setItemIndexMethod(QGraphicsScene::NoIndex);
#if 0
        {
            QString name = "dec0";
            QGraphicsItemGroup* dec = createIPU(name, 0, 0);
            scene.addItem(dec);

            //QString name = "display";
            QGraphicsItemGroup* ids = createIPU("display", 50, 50);
            scene.addItem(ids);
        }
#endif

        QGraphicsView view(&scene);
        view.setRenderHint(QPainter::Antialiasing);
        view.setCacheMode(QGraphicsView::CacheBackground);
        view.setViewportUpdateMode(QGraphicsView::BoundingRectViewportUpdate);
        view.setDragMode(QGraphicsView::ScrollHandDrag);
        view.resize(400,300);
        view.show();
        return a.exec();
    }

  

原文地址:https://www.cnblogs.com/ranson7zop/p/7522543.html