当前位置:网站首页>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图形,比如线,长方形,三角形,圆形,譬如流程图里面的那些图形,箭头,笑脸符号,注释框,各种各样的符号,现在让你做一个流程图的软件
边栏推荐
- Debezium series: binlogreader for source code reading
- 新版代挂网站PHP源码+去除授权/支持燃鹅代抽
- Robot autonomous exploration series papers environment code
- Add get disabled for RC form
- Px4 autonomous flight
- JS number is insufficient, and 0 is added
- Leetcode206. Reverse linked list
- Debezium系列之: 支持在 KILL 命令中使用变量
- Cannot find module 'xxx' or its corresponding type declaration
- Quick sort (diagram +c code)
猜你喜欢
随机推荐
6-3 find the table length of the linked table
Record problems fgui tween animation will be inexplicably killed
php 记录完整对接腾讯云直播以及im直播群聊 所遇到的坑
Remember an experience of using selectmany
Apple further entered the financial sector through the 'virtual card' security function in IOS 16
LeetCode203. Remove linked list elements
Signal feature extraction +lstm to realize gear reducer fault diagnosis -matlab code
Common verification rules of form components -2 (continuously updating ~)
LeetCode142. Circular linked list II [two pointers, two methods for judging links in the linked list and finding ring points]
ASP. Net core introduction V
OpenGL homework - Hello, triangle
ASP.NET Core入门五
Remember aximp once Use of exe tool
PHP method of obtaining image information
Get the week start time and week end time of the current date
How to close eslint related rules
Pyqt GUI interface and logic separation
Debezium系列之:支持 mysql8 的 set role 语句
Dbsync adds support for mongodb and ES
7-51 combination of two ordered linked list sequences









