当前位置:网站首页>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图形,比如线,长方形,三角形,圆形,譬如流程图里面的那些图形,箭头,笑脸符号,注释框,各种各样的符号,现在让你做一个流程图的软件
边栏推荐
- LeetCode707. Design linked list
- 行测-图形推理-8-图群类
- Unity FAQ (I) lack of references
- [environment] pycharm sets the tool to convert QRC into py file
- Debezium系列之:mysql墓碑事件
- 行测-图形推理-4-字母类
- The PHP source code of the new website + remove authorization / support burning goose instead of pumping
- Blender exchange group, welcome to the water group ~
- LeetCode206. Reverse linked list [double pointer and recursion]
- How pyGame rotates pictures
猜你喜欢
Early childhood education industry of "screwing bar": trillion market, difficult to be a giant
ASP. Net core introduction V
Loki, the "open source star picking program", realizes the efficient management of harbor logs
Pdf document signature Guide
Force deduction - question 561 - array splitting I - step by step parsing
Visual studio 2019 installation
How to realize the movement control of characters in horizontal game
LeetCode206. Reverse linked list [double pointer and recursion]
Leetcode206. Reverse linked list
Matplotlib quick start
随机推荐
Revit secondary development - link file collision detection
Xcode modifies the default background image of launchscreen and still displays the original image
C # Development -- pit encountered in JS intermodulation
Nx10.0 installation tutorial
IP network active evaluation system -- x-vision
Remove the default background color of chrome input input box
Signal feature extraction +lstm to realize gear reducer fault diagnosis -matlab code
OpenGL jobs - shaders
Ligne - raisonnement graphique - 4 - classe de lettres
Remember an experience of using selectmany
Blender exchange group, welcome to the water group ~
The PHP source code of the new website + remove authorization / support burning goose instead of pumping
Form组件常用校验规则-2(持续更新中~)
Pdf document signature Guide
Ni9185 and ni9234 hardware settings in Ni Max
Use partial derivatives to display normals in unity
行测-图形推理-7-相异图形类
UWA Q & a collection
[problem] pytorch installation
[environment] pycharm sets the tool to convert QRC into py file