Skip to content

Files

Latest commit

 

History

History

QGraphicsView

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

QGraphicsView

1、绘制世界地图

运行 WorldMap.py

  1. 解析json数据生成 QPolygonF
  2. 使用Ctrl+滑轮进行放大缩小

WorldMap

2、添加QWidget

运行 AddQWidget.py

通过 QGraphicsScene.addWidget 添加自定义QWidget

AddQWidget

3、图片查看器

运行 ImageView.py

支持放大缩小和移动

ImageView

3、图标拖拽

运行 DragGraphics.py

该示例主要是包含左侧树状图标列表和右侧视图显示,从左侧拖拽到右侧

  1. 重写QListWidgetstartDrag函数用来封装拖拽数据
  2. 重写QGraphicsViewdragEnterEventdragMoveEventdropEvent函数用来处理拖拽事件

DragGraphics