Skip to content

Commit cd2a125

Browse files
committed
fix url jump and add ui preview
1 parent 63633ef commit cd2a125

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+712
-855
lines changed

.Update/Upgrade.1.1.zip

99.2 KB
Binary file not shown.

.Update/Upgrade.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1-
[]
1+
[
2+
[
3+
1.1,
4+
"1、修复部分url跳转打开了网页\n2、增加UI文件预览查看"
5+
]
6+
]

PyQtClient.py

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
3-
43
"""
54
Created on 2019年1月1日
65
@author: Irony
7-
@site: https://pyqt5.com https://github.com/892768447
6+
@site: https://pyqt.site https://github.com/PyQt5
87
@email: 892768447@qq.com
98
@file: PyQtClient
109
@description:
@@ -15,13 +14,6 @@
1514
import sys
1615
import traceback
1716

18-
19-
__Author__ = """By: Irony
20-
QQ: 892768447
21-
Email: 892768447@qq.com"""
22-
__Copyright__ = 'Copyright (c) 2019 Irony'
23-
__Version__ = 1.0
24-
2517
sys.path.append(os.path.abspath('Library.zip'))
2618

2719
libpath = get_python_lib()
@@ -31,10 +23,10 @@
3123
os.environ['QML2_IMPORT_PATH'] = os.environ['QML_IMPORT_PATH']
3224

3325
if os.name == 'nt':
34-
os.environ['PATH'] = os.path.join(
35-
libpath, 'PyQt5', 'Qt', 'bin') + os.pathsep + os.environ['PATH']
36-
os.environ['PATH'] = os.path.dirname(
37-
os.path.abspath(sys.argv[0])) + os.pathsep + os.environ['PATH']
26+
os.environ['PATH'] = os.path.join(libpath, 'PyQt5', 'Qt',
27+
'bin') + os.pathsep + os.environ['PATH']
28+
os.environ['PATH'] = os.path.dirname(os.path.abspath(
29+
sys.argv[0])) + os.pathsep + os.environ['PATH']
3830

3931
print(os.environ['PATH'])
4032

@@ -84,13 +76,10 @@ def do_analysis():
8476
config = Config()
8577
config.trace_filter = GlobbingFilter(
8678
include=['Widgets.*', 'Utils.*'],
87-
exclude=['pycallgraph2.*', '*.secret_function']
88-
)
89-
with PyCallGraph(
90-
GraphvizOutput(
91-
tool='D:/soft/Graphviz/bin/dot',
92-
output_file='call_detail.png'),
93-
config=config):
79+
exclude=['pycallgraph2.*', '*.secret_function'])
80+
with PyCallGraph(GraphvizOutput(tool='dot',
81+
output_file='call_detail.png'),
82+
config=config):
9483
MainWindow.main()
9584
except:
9685
MainWindow.main()

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ It requires both Python35+ and PyQt5 and QtWebKit.
66

77
需要 Python35+ PyQt5 和 QtWebKit
88

9-
## Installing (安装)
9+
## Installing
1010

1111
install requirements
1212

@@ -38,7 +38,9 @@ Replace QtWebKit to QtWebEngine
3838

3939
## Notice
4040

41-
If the first boot is slow 第一次运行很慢(因为在clone例子源码)
41+
第一次运行很慢(因为在clone例子源码)
42+
43+
If the first boot is slow
4244

4345
1. git clone https://github.com/PyQt5/PyQt.git
4446
2. move PyQt to PyQtClient\Resources\Data\Projects

Test/BaseApplyStyle.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
3-
43
"""
54
Created on 2019年1月28日
65
@author: Irony
7-
@site: https://pyqt5.com https://github.com/892768447
6+
@site: https://pyqt.site https://github.com/PyQt5
87
@email: 892768447@qq.com
98
@file: Test.BaseApplyStyle
109
@description:
1110
"""
12-
from PyQt5.QtWidgets import QWidget, QVBoxLayout, QPlainTextEdit, QPushButton,\
13-
QApplication
1411

12+
from PyQt5.QtWidgets import (QApplication, QPlainTextEdit, QPushButton,
13+
QVBoxLayout, QWidget)
1514

1615
__Author__ = 'Irony'
1716
__Copyright__ = 'Copyright (c) 2019'

Test/CustomCursor.py

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,31 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
3-
43
"""
54
Created on 2019年1月5日
65
@author: Irony
7-
@site: https://pyqt5.com https://github.com/892768447
6+
@site: https://pyqt.site https://github.com/PyQt5
87
@email: 892768447@qq.com
98
@file:
109
@description:
1110
"""
11+
1212
import os
1313

14-
from PyQt5.QtWidgets import QWidget, QApplication
1514
import win32api
1615
import win32con
1716
import win32gui
18-
19-
__Author__ = """By: Irony
20-
QQ: 892768447
21-
Email: 892768447@qq.com"""
22-
__Copyright__ = "Copyright (c) 2019 Irony"
23-
__Version__ = "Version 1.0"
17+
from PyQt5.QtWidgets import QApplication, QWidget
2418

2519

2620
class Window(QWidget):
2721

2822
def __init__(self, *args, **kwargs):
2923
super(Window, self).__init__(*args, **kwargs)
30-
c = win32gui.LoadImage(
31-
None,
32-
os.path.abspath('cursor.ani'),
33-
win32con.IMAGE_CURSOR, 0, 0, win32con.LR_LOADFROMFILE
34-
)
24+
c = win32gui.LoadImage(None, os.path.abspath('cursor.ani'),
25+
win32con.IMAGE_CURSOR, 0, 0,
26+
win32con.LR_LOADFROMFILE)
3527
print(c)
36-
win32api.SetClassLong(
37-
int(self.winId()),
38-
win32con.GCL_HCURSOR, c)
28+
win32api.SetClassLong(int(self.winId()), win32con.GCL_HCURSOR, c)
3929

4030

4131
if __name__ == '__main__':

Test/GenerateLanguage.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
3-
43
"""
54
Created on 2018年3月29日
65
@author: Irony
@@ -9,14 +8,8 @@
98
@file: GenerateLanguage
109
@description: 生成多语言文件
1110
"""
12-
import os
1311

14-
15-
__Author__ = """By: Irony
16-
QQ: 892768447
17-
Email: 892768447@qq.com"""
18-
__Copyright__ = "Copyright (c) 2018 Irony"
19-
__Version__ = "Version 1.0"
12+
import os
2013

2114
os.chdir('../')
2215

Test/RunCode.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,20 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
3-
43
"""
54
Created on 2019年1月9日
65
@author: Irony
7-
@site: https://pyqt5.com https://github.com/892768447
6+
@site: https://pyqt.site https://github.com/PyQt5
87
@email: 892768447@qq.com
98
@file: Utils.RunCode
109
@description: 过滤排序Model
1110
"""
11+
1212
import os
1313
import runpy
1414
import sys
1515
import traceback
1616

1717

18-
__Author__ = """By: Irony
19-
QQ: 892768447
20-
Email: 892768447@qq.com"""
21-
__Copyright__ = "Copyright (c) 2019 Irony"
22-
__Version__ = "Version 1.0"
23-
24-
2518
def escape(s):
2619
s = s.replace("&", "&")
2720
s = s.replace("<", "&lt;")
@@ -34,9 +27,9 @@ def escape(s):
3427

3528

3629
def showError(message):
37-
from PyQt5.QtWidgets import QApplication, QErrorMessage, QCheckBox, \
38-
QPushButton, QLabel, QStyle
3930
from PyQt5.QtCore import Qt
31+
from PyQt5.QtWidgets import (QApplication, QCheckBox, QErrorMessage, QLabel,
32+
QPushButton, QStyle)
4033
QApplication.addLibraryPath('./Qt/plugins')
4134
app = QApplication(sys.argv)
4235
app.setQuitOnLastWindowClosed(True)

Test/SlotsByName.py

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,27 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
3-
43
"""
54
Created on 2019年1月5日
65
@author: Irony
7-
@site: https://pyqt5.com https://github.com/892768447
6+
@site: https://pyqt.site https://github.com/PyQt5
87
@email: 892768447@qq.com
98
@file: Test.tSlotsByName
109
@description:
1110
"""
11+
1212
import sys
1313

1414
from PyQt5.QtCore import QMetaObject, pyqtSlot
15-
from PyQt5.QtWidgets import QWidget, QApplication, QVBoxLayout
16-
15+
from PyQt5.QtWidgets import QApplication, QVBoxLayout, QWidget
1716
from Widgets.Buttons.RotateButton import RotateButton
1817

1918

20-
__Author__ = """By: Irony
21-
QQ: 892768447
22-
Email: 892768447@qq.com"""
23-
__Copyright__ = "Copyright (c) 2019 Irony"
24-
__Version__ = "Version 1.0"
25-
26-
2719
class Ui_FormMainWindow(object):
2820

2921
def setupUi(self, FormMainWindow):
3022
layout = QVBoxLayout(FormMainWindow)
31-
layout.addWidget(RotateButton('test', FormMainWindow, objectName='buttonTest'))
23+
layout.addWidget(
24+
RotateButton('test', FormMainWindow, objectName='buttonTest'))
3225
QMetaObject.connectSlotsByName(FormMainWindow)
3326

3427

Test/TestColorThief.py

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,10 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
3-
from Utils.ColorThief import ColorThief
4-
53

6-
# Created on 2019年1月29日
7-
# author: Irony
8-
# site: https://github.com/892768447
9-
# email: 892768447@qq.com
10-
# file: Test.TestColorThief
11-
# description:
12-
__Author__ = """By: Irony
13-
QQ: 892768447
14-
Email: 892768447@qq.com"""
15-
__Copyright__ = 'Copyright (c) 2019 Irony'
16-
__Version__ = 1.0
4+
from Utils.ColorThief import ColorThief
175

186
# 获取图片主色调
197
color_thief = ColorThief(r'C:\Users\89276\Desktop\春节.jpg')
208
color = color_thief.get_color()
219

22-
print(color)
10+
print(color)

Utils/TestColourfulWidget.py renamed to Test/TestColourfulWidget.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,28 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
3-
43
"""
54
Created on 2019年1月20日
65
@author: Irony
7-
@site: https://pyqt5.com https://github.com/892768447
6+
@site: https://pyqt.site https://github.com/PyQt5
87
@email: 892768447@qq.com
98
@file: Utils.TestColourfulWidget
109
@description:
1110
"""
11+
1212
from Utils.CommonUtil import Signals
1313
from Widgets.Skins.ColourfulWidget import ColourfulWidget
1414

15-
1615
__Author__ = "Irony"
1716
__Copyright__ = "Copyright (c) 2019"
1817

1918
if __name__ == '__main__':
2019
import sys
21-
import os
22-
os.chdir('../')
20+
2321
from PyQt5.QtWidgets import QApplication
2422
app = QApplication(sys.argv)
2523
app.setStyleSheet(
26-
'ColourfulWidget{background:white;}\n#scrollArea,#scrollAreaWidgetContents{background:transparent;}')
24+
'ColourfulWidget{background:white;}\n#scrollArea,#scrollAreaWidgetContents{background:transparent;}'
25+
)
2726
w = ColourfulWidget()
2827
Signals.colourfulItemClicked.connect(
2928
lambda name, colors: print(name, colors))

Test/TestDownProgress.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
3-
43
"""
54
Created on 2019年1月17日
65
@author: Irony
7-
@site: https://pyqt5.com https://github.com/892768447
6+
@site: https://pyqt.site https://github.com/PyQt5
87
@email: 892768447@qq.com
98
@file: Test.TestDownProgress
109
@description:
@@ -17,7 +16,6 @@
1716

1817
import requests
1918

20-
2119
if __name__ == '__main__':
2220
url = 'https://rg.gosu.cc/PyQt5/PyQt/master/Demo/Data/dlib-19.4.0.win32-py3.5.exe'
2321
with closing(requests.get(url, stream=True)) as response:
@@ -31,4 +29,5 @@
3129
data_count = data_count + len(data)
3230
now_jd = (data_count / content_size) * 100
3331
print("\r 文件下载进度:%d%%(%d/%d) - %s" %
34-
(now_jd, data_count, content_size, url), end=" ")
32+
(now_jd, data_count, content_size, url),
33+
end=" ")

0 commit comments

Comments
 (0)