Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
892768447 committed Dec 28, 2018
1 parent 3dc4b85 commit 97909c3
Show file tree
Hide file tree
Showing 92 changed files with 550 additions and 1,442 deletions.
2 changes: 1 addition & 1 deletion .idea/PyQt.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Animation/README.en.md

This file was deleted.

2 changes: 1 addition & 1 deletion QChart/BarStack.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
'''
Created on 2017年12月28日
@author: Irony."[讽刺]
@site: http://alyl.vip, http://orzorz.vip, https://coding.net/u/892768447, https://github.com/892768447
@site: https://pyqt5.com https://github.com/892768447
@email: [email protected]
@file: charts.bar.BarStack
@description: like http://echarts.baidu.com/demo.html#bar-stack
Expand Down
2 changes: 1 addition & 1 deletion QChart/LineStack.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
'''
Created on 2017年12月28日
@author: Irony."[讽刺]
@site: http://alyl.vip, http://orzorz.vip, https://coding.net/u/892768447, https://github.com/892768447
@site: https://pyqt5.com https://github.com/892768447
@email: [email protected]
@file: charts.line.LineStack
@description: like http://echarts.baidu.com/demo.html#line-stack
Expand Down
2 changes: 1 addition & 1 deletion QChart/ToolTip.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
'''
Created on 2017年12月23日
@author: Irony."[讽刺]
@site: http://alyl.vip, http://orzorz.vip, https://coding.net/u/892768447, https://github.com/892768447
@site: https://pyqt5.com https://github.com/892768447
@email: [email protected]
@file: ToolTip
@description:
Expand Down
2 changes: 1 addition & 1 deletion QChart/ToolTip2.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
'''
Created on 2017年12月23日
@author: Irony."[讽刺]
@site: http://alyl.vip, http://orzorz.vip, https://coding.net/u/892768447, https://github.com/892768447
@site: https://pyqt5.com https://github.com/892768447
@email: [email protected]
@file: ToolTip2
@description:
Expand Down
2 changes: 1 addition & 1 deletion QComboBox/CityLinkage.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"""
Created on 2018年1月27日
@author: Irony."[讽刺]
@site: http://alyl.vip, http://orzorz.vip, https://coding.net/u/892768447, https://github.com/892768447
@site: https://pyqt5.com https://github.com/892768447
@email: [email protected]
@file: CityLinkage
@description: 下拉联动
Expand Down
2 changes: 1 addition & 1 deletion QFlowLayout/HotPlaylist.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
'''
Created on 2018年2月4日
@author: Irony."[讽刺]
@site: http://alyl.vip, http://orzorz.vip, https://coding.net/u/892768447, https://github.com/892768447
@site: https://pyqt5.com https://github.com/892768447
@email: [email protected]
@file: TencentMovieHotPlay_Flow
@description:
Expand Down
8 changes: 4 additions & 4 deletions 图形视图/添加QWidget.py → QGraphicsView/AddQWidget.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

'''
"""
Created on 2017年12月23日
@author: Irony."[讽刺]
@site: http://alyl.vip, http://orzorz.vip, https://coding.net/u/892768447, https://github.com/892768447
@site: https://pyqt5.com https://github.com/892768447
@email: [email protected]
@file: 添加QWidget
@file: AddQWidget
@description:
'''
"""
import sys

from PyQt5.QtCore import Qt
Expand Down
File renamed without changes.
16 changes: 16 additions & 0 deletions QGraphicsView/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# QGraphicsView

## 1、绘制世界地图
[运行 WorldMap.py](WorldMap.py)

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

![WorldMap](ScreenShot/WorldMap.gif)

## 2、添加QWidget
[运行 AddQWidget.py](AddQWidget.py)

通过 `QGraphicsScene.addWidget` 添加自定义QWidget

![AddQWidget](ScreenShot/AddQWidget.png)
File renamed without changes
Binary file added QGraphicsView/ScreenShot/WorldMap.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

'''
"""
Created on 2017年12月17日
@author: Irony."[讽刺]
@site: http://alyl.vip, http://orzorz.vip, https://coding.net/u/892768447, https://github.com/892768447
@site: https://pyqt5.com https://github.com/892768447
@email: [email protected]
@file: WorldMap
@description:
'''
"""
import json
import math

Expand Down Expand Up @@ -128,7 +128,7 @@ def scaleView(self, scaleFactor):

def initMap(self):
features = json.load(
open("world.json", encoding="utf8")).get("features")
open("Data/world.json", encoding="utf8")).get("features")
for feature in features:
geometry = feature.get("geometry")
if not geometry:
Expand Down
2 changes: 1 addition & 1 deletion QGridLayout/HotPlaylist.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
'''
Created on 2018年2月4日
@author: Irony."[讽刺]
@site: http://alyl.vip, http://orzorz.vip, https://coding.net/u/892768447, https://github.com/892768447
@site: https://pyqt5.com https://github.com/892768447
@email: [email protected]
@file: TencentMovieHotPlay
@description:
Expand Down
2 changes: 1 addition & 1 deletion QLabel/ShowImage.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
'''
Created on 2017年12月23日
@author: Irony."[讽刺]
@site: http://alyl.vip, http://orzorz.vip, https://coding.net/u/892768447, https://github.com/892768447
@site: https://pyqt5.com https://github.com/892768447
@email: [email protected]
@file: ShowImage
@description:
Expand Down
2 changes: 1 addition & 1 deletion QListWidget/HotPlaylist.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
'''
Created on 2018年2月4日
@author: Irony."[讽刺]
@site: http://alyl.vip, http://orzorz.vip, https://coding.net/u/892768447, https://github.com/892768447
@site: https://pyqt5.com https://github.com/892768447
@email: [email protected]
@file: TencentMovieHotPlay_ListWidget
@description:
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions QPropertyAnimation/README.en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# QPropertyAnimation
2 changes: 1 addition & 1 deletion Animation/README.md → QPropertyAnimation/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Animation
# QPropertyAnimation

# 1、窗口淡入淡出
[运行 FadeInOut.py](FadeInOut.py)
Expand Down
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
2 changes: 1 addition & 1 deletion QWebEngineView/GetCookie.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
'''
Created on 2017年12月10日
@author: Irony."[讽刺]
@site: http://alyl.vip, http://orzorz.vip, https://coding.net/u/892768447, https://github.com/892768447
@site: https://pyqt5.com https://github.com/892768447
@email: [email protected]
@file: GetCookie
@description:
Expand Down
2 changes: 1 addition & 1 deletion QWebView/GetCookie.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
'''
Created on 2017年12月10日
@author: Irony."[讽刺]
@site: http://alyl.vip, http://orzorz.vip, https://coding.net/u/892768447, https://github.com/892768447
@site: https://pyqt5.com https://github.com/892768447
@email: [email protected]
@file: GetCookie
@description:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ https://pyqt5.com 社区是专门针对PyQt5学习和提升开设的博客网站
| 分类 | 目录 |
|:-------|:-------|
| ActiveX | [QAxWidget](QAxWidget)
| 动画 | [Animation](Animation)
| 日历 | [QCalendarWidget](QCalendarWidget)
| 复选框 | [QCheckBox](QCheckBox)
| 列视图 | [QColumnView](QColumnView)
Expand Down Expand Up @@ -37,6 +36,7 @@ https://pyqt5.com 社区是专门针对PyQt5学习和提升开设的博客网站
| OpenGL | [QOpenGLWidget](QOpenGLWidget)
| 纯文本 | [QPlainTextEdit](QPlainTextEdit)
| 进度条 | [QProgressBar](QProgressBar)
| 动画 | [QPropertyAnimation](QPropertyAnimation)
| 代理样式 | [QProxyStyle](QProxyStyle)
| 按钮 | [QPushButton](QPushButton)
| 单选框 | [QRadioButton](QRadioButton)
Expand Down
88 changes: 44 additions & 44 deletions 其它/QRC资源文件使用/qrctest1.py
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

'''
Created on 2018年05月01日
@author: Irony."[讽刺]
@site: http://alyl.vip, http://orzorz.vip, https://coding.net/u/892768447, https://github.com/892768447
@email: [email protected]
@file: qrctest1
@description:
'''

from PyQt5.QtGui import QPixmap
from PyQt5.QtWidgets import QLabel

import res_rc # @UnusedImport @UnresolvedImport


__Author__ = "By: Irony.\"[讽刺]\nQQ: 892768447\nEmail: [email protected]"
__Copyright__ = "Copyright (c) 2017 Irony.\"[讽刺]"
__Version__ = "Version 1.0"


class ImageView(QLabel):

def __init__(self, *args, **kwargs):
super(ImageView, self).__init__(*args, **kwargs)
self.resize(800, 600)

# 从资源文件res_rc.py中加载
# 转换命令pyrcc5 res.qrc -o res_rc.py
# 这种方式是从通过pyrcc5转换res.qrc为res_rc.py文件,可以直接import加载
# 此时可以通过路径:/images/head.jpg来访问
self.setPixmap(QPixmap(":/images/head.jpg"))


if __name__ == "__main__":
import sys
from PyQt5.QtWidgets import QApplication
app = QApplication(sys.argv)
app.aboutToQuit.connect(res_rc.qCleanupResources) # 退出时要清理资源
w = ImageView()
w.show()
sys.exit(app.exec_())
#!/usr/bin/env python
# -*- coding: utf-8 -*-

'''
Created on 2018年05月01日
@author: Irony."[讽刺]
@site: https://pyqt5.com https://github.com/892768447
@email: [email protected]
@file: qrctest1
@description:
'''

from PyQt5.QtGui import QPixmap
from PyQt5.QtWidgets import QLabel

import res_rc # @UnusedImport @UnresolvedImport


__Author__ = "By: Irony.\"[讽刺]\nQQ: 892768447\nEmail: [email protected]"
__Copyright__ = "Copyright (c) 2017 Irony.\"[讽刺]"
__Version__ = "Version 1.0"


class ImageView(QLabel):

def __init__(self, *args, **kwargs):
super(ImageView, self).__init__(*args, **kwargs)
self.resize(800, 600)

# 从资源文件res_rc.py中加载
# 转换命令pyrcc5 res.qrc -o res_rc.py
# 这种方式是从通过pyrcc5转换res.qrc为res_rc.py文件,可以直接import加载
# 此时可以通过路径:/images/head.jpg来访问
self.setPixmap(QPixmap(":/images/head.jpg"))


if __name__ == "__main__":
import sys
from PyQt5.QtWidgets import QApplication
app = QApplication(sys.argv)
app.aboutToQuit.connect(res_rc.qCleanupResources) # 退出时要清理资源
w = ImageView()
w.show()
sys.exit(app.exec_())
88 changes: 44 additions & 44 deletions 其它/QRC资源文件使用/qrctest2.py
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

'''
Created on 2018年05月01日
@author: Irony."[讽刺]
@site: http://alyl.vip, http://orzorz.vip, https://coding.net/u/892768447, https://github.com/892768447
@email: [email protected]
@file: qrctest2
@description:
'''


from PyQt5.QtCore import QResource
from PyQt5.QtGui import QPixmap
from PyQt5.QtWidgets import QLabel


__Author__ = "By: Irony.\"[讽刺]\nQQ: 892768447\nEmail: [email protected]"
__Copyright__ = "Copyright (c) 2017 Irony.\"[讽刺]"
__Version__ = "Version 1.0"


class ImageView(QLabel):

def __init__(self, *args, **kwargs):
super(ImageView, self).__init__(*args, **kwargs)
self.resize(800, 600)
self.setPixmap(QPixmap(":/images/head.jpg"))


if __name__ == "__main__":
import sys
from PyQt5.QtWidgets import QApplication
app = QApplication(sys.argv)
# 从二进制资源文件res.data中加载
# 转换命令cd tools
# rcc.exe -binary ../res.qrc -o ../res.data
# 此时需要注册
QResource.registerResource("res.data")
app.aboutToQuit.connect(lambda: QResource.unregisterResource("res.data"))
w = ImageView()
w.show()
sys.exit(app.exec_())
#!/usr/bin/env python
# -*- coding: utf-8 -*-

'''
Created on 2018年05月01日
@author: Irony."[讽刺]
@site: https://pyqt5.com https://github.com/892768447
@email: [email protected]
@file: qrctest2
@description:
'''


from PyQt5.QtCore import QResource
from PyQt5.QtGui import QPixmap
from PyQt5.QtWidgets import QLabel


__Author__ = "By: Irony.\"[讽刺]\nQQ: 892768447\nEmail: [email protected]"
__Copyright__ = "Copyright (c) 2017 Irony.\"[讽刺]"
__Version__ = "Version 1.0"


class ImageView(QLabel):

def __init__(self, *args, **kwargs):
super(ImageView, self).__init__(*args, **kwargs)
self.resize(800, 600)
self.setPixmap(QPixmap(":/images/head.jpg"))


if __name__ == "__main__":
import sys
from PyQt5.QtWidgets import QApplication
app = QApplication(sys.argv)
# 从二进制资源文件res.data中加载
# 转换命令cd tools
# rcc.exe -binary ../res.qrc -o ../res.data
# 此时需要注册
QResource.registerResource("res.data")
app.aboutToQuit.connect(lambda: QResource.unregisterResource("res.data"))
w = ImageView()
w.show()
sys.exit(app.exec_())
Loading

0 comments on commit 97909c3

Please sign in to comment.