当前位置:网站首页>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图形,比如线,长方形,三角形,圆形,譬如流程图里面的那些图形,箭头,笑脸符号,注释框,各种各样的符号,现在让你做一个流程图的软件
边栏推荐
- UWA问答精选
- Leetcode94. Middle order traversal of binary trees
- How to choose the appropriate automated testing tools?
- OpenGL job coordinate system
- Leetcode19. Delete the penultimate node of the linked list [double pointer]
- Line test - graphic reasoning - 4 - alphabetic class
- Gazebo import the mapping model created by blender
- Ueeditor custom display insert code
- C development - interprocess communication - named pipeline
- Redis official ORM framework is more elegant than redistemplate
猜你喜欢

Leetcode94. Middle order traversal of binary trees

php 获取图片信息的方法

Cannot find module 'xxx' or its corresponding type declaration

How to judge whether the input content is "number"

Dayu200 experience officer MPPT photovoltaic power generation project dayu200, hi3861, Huawei cloud iotda
![[environment] pycharm sets the tool to convert QRC into py file](/img/4f/d1c811dea23e3695a8b6d04b938bb5.jpg)
[environment] pycharm sets the tool to convert QRC into py file

ASP.NET Core入门五
![[problem] pytorch installation](/img/9f/1419c471838e3af8ea2158266254a5.jpg)
[problem] pytorch installation

“拧巴”的早教行业:万亿市场,难出巨头

IP network active evaluation system -- x-vision
随机推荐
LeetCode203. Remove linked list elements
行測-圖形推理-4-字母類
ASP. Net core introduction V
Cataloger integrates lidar and IMU for 2D mapping
C # realizes the communication between Modbus protocol and PLC
How pyGame rotates pictures
Unity FAQ (I) lack of references
Unity technical notes (II) basic functions of scriptableobject
Unity technical notes (I) inspector extension
Signal feature extraction +lstm to realize gear reducer fault diagnosis -matlab code
行测-图形推理-9-线条问题类
戴森官方直营店免费造型服务现已开放预约 先锋科技诠释护发造型理念,助力消费者解锁多元闪耀造型
Leetcode19. Delete the penultimate node of the linked list [double pointer]
微服務遠程Debug,Nocalhost + Rainbond微服務開發第二彈
苹果在iOS 16中通过'虚拟卡'安全功能进一步进军金融领域
Common verification rules of form components -2 (continuously updating ~)
OpenGL configuration vs2019
[interview arrangement] 0211 game engine server
Add get disabled for RC form
如何选择合适的自动化测试工具?