Skip to content

Commit

Permalink
Reformat code with isort
Browse files Browse the repository at this point in the history
  • Loading branch information
muziing committed Feb 21, 2022
1 parent 4064554 commit e114071
Show file tree
Hide file tree
Showing 199 changed files with 396 additions and 219 deletions.
3 changes: 2 additions & 1 deletion 01-PyQt基本结构/01-PyQt5-初体验.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from PyQt5.Qt import *
import sys

from PyQt5.Qt import *

app = QApplication(sys.argv)

window = QWidget()
Expand Down
3 changes: 2 additions & 1 deletion 01-PyQt基本结构/02-PyQt5程序基本结构分析.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# 0.导入需要的包和模块
from PyQt5.Qt import * # 主要包含了我们常用的一些类,汇总到了一块
import sys

from PyQt5.Qt import * # 主要包含了我们常用的一些类,汇总到了一块

# 代码 执行方式 1.Pycharm 2. 命令行 python + 代码名称
# 当通过命令行启动这个程序的时候,可以设定一种功能(接收命令行传递的参数,来执行不同的业务逻辑)
# sys.argv "从程序外部获取参数的桥梁"
Expand Down
3 changes: 2 additions & 1 deletion 01-PyQt基本结构/03-面向对象版本代码.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from PyQt5.Qt import *
import sys

from PyQt5.Qt import *


class Window(QWidget):
"""自定义的窗口类,继承自QWidget"""
Expand Down
3 changes: 2 additions & 1 deletion 02-QObject/01-QObject.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from PyQt5.Qt import *
import sys

from PyQt5.Qt import *


class Window(QWidget):
def __init__(self):
Expand Down
2 changes: 1 addition & 1 deletion 02-QObject/02-QObject_2.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from PyQt5.Qt import *
import sys

from PyQt5.Qt import *

if __name__ == "__main__":
app = QApplication(sys.argv)
Expand Down
3 changes: 2 additions & 1 deletion 02-QObject/03-信号的操作.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from PyQt5.Qt import *
import sys

from PyQt5.Qt import *

"""
关于PyQt信号(Signal)与槽(Slot)机制,后面还有一个43-pyqtSignal目录讲解
可以在学习各种控件的过程中逐渐体会信号与槽的连接、传参等等
Expand Down
3 changes: 2 additions & 1 deletion 02-QObject/04-信号的操作(小案例1).py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from PyQt5.Qt import *
import sys

from PyQt5.Qt import *


class Window(QWidget):
def __init__(self):
Expand Down
3 changes: 2 additions & 1 deletion 02-QObject/05-信号的操作(小案例2).py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from PyQt5.Qt import *
import sys

from PyQt5.Qt import *

# 要求: 每次改变窗口标题,都自动加上muzing前缀,能重复使用
app = QApplication(sys.argv)

Expand Down
3 changes: 2 additions & 1 deletion 02-QObject/06-QObject类型判定.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from PyQt5.Qt import *
import sys

from PyQt5.Qt import *


class Window(QWidget):
def __init__(self):
Expand Down
3 changes: 2 additions & 1 deletion 02-QObject/07-QObject类型判定-案例.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from PyQt5.Qt import *
import sys

from PyQt5.Qt import *


class Window(QWidget):
def __init__(self):
Expand Down
3 changes: 2 additions & 1 deletion 02-QObject/08-QObject对象删除.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from PyQt5.Qt import *
import sys

from PyQt5.Qt import *


class Window(QWidget):
def __init__(self):
Expand Down
1 change: 1 addition & 0 deletions 02-QObject/09-PyQt事件机制.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import sys

from PyQt5.Qt import *


Expand Down
3 changes: 2 additions & 1 deletion 02-QObject/10-QObject定时器.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from PyQt5.Qt import *
import sys

from PyQt5.Qt import *


class MyObject(QObject):
def timerEvent(self, evt):
Expand Down
3 changes: 2 additions & 1 deletion 02-QObject/11-QObject定时器-案例.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from PyQt5.Qt import *
import sys

from PyQt5.Qt import *


class MyObject(QObject):
def timerEvent(self, evt):
Expand Down
3 changes: 2 additions & 1 deletion 03-QWidget/01-QWidget-简介.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from PyQt5.Qt import *
import sys

from PyQt5.Qt import *

"""
QWidget
1.所有可视控件的基类
Expand Down
3 changes: 2 additions & 1 deletion 03-QWidget/02-QWidget-大小位置.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from PyQt5.Qt import *
import sys

from PyQt5.Qt import *

app = QApplication(sys.argv)

window = QWidget()
Expand Down
1 change: 1 addition & 0 deletions 03-QWidget/03-QWidget-案例.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import sys

from PyQt5.Qt import *

"""案例要求:将20个大小相同的子控件以3列均匀填满窗口"""
Expand Down
3 changes: 2 additions & 1 deletion 03-QWidget/04-QWidget-最大最小尺寸-API.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from PyQt5.Qt import *
import sys

from PyQt5.Qt import *

# 1. 创建一个应用程序对象
app = QApplication(sys.argv)

Expand Down
3 changes: 2 additions & 1 deletion 03-QWidget/05-QWidget-内容边距操作.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from PyQt5.Qt import *
import sys

from PyQt5.Qt import *

# 1. 创建一个应用程序对象
app = QApplication(sys.argv)

Expand Down
3 changes: 2 additions & 1 deletion 03-QWidget/06-QWidget-鼠标相关操作.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from PyQt5.Qt import *
import sys

from PyQt5.Qt import *

# 1. 创建一个应用程序对象
app = QApplication(sys.argv)

Expand Down
3 changes: 2 additions & 1 deletion 03-QWidget/07-QWidget-鼠标跟踪-API.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from PyQt5.Qt import *
import sys

from PyQt5.Qt import *


class MyWindow(QWidget):
# QMouseEvent
Expand Down
1 change: 1 addition & 0 deletions 03-QWidget/08-QWidget-鼠标相关操作-案例.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import sys

from PyQt5.Qt import *

"""替换鼠标图标、创建一个Label并使其跟随鼠标移动"""
Expand Down
3 changes: 2 additions & 1 deletion 03-QWidget/09-QWidget-案例1-鼠标移入移出.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from PyQt5.Qt import *
import sys

from PyQt5.Qt import *


class MyLabel(QLabel):
def enterEvent(self, *args, **kwargs):
Expand Down
3 changes: 2 additions & 1 deletion 03-QWidget/10-QWidget-案例2-键盘点击案例.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from PyQt5.Qt import *
import sys

from PyQt5.Qt import *


class MyLabel(QLabel):
def keyPressEvent(self, evt):
Expand Down
5 changes: 3 additions & 2 deletions 03-QWidget/11-QWidget-案例3-鼠标拖动窗口案例.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from PyQt5.Qt import *
from PyQt5 import QtGui
import sys

from PyQt5 import QtGui
from PyQt5.Qt import *

"""鼠标可以在用户区域内实现对整个窗口的拖动。(原先只能拖动标题栏时移动)"""


Expand Down
3 changes: 2 additions & 1 deletion 03-QWidget/12-QWidget-父子关系-API.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from PyQt5.Qt import *
import sys

from PyQt5.Qt import *

# 1. 创建一个应用程序对象
app = QApplication(sys.argv)

Expand Down
3 changes: 2 additions & 1 deletion 03-QWidget/13-QWidget-父子关系-案例.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from PyQt5.Qt import *
import sys

from PyQt5.Qt import *

"""点击哪个label,哪个label的背景颜色就变红。重写QLabel和QWidget(父控件)两种方法"""


Expand Down
5 changes: 3 additions & 2 deletions 03-QWidget/14-QWidget-层级关系调整.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from PyQt5.Qt import *
from PyQt5 import QtGui
import sys

from PyQt5 import QtGui
from PyQt5.Qt import *


class MyLabel(QLabel):
"""重写QLabel的mousePressEvent方法以实现点击谁就把谁放到顶层"""
Expand Down
3 changes: 2 additions & 1 deletion 03-QWidget/15-QWidget-顶层窗口相关操作.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from PyQt5.Qt import *
import sys

from PyQt5.Qt import *

# 1. 创建一个应用程序对象
app = QApplication(sys.argv)

Expand Down
3 changes: 2 additions & 1 deletion 03-QWidget/16-QWidget-窗口状态.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from PyQt5.Qt import *
import sys

from PyQt5.Qt import *

app = QApplication(sys.argv)

w1 = QWidget()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from PyQt5.Qt import *
from PyQt5 import QtGui
import sys

from PyQt5 import QtGui
from PyQt5.Qt import *


class Window(QWidget):
def mousePressEvent(self, a0: QtGui.QMouseEvent) -> None:
Expand Down
5 changes: 3 additions & 2 deletions 03-QWidget/18-QWidget-顶层窗口操作-案例.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from PyQt5.Qt import *
from PyQt5 import QtGui
import sys

from PyQt5 import QtGui
from PyQt5.Qt import *

"""案例:创建一个无边框、半透明的窗口;自定义关闭、最大化、最小化三个按钮;实现能够点击用户区域拖动窗口"""


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from PyQt5.Qt import *
import sys

from PyQt5.Qt import *


class Window(QWidget):
def paintEvent(self, evt):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from PyQt5.Qt import *
import sys

from PyQt5.Qt import *

# 1. 创建一个应用程序对象
app = QApplication(sys.argv)

Expand Down
3 changes: 2 additions & 1 deletion 03-QWidget/21-QWidget-交互状态-关闭与释放.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from PyQt5.Qt import *
import sys

from PyQt5.Qt import *

# 1. 创建一个应用程序对象
app = QApplication(sys.argv)

Expand Down
3 changes: 2 additions & 1 deletion 03-QWidget/22-QWidget-交互状态-案例-登录界面.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from PyQt5.Qt import *
import sys

from PyQt5.Qt import *


class Window(QWidget):
def __init__(self):
Expand Down
3 changes: 2 additions & 1 deletion 03-QWidget/23-QWidget-信息提示.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from PyQt5.Qt import *
import sys

from PyQt5.Qt import *

app = QApplication(sys.argv)

# window = QWidget()
Expand Down
3 changes: 2 additions & 1 deletion 03-QWidget/24-QWidget-焦点控制.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from PyQt5.Qt import *
import sys

from PyQt5.Qt import *


class Window(QWidget):
def mousePressEvent(self, evt) -> None:
Expand Down
3 changes: 2 additions & 1 deletion 04-QAbstractButton/01-QAbstractButton-简单介绍.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from PyQt5.Qt import *
import sys

from PyQt5.Qt import *

# 1. 创建一个应用程序对象
app = QApplication(sys.argv)

Expand Down
3 changes: 2 additions & 1 deletion 04-QAbstractButton/02-QAbstractButton-功能测试.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from PyQt5.Qt import *
import sys

from PyQt5.Qt import *

app = QApplication(sys.argv)

window = QWidget()
Expand Down
3 changes: 2 additions & 1 deletion 04-QAbstractButton/03-QAbstractButton-状态设置.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from PyQt5.Qt import *
import sys

from PyQt5.Qt import *

app = QApplication(sys.argv)

window = QWidget()
Expand Down
3 changes: 2 additions & 1 deletion 04-QAbstractButton/04-QAbstractButton-排他性.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from PyQt5.Qt import *
import sys

from PyQt5.Qt import *

"""
QPushButton 默认无排他性
QRadioButton 默认有排他性
Expand Down
3 changes: 2 additions & 1 deletion 04-QAbstractButton/05-QAbstractButton-模拟点击.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from PyQt5.Qt import *
import sys

from PyQt5.Qt import *

app = QApplication(sys.argv)

window = QWidget()
Expand Down
5 changes: 3 additions & 2 deletions 04-QAbstractButton/06-QAbstractButton-点击有效区域.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from PyQt5.Qt import *
from PyQt5 import QtGui
import sys

from PyQt5 import QtGui
from PyQt5.Qt import *

app = QApplication(sys.argv)

window = QWidget()
Expand Down
Loading

0 comments on commit e114071

Please sign in to comment.