Skip to content

Commit

Permalink
fix url jump and add ui preview
Browse files Browse the repository at this point in the history
  • Loading branch information
892768447 committed Mar 4, 2022
1 parent 63633ef commit cd2a125
Show file tree
Hide file tree
Showing 67 changed files with 712 additions and 855 deletions.
Binary file added .Update/Upgrade.1.1.zip
Binary file not shown.
7 changes: 6 additions & 1 deletion .Update/Upgrade.json
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
[]
[
[
1.1,
"1、修复部分url跳转打开了网页\n2、增加UI文件预览查看"
]
]
29 changes: 9 additions & 20 deletions PyQtClient.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
Created on 2019年1月1日
@author: Irony
@site: https://pyqt5.com https://github.com/892768447
@site: https://pyqt.site https://github.com/PyQt5
@email: 892768447@qq.com
@file: PyQtClient
@description:
Expand All @@ -15,13 +14,6 @@
import sys
import traceback


__Author__ = """By: Irony
QQ: 892768447
Email: 892768447@qq.com"""
__Copyright__ = 'Copyright (c) 2019 Irony'
__Version__ = 1.0

sys.path.append(os.path.abspath('Library.zip'))

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

if os.name == 'nt':
os.environ['PATH'] = os.path.join(
libpath, 'PyQt5', 'Qt', 'bin') + os.pathsep + os.environ['PATH']
os.environ['PATH'] = os.path.dirname(
os.path.abspath(sys.argv[0])) + os.pathsep + os.environ['PATH']
os.environ['PATH'] = os.path.join(libpath, 'PyQt5', 'Qt',
'bin') + os.pathsep + os.environ['PATH']
os.environ['PATH'] = os.path.dirname(os.path.abspath(
sys.argv[0])) + os.pathsep + os.environ['PATH']

print(os.environ['PATH'])

Expand Down Expand Up @@ -84,13 +76,10 @@ def do_analysis():
config = Config()
config.trace_filter = GlobbingFilter(
include=['Widgets.*', 'Utils.*'],
exclude=['pycallgraph2.*', '*.secret_function']
)
with PyCallGraph(
GraphvizOutput(
tool='D:/soft/Graphviz/bin/dot',
output_file='call_detail.png'),
config=config):
exclude=['pycallgraph2.*', '*.secret_function'])
with PyCallGraph(GraphvizOutput(tool='dot',
output_file='call_detail.png'),
config=config):
MainWindow.main()
except:
MainWindow.main()
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ It requires both Python35+ and PyQt5 and QtWebKit.

需要 Python35+ PyQt5 和 QtWebKit

## Installing (安装)
## Installing

install requirements

Expand Down Expand Up @@ -38,7 +38,9 @@ Replace QtWebKit to QtWebEngine

## Notice

If the first boot is slow 第一次运行很慢(因为在clone例子源码)
第一次运行很慢(因为在clone例子源码)

If the first boot is slow

1. git clone https://github.com/PyQt5/PyQt.git
2. move PyQt to PyQtClient\Resources\Data\Projects
Expand Down
7 changes: 3 additions & 4 deletions Test/BaseApplyStyle.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
Created on 2019年1月28日
@author: Irony
@site: https://pyqt5.com https://github.com/892768447
@site: https://pyqt.site https://github.com/PyQt5
@email: 892768447@qq.com
@file: Test.BaseApplyStyle
@description:
"""
from PyQt5.QtWidgets import QWidget, QVBoxLayout, QPlainTextEdit, QPushButton,\
QApplication

from PyQt5.QtWidgets import (QApplication, QPlainTextEdit, QPushButton,
QVBoxLayout, QWidget)

__Author__ = 'Irony'
__Copyright__ = 'Copyright (c) 2019'
Expand Down
24 changes: 7 additions & 17 deletions Test/CustomCursor.py
Original file line number Diff line number Diff line change
@@ -1,41 +1,31 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
Created on 2019年1月5日
@author: Irony
@site: https://pyqt5.com https://github.com/892768447
@site: https://pyqt.site https://github.com/PyQt5
@email: 892768447@qq.com
@file:
@description:
"""

import os

from PyQt5.QtWidgets import QWidget, QApplication
import win32api
import win32con
import win32gui

__Author__ = """By: Irony
QQ: 892768447
Email: 892768447@qq.com"""
__Copyright__ = "Copyright (c) 2019 Irony"
__Version__ = "Version 1.0"
from PyQt5.QtWidgets import QApplication, QWidget


class Window(QWidget):

def __init__(self, *args, **kwargs):
super(Window, self).__init__(*args, **kwargs)
c = win32gui.LoadImage(
None,
os.path.abspath('cursor.ani'),
win32con.IMAGE_CURSOR, 0, 0, win32con.LR_LOADFROMFILE
)
c = win32gui.LoadImage(None, os.path.abspath('cursor.ani'),
win32con.IMAGE_CURSOR, 0, 0,
win32con.LR_LOADFROMFILE)
print(c)
win32api.SetClassLong(
int(self.winId()),
win32con.GCL_HCURSOR, c)
win32api.SetClassLong(int(self.winId()), win32con.GCL_HCURSOR, c)


if __name__ == '__main__':
Expand Down
9 changes: 1 addition & 8 deletions Test/GenerateLanguage.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
Created on 2018年3月29日
@author: Irony
Expand All @@ -9,14 +8,8 @@
@file: GenerateLanguage
@description: 生成多语言文件
"""
import os


__Author__ = """By: Irony
QQ: 892768447
Email: 892768447@qq.com"""
__Copyright__ = "Copyright (c) 2018 Irony"
__Version__ = "Version 1.0"
import os

os.chdir('../')

Expand Down
15 changes: 4 additions & 11 deletions Test/RunCode.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,20 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
Created on 2019年1月9日
@author: Irony
@site: https://pyqt5.com https://github.com/892768447
@site: https://pyqt.site https://github.com/PyQt5
@email: 892768447@qq.com
@file: Utils.RunCode
@description: 过滤排序Model
"""

import os
import runpy
import sys
import traceback


__Author__ = """By: Irony
QQ: 892768447
Email: 892768447@qq.com"""
__Copyright__ = "Copyright (c) 2019 Irony"
__Version__ = "Version 1.0"


def escape(s):
s = s.replace("&", "&")
s = s.replace("<", "&lt;")
Expand All @@ -34,9 +27,9 @@ def escape(s):


def showError(message):
from PyQt5.QtWidgets import QApplication, QErrorMessage, QCheckBox, \
QPushButton, QLabel, QStyle
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import (QApplication, QCheckBox, QErrorMessage, QLabel,
QPushButton, QStyle)
QApplication.addLibraryPath('./Qt/plugins')
app = QApplication(sys.argv)
app.setQuitOnLastWindowClosed(True)
Expand Down
17 changes: 5 additions & 12 deletions Test/SlotsByName.py
Original file line number Diff line number Diff line change
@@ -1,34 +1,27 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
Created on 2019年1月5日
@author: Irony
@site: https://pyqt5.com https://github.com/892768447
@site: https://pyqt.site https://github.com/PyQt5
@email: 892768447@qq.com
@file: Test.tSlotsByName
@description:
"""

import sys

from PyQt5.QtCore import QMetaObject, pyqtSlot
from PyQt5.QtWidgets import QWidget, QApplication, QVBoxLayout

from PyQt5.QtWidgets import QApplication, QVBoxLayout, QWidget
from Widgets.Buttons.RotateButton import RotateButton


__Author__ = """By: Irony
QQ: 892768447
Email: 892768447@qq.com"""
__Copyright__ = "Copyright (c) 2019 Irony"
__Version__ = "Version 1.0"


class Ui_FormMainWindow(object):

def setupUi(self, FormMainWindow):
layout = QVBoxLayout(FormMainWindow)
layout.addWidget(RotateButton('test', FormMainWindow, objectName='buttonTest'))
layout.addWidget(
RotateButton('test', FormMainWindow, objectName='buttonTest'))
QMetaObject.connectSlotsByName(FormMainWindow)


Expand Down
16 changes: 2 additions & 14 deletions Test/TestColorThief.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,10 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from Utils.ColorThief import ColorThief


# Created on 2019年1月29日
# author: Irony
# site: https://github.com/892768447
# email: 892768447@qq.com
# file: Test.TestColorThief
# description:
__Author__ = """By: Irony
QQ: 892768447
Email: 892768447@qq.com"""
__Copyright__ = 'Copyright (c) 2019 Irony'
__Version__ = 1.0
from Utils.ColorThief import ColorThief

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

print(color)
print(color)
11 changes: 5 additions & 6 deletions Utils/TestColourfulWidget.py → Test/TestColourfulWidget.py
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
Created on 2019年1月20日
@author: Irony
@site: https://pyqt5.com https://github.com/892768447
@site: https://pyqt.site https://github.com/PyQt5
@email: 892768447@qq.com
@file: Utils.TestColourfulWidget
@description:
"""

from Utils.CommonUtil import Signals
from Widgets.Skins.ColourfulWidget import ColourfulWidget


__Author__ = "Irony"
__Copyright__ = "Copyright (c) 2019"

if __name__ == '__main__':
import sys
import os
os.chdir('../')

from PyQt5.QtWidgets import QApplication
app = QApplication(sys.argv)
app.setStyleSheet(
'ColourfulWidget{background:white;}\n#scrollArea,#scrollAreaWidgetContents{background:transparent;}')
'ColourfulWidget{background:white;}\n#scrollArea,#scrollAreaWidgetContents{background:transparent;}'
)
w = ColourfulWidget()
Signals.colourfulItemClicked.connect(
lambda name, colors: print(name, colors))
Expand Down
7 changes: 3 additions & 4 deletions Test/TestDownProgress.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
Created on 2019年1月17日
@author: Irony
@site: https://pyqt5.com https://github.com/892768447
@site: https://pyqt.site https://github.com/PyQt5
@email: 892768447@qq.com
@file: Test.TestDownProgress
@description:
Expand All @@ -17,7 +16,6 @@

import requests


if __name__ == '__main__':
url = 'https://raw.githubusercontent.com/PyQt5/PyQt/master/Demo/Data/dlib-19.4.0.win32-py3.5.exe'
with closing(requests.get(url, stream=True)) as response:
Expand All @@ -31,4 +29,5 @@
data_count = data_count + len(data)
now_jd = (data_count / content_size) * 100
print("\r 文件下载进度:%d%%(%d/%d) - %s" %
(now_jd, data_count, content_size, url), end=" ")
(now_jd, data_count, content_size, url),
end=" ")
Loading

0 comments on commit cd2a125

Please sign in to comment.