当前位置:网站首页>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图形,比如线,长方形,三角形,圆形,譬如流程图里面的那些图形,箭头,笑脸符号,注释框,各种各样的符号,现在让你做一个流程图的软件
边栏推荐
- Leetcode1984. Minimum difference in student scores
- Basic knowledge of linked list
- Revit secondary development - link file collision detection
- Explain in detail the communication mode between arm A7 and risc-v e907 on Quanzhi v853
- Visual design form QT designer design gui single form program
- How to write an augmented matrix into TXT file
- Debezium series: set role statement supporting mysql8
- PHP records the pitfalls encountered in the complete docking of Tencent cloud live broadcast and im live group chat
- How to choose the appropriate automated testing tools?
- 行測-圖形推理-4-字母類
猜你喜欢
Form组件常用校验规则-2(持续更新中~)
[azure microservice service fabric] start the performance monitor in the SF node and set the method of capturing the process
UnicodeDecodeError: ‘gbk‘ codec can‘t decode byte 0xf9 in position 56: illegal multibyte sequence
0-5VAC转4-20mA交流电流隔离变送器/转换模块
Digital transformation: five steps to promote enterprise progress
Add get disabled for RC form
. Net automapper use
LeetCode144. Preorder traversal of binary tree
Firefox browser installation impression notes clipping
Blender exchange group, welcome to the water group ~
随机推荐
OpenGL configure assimp
Debezium系列之:引入对 LATERAL 运算符的支持
行测-图形推理-6-相似图形类
Common verification rules of form components -2 (continuously updating ~)
This experimental syntax requires enabling the parser plugin: ‘optionalChaining‘
筑起云端 “免疫”屏障,让你的数据有备无患
LeetCode206. Reverse linked list [double pointer and recursion]
Install mxnet GPU version
行测-图形推理-9-线条问题类
[interview arrangement] 0211 game engine server
行测-图形推理-2-黑白格类
Class implementation of linear stack and linear queue (another binary tree pointer version)
Matplotlib快速入门
Firefox browser installation impression notes clipping
0-5vac to 4-20mA AC current isolated transmitter / conversion module
How to write an augmented matrix into TXT file
Robot autonomous exploration DSVP: code parsing
Redis官方ORM框架比RedisTemplate更优雅
OpenGL configuration vs2019
What does it mean to prefix a string with F?