当前位置:网站首页>Qt Graphicsview图形视图使用总结附流程图开发案例雏形
Qt Graphicsview图形视图使用总结附流程图开发案例雏形
2022-07-07 21:47:00 【新潮技术研究社】
QGraphicsview的前身是QCanvas,可想而知,它就是画布,继承自QWidget,和QTableView,QListView等view都是可视控件,也就是可以show的控件。
对于这些View,我们知道,一般都得和一个Model绑定,Model负责内容的添加管理,View负责展示。所以,QGraphicsView同样有一个Model,就是QGraphicsScene,一个scene可以绑定多个view,scene可以设置大小,也可以不设置。
QGraphicsScene(qreal x, qreal y, qreal width, qreal height, QObject *parent = nullptr)
QGraphicsScene(const QRectF &sceneRect, QObject *parent = nullptr)
QGraphicsScene(QObject *parent = nullptr)
典型使用代码如下:
QGraphicsScene scene;
scene.addText("Hello, world!");
QGraphicsView view(&scene);
view.show();
Graphics View框架的作用就是,提供了一层表面,在这个面上,可以管理大量的2D图形,比如线,长方形,三角形,圆形,譬如流程图里面的那些图形,箭头,笑脸符号,注释框,各种各样的符号,现在让你做一个流程图的软件
边栏推荐
- Remember that a development is encountered in the pit of origin string sorting
- UWA Q & a collection
- Apple further entered the financial sector through the 'virtual card' security function in IOS 16
- Micro service remote debug, nocalhost + rainbow micro service development second bullet
- 全面掌控!打造智慧城市建设的“领导驾驶舱”
- 7-51 combination of two ordered linked list sequences
- Revit secondary development - get the thickness / length / height of the beam
- VTOL in Px4_ att_ Control source code analysis [supplement]
- Unity technical notes (II) basic functions of scriptableobject
- Unity local coordinates and world coordinates
猜你喜欢
行測-圖形推理-4-字母類
Remember an experience of using selectmany
Robot autonomous exploration series papers environment code
Blender exchange group, welcome to the water group ~
数字化转型:五个步骤推动企业进步
Micro service remote debug, nocalhost + rainbow micro service development second bullet
行测-图形推理-2-黑白格类
php 获取图片信息的方法
UWA Q & a collection
行测-图形推理-9-线条问题类
随机推荐
Remember aximp once Use of exe tool
“拧巴”的早教行业:万亿市场,难出巨头
OpenGL configure assimp
Revit secondary development - Hide occlusion elements
Debezium系列之:支持 mysql8 的 set role 语句
Cannot find module 'xxx' or its corresponding type declaration
OpenGL job coordinate system
Select sort (illustration +c code)
Debezium series: source code reading snapshot reader
Leetcode interview question 02.07 Linked list intersection [double pointer]
Build an "immune" barrier in the cloud to prepare your data
Unity technical notes (II) basic functions of scriptableobject
UnicodeDecodeError: ‘gbk‘ codec can‘t decode byte 0xf9 in position 56: illegal multibyte sequence
[interview arrangement] 0211 game engine server
详解全志V853上的ARM A7和RISC-V E907之间的通信方式
De la famille debezium: SET ROLE statements supportant mysql8
Use partial derivatives to display normals in unity
行测-图形推理-8-图群类
全面掌控!打造智慧城市建设的“领导驾驶舱”
php 记录完整对接腾讯云直播以及im直播群聊 所遇到的坑