├── .gitignore ├── LICENSE ├── README.md ├── main.py ├── pane ├── QR_code_pane.py ├── caculator_btn.py ├── caculator_pane.py ├── login_pane.py ├── register_pane.py └── setup_pane.py ├── rc └── login_rc.py ├── requirements └── requirements.txt ├── resource ├── UI │ ├── QR_code.ui │ ├── caculator.ui │ ├── login.ui │ ├── register.ui │ └── setup.ui ├── Ui_QR_code.py ├── Ui_caculator.py ├── Ui_login.py ├── Ui_register.py ├── Ui_setup.py └── images │ ├── 1.jpeg │ ├── 2.PNG │ ├── QQ.png │ ├── QR_code.jpg │ ├── file.jpg │ ├── login.qrc │ ├── scan.png │ ├── 下拉.png │ ├── 二维码.png │ ├── 在线.png │ ├── 忙碌-im.png │ ├── 捕获.PNG │ ├── 添加好友.png │ ├── 版图.png │ ├── 登录图片.png │ ├── 计算器.png │ ├── 隐身-im.png │ └── 隐身.png └── tools └── Caculator.py /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | *.egg-info/ 24 | .installed.cfg 25 | *.egg 26 | MANIFEST 27 | 28 | # PyInstaller 29 | # Usually these files are written by a python script from a template 30 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 31 | *.manifest 32 | *.spec 33 | 34 | # Installer logs 35 | pip-log.txt 36 | pip-delete-this-directory.txt 37 | 38 | # Unit test / coverage reports 39 | htmlcov/ 40 | .tox/ 41 | .coverage 42 | .coverage.* 43 | .cache 44 | nosetests.xml 45 | coverage.xml 46 | *.cover 47 | .hypothesis/ 48 | .pytest_cache/ 49 | 50 | # Translations 51 | *.mo 52 | *.pot 53 | 54 | # Django stuff: 55 | *.log 56 | local_settings.py 57 | db.sqlite3 58 | 59 | # Flask stuff: 60 | instance/ 61 | .webassets-cache 62 | 63 | # Scrapy stuff: 64 | .scrapy 65 | 66 | # Sphinx documentation 67 | docs/_build/ 68 | 69 | # PyBuilder 70 | target/ 71 | 72 | # Jupyter Notebook 73 | .ipynb_checkpoints 74 | 75 | # pyenv 76 | .python-version 77 | 78 | # celery beat schedule file 79 | celerybeat-schedule 80 | 81 | # SageMath parsed files 82 | *.sage.py 83 | 84 | # Environments 85 | .env 86 | .venv 87 | env/ 88 | venv/ 89 | ENV/ 90 | env.bak/ 91 | venv.bak/ 92 | 93 | # Spyder project settings 94 | .spyderproject 95 | .spyproject 96 | 97 | # Rope project settings 98 | .ropeproject 99 | 100 | # mkdocs documentation 101 | /site 102 | 103 | # mypy 104 | .mypy_cache/ 105 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | - [功能](#功能) 2 | - [项目说明](#项目说明) 3 | - [输出](#输出) 4 | - [运行环境](#运行环境) 5 | - [使用说明](#使用说明) 6 | - [下载脚本](#1下载脚本) 7 | - [安装依赖](#2安装依赖) 8 | - [运行脚本](#5运行脚本) 9 | - [项目作业bug说明](#bug说明) 10 | 11 | ## 功能 12 | 13 | **功能**: 代码实现的效果为登录注册界面,登录成功还有计算器界面。可以当成pyqt5的一个小项目。 14 | 15 | ## 项目说明 16 | 17 | **说明信息**
18 | 19 | 使用pyqt5进行实验的设计,**为啥不使用tkinter来开发python图形界面呢?**,对于这个问题,首先tkinter是python自带的模块,但是其功能是真的少,而且设置界面非常复杂,几乎全在代码中度过。此时就可以使用第三方优秀模块**pyqt5**,而且pyqt5还有图形化设置界面,非常方便用户设计图形界面,而且还可以把ui文件转换python文件。
20 | 21 | 此项目仅仅只是pyqt5的一个小小实践Demo。项目中的登录时有效的,只设置了一个账号,所以这个账号为:**账号: 1234567890 密码: 123456789**。去尝试登录计算器吧,哈哈哈。 22 | 23 | ## 输出 24 | 25 | **登录界面信息**
26 | 27 | **1**. 登录第一窗口 28 | 29 | ![登录第一窗口](https://i.loli.net/2019/11/23/RTPEBgdp3sQkDyW.png) 30 | 31 | **2**. 密码输入情况 32 | 33 | ![密码输入情况](https://i.loli.net/2019/11/23/cnDmHCJsMzqXftx.png) 34 | 35 | **注册界面**
36 | 37 | ![注册界面](https://i.loli.net/2019/11/23/Y63pSuVaI7cdUJe.png) 38 | 39 | **代理设置界面**
40 | 41 | **1**. 代理设置第一界面 42 | 43 | ![代理设置界面](https://i.loli.net/2019/11/23/7Aj5XCStz2TGuaN.png) 44 | 45 | **2**. 当复选框有内容时界面 46 | 47 | ![](https://i.loli.net/2019/11/23/zITEg1lJxHmtMSp.png) 48 | 49 | **二维码界面**
50 | 51 | **1**. 初始化界面 52 | 53 | ![](https://i.loli.net/2019/11/23/pmYR8vBA9zXLKDa.png) 54 | 55 | **2**. 点击二维码状态 56 | 57 | ![](https://i.loli.net/2019/11/23/cDgpvE9qGOxuhRn.png) 58 | 59 | **计算器界面** 60 | 61 | **1**. 初始化界面 62 | 63 | ![](https://i.loli.net/2019/11/23/X37TvaI259wNDPQ.png) 64 | 65 | **2**. 计算器界面 66 | 67 | ![](https://i.loli.net/2019/11/23/ZWMy9dnSgKAoP1f.png) 68 | 69 | ## 运行环境 70 | 71 | - 开发语言:python3 72 | - 系统: Windows/Linux 73 | 74 | ## 使用说明 75 | 76 | ### 1.下载脚本 77 | 78 | ```bash 79 | $ git clone https://github.com/zengbolin/pyqt5_python-.git 80 | ``` 81 | 82 | 运行上述命令,将本项目下载到当前目录,如果下载成功当前目录会出现一个名为"pyqt5_python-"的文件夹; 83 | 84 | ### 2.安装依赖 85 | 86 | ```bash 87 | # 进入requirements文件夹,用cmd安装 88 | $ pip install -r requirements.txt 89 | ``` 90 | 91 | ### 3.运行脚本 92 | 93 | 大家可以根据自己的运行环境选择运行方式,Linux或widows可以通过 94 | 95 | ```bash 96 | $ python main.py 97 | ``` 98 | 99 | 运行; 100 | 101 | ## 项目作业bug说明 102 | 103 | **1**. 计算器输入0.的时候
104 | 105 | ![](https://i.loli.net/2019/11/23/qr2ZQ97dLlentvi.png) 106 | 107 | 108 | **2**. 计算超过两位小数的算式
109 | 110 | ![](https://i.loli.net/2019/11/23/WdYLZfKVP6SOric.png) 111 | -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | # encoding:utf-8 2 | import sys 3 | import time 4 | from PyQt5.QtCore import QPropertyAnimation, QEasingCurve, QAbstractAnimation, QPoint 5 | from PyQt5.QtWidgets import QApplication 6 | from pane.login_pane import Login 7 | from pane.register_pane import Register 8 | from pane.QR_code_pane import QR_code 9 | from pane.setup_pane import Setup 10 | from pane.caculator_pane import Caculator 11 | 12 | 13 | # 打开另外界面的实现动画效果 14 | def splash_open_init(pane): 15 | animation = QPropertyAnimation(pane) 16 | animation.setTargetObject(pane) 17 | animation.setPropertyName(b"pos") 18 | animation.setStartValue(pane.pos()) 19 | animation.setEndValue(QPoint(0, 0)) 20 | animation.setEasingCurve(QEasingCurve.OutBounce) 21 | animation.setDuration(500) 22 | animation.start(QAbstractAnimation.DeleteWhenStopped) 23 | 24 | 25 | # 退出当前界面的实现动画效果 26 | def splash_exit_init(pane, pane1): 27 | animation = QPropertyAnimation(pane) 28 | animation.setTargetObject(pane) 29 | animation.setPropertyName(b"pos") 30 | animation.setEndValue(QPoint(0, pane1.width())) 31 | animation.setStartValue(QPoint(0, 0)) 32 | animation.setEasingCurve(QEasingCurve.InBounce) 33 | animation.setDuration(500) 34 | animation.start(QAbstractAnimation.DeleteWhenStopped) 35 | 36 | 37 | # 显示二维码面板 38 | def show_qrcode_pane(): 39 | splash_open_init(qrcode_pane) 40 | 41 | 42 | # 显示注册面板 43 | def show_register_pane(): 44 | splash_open_init(register_pane) 45 | 46 | 47 | # 显示退出面板 48 | def exit_signal_func(): 49 | splash_exit_init(register_pane, login_pane) 50 | 51 | 52 | # 显示退出二维码面板 53 | def exit_qrcode_pane(): 54 | splash_exit_init(qrcode_pane, login_pane) 55 | 56 | 57 | # 检查登录是否成功,账号为:1234567890 密码为123456789 58 | def check_login(account, password): 59 | if account == "1234567890" and password == '123456789': 60 | time.sleep(1) 61 | # 登陆成功显示计算器界面,退出登录界面 62 | caculator_pane.show() 63 | login_pane.hide() 64 | else: 65 | # 显示错误动画效果 66 | login_pane.show_error_animation() 67 | 68 | 69 | # 显示设置面板 70 | def show_setup_pane(): 71 | splash_open_init(setup_pane) 72 | 73 | 74 | # 退出设置面板 75 | def exit_setup_pane(): 76 | splash_exit_init(setup_pane, login_pane) 77 | 78 | 79 | # 主函数入口,主要实现多个界面的联动 80 | # 作为一个中转站,可以防止耦合现象 81 | if __name__ == '__main__': 82 | app = QApplication(sys.argv) 83 | 84 | # 登录界面实现 85 | login_pane = Login() 86 | 87 | # 注册界面的实现 88 | register_pane = Register(login_pane) 89 | register_pane.move(0, login_pane.height()) 90 | register_pane.show() 91 | 92 | # 二维码界面实现 93 | qrcode_pane = QR_code(login_pane) 94 | qrcode_pane.move(0, login_pane.height()) 95 | qrcode_pane.show() 96 | 97 | # 代理设置界面实现 98 | setup_pane = Setup(login_pane) 99 | setup_pane.move(0, login_pane.height()) 100 | setup_pane.show() 101 | 102 | # 计算器界面实现 103 | caculator_pane = Caculator() 104 | 105 | # 登录界面各个按钮的槽函数连接 106 | login_pane.login_signal.connect(check_login) 107 | login_pane.show_register_pane_signal.connect(show_register_pane) 108 | login_pane.show_qrcode_signal.connect(show_qrcode_pane) 109 | login_pane.show_setup_pane_signal.connect(show_setup_pane) 110 | 111 | # 注册界面各个按钮的槽函数连接 112 | register_pane.exit_signal.connect(exit_signal_func) 113 | register_pane.show_qrcode_signal.connect(show_qrcode_pane) 114 | 115 | # 二维码界面各个按钮的槽函数连接 116 | qrcode_pane.exit_signal.connect(exit_qrcode_pane) 117 | 118 | # 代理设置界面各个按钮的槽函数连接 119 | setup_pane.exit_signal.connect(exit_setup_pane) 120 | 121 | login_pane.show() 122 | sys.exit(app.exec()) 123 | -------------------------------------------------------------------------------- /pane/QR_code_pane.py: -------------------------------------------------------------------------------- 1 | # encoding:utf-8 2 | import sys 3 | from PyQt5.QtCore import Qt, QSequentialAnimationGroup, QPropertyAnimation, QEasingCurve, QAbstractAnimation, pyqtSignal 4 | from PyQt5.QtWidgets import QApplication, QWidget 5 | from resource.Ui_QR_code import Ui_Form 6 | 7 | 8 | # 二维码界面实现类 9 | class QR_code(QWidget, Ui_Form): 10 | # 定义退出此界面的信号 11 | exit_signal = pyqtSignal() 12 | 13 | def __init__(self, parent=None, *args, **kwargs): 14 | super(QR_code, self).__init__(parent, *args, **kwargs) 15 | self.setupUi(self) 16 | 17 | self.animation_target = [self.pushButton_2] 18 | self.animation_target_pos = [target.pos() for target in self.animation_target] 19 | 20 | # 实现点击二维码的收缩动画 21 | def show_hide_menu(self, checked): 22 | animation_group = QSequentialAnimationGroup(self) 23 | for idx, target in enumerate(self.animation_target): 24 | animation = QPropertyAnimation() 25 | animation.setTargetObject(target) 26 | animation.setPropertyName(b"pos") 27 | animation.setEndValue(self.pushButton.pos()) 28 | animation.setStartValue(self.animation_target_pos[idx]) 29 | animation.setDuration(200) 30 | animation.setEasingCurve(QEasingCurve.InOutBounce) 31 | animation_group.addAnimation(animation) 32 | 33 | animation_group.setDirection(not checked) 34 | animation_group.start(QAbstractAnimation.DeleteWhenStopped) 35 | 36 | # 退出按钮实现 37 | def show_menu(self): 38 | # 绑定退出信号 39 | self.exit_signal.emit() 40 | 41 | 42 | if __name__ == '__main__': 43 | app = QApplication(sys.argv) 44 | qR = QR_code() 45 | qR.show() 46 | sys.exit(app.exec()) 47 | -------------------------------------------------------------------------------- /pane/caculator_btn.py: -------------------------------------------------------------------------------- 1 | # encoding:utf-8 2 | from PyQt5.QtCore import pyqtSignal 3 | from PyQt5.QtWidgets import QPushButton 4 | 5 | 6 | # 计算器按键类 7 | class Caculator_btn(QPushButton): 8 | # 定义一个按键按下去的信号 9 | key_pressed = pyqtSignal(str, str) 10 | 11 | def __init__(self, parent=None, *args, **kwargs): 12 | super(Caculator_btn, self).__init__(parent, *args, **kwargs) 13 | 14 | # 重写鼠标按下事件 15 | def mousePressEvent(self, *args, **kwargs): 16 | super(Caculator_btn, self).mousePressEvent(*args, **kwargs) 17 | self.key_pressed.emit(self.text(), self.property("role")) 18 | 19 | # 重写改变窗口大小的事件 20 | def resizeEvent(self, *args, **kwargs): 21 | # 设置按键的样式和颜色,以及部分事件的按键改变样式 22 | self.setStyleSheet(""" 23 | QPushButton[bg='gray']{ 24 | color : white; 25 | background-color :rgb(88, 88, 88); 26 | } 27 | QPushButton[bg='gray']:hover{ 28 | background-color:rgb(150, 150, 150); 29 | } 30 | QPushButton[bg='orange'],QPushButton[bg='equal']{ 31 | color : white; 32 | background-color :rgb(207, 138, 0); 33 | } 34 | QPushButton[bg='orange']:hover,QPushButton[bg='equal']:hover{ 35 | background-color :rgb(238, 159, 0); 36 | } 37 | QPushButton[bg='orange']:checked{ 38 | color : rgb(207, 138, 0); 39 | background-color :white; 40 | } 41 | QPushButton[bg='lightgray']{ 42 | color : black; 43 | background-color :rgb(200, 200, 200); 44 | } 45 | QPushButton[bg='lightgray']:hover{ 46 | background-color :rgb(230, 230, 230); 47 | } 48 | """ + """ 49 | QPushButton[bg]{ 50 | font-size:28px; 51 | border-radius:%dpx; 52 | min-width:50px; 53 | min-height:50px; 54 | } 55 | """ % (min(self.height(), self.width()) * 0.5)) 56 | -------------------------------------------------------------------------------- /pane/caculator_pane.py: -------------------------------------------------------------------------------- 1 | # encoding:utf-8 2 | import sys 3 | 4 | from PyQt5.QtCore import Qt 5 | from PyQt5.QtWidgets import QApplication, QMainWindow 6 | from resource.Ui_caculator import Ui_MainWindow 7 | 8 | from tools.Caculator import Caculators 9 | 10 | 11 | # 计算器面板类实现 12 | class Caculator(QMainWindow, Ui_MainWindow): 13 | 14 | def __init__(self, parent=None, *args, **kwargs): 15 | super(Caculator, self).__init__(parent, *args, **kwargs) 16 | # 显示头图,可有可无 17 | self.setAttribute(Qt.WA_StyledBackground, True) 18 | self.setupUi(self) 19 | # 定义显示文本的信号以及连接函数 20 | self.caculators = Caculators() 21 | self.caculators.show_content.connect(self.show_content) 22 | 23 | # 获取按键 24 | def get_key(self, title, role): 25 | self.caculators.parse_key_model({"title": title, "role": role}) 26 | 27 | # 显示内容到文本框 28 | def show_content(self, content): 29 | self.lineEdit.setText(content) 30 | 31 | 32 | if __name__ == '__main__': 33 | app = QApplication(sys.argv) 34 | caculator_pane = Caculator() 35 | caculator_pane.show() 36 | sys.exit(app.exec()) 37 | -------------------------------------------------------------------------------- /pane/login_pane.py: -------------------------------------------------------------------------------- 1 | # encoding:utf-8 2 | import sys 3 | 4 | from PyQt5.QtCore import Qt, pyqtSignal, QPropertyAnimation, QPoint, QAbstractAnimation, QUrl 5 | from PyQt5.QtGui import QDesktopServices 6 | from PyQt5.QtWidgets import QApplication, QWidget 7 | from resource.Ui_login import Ui_Form 8 | 9 | 10 | # 登录面板实现类,也是第一窗口 11 | class Login(QWidget, Ui_Form): 12 | # 定义点击登录信号、点击注册信号、点击二维码信号、点击设置信号 13 | login_signal = pyqtSignal(str, str) 14 | show_register_pane_signal = pyqtSignal() 15 | show_qrcode_signal = pyqtSignal() 16 | show_setup_pane_signal = pyqtSignal() 17 | 18 | def __init__(self, parent=None, *args, **kwargs): 19 | super(Login, self).__init__(parent, *args, **kwargs) 20 | # 显示背景图,因为pyqt5设置问题 21 | self.setAttribute(Qt.WA_StyledBackground, True) 22 | self.setupUi(self) 23 | 24 | # 是否登录 25 | def check_login(self): 26 | # 获取文本框内容 27 | account_text = self.name_line.currentText() 28 | password_text = self.password_line.text() 29 | # 检查文本框输入内容是否符合再去让按钮变亮 30 | if 6 <= len(account_text) <= 10 and len(password_text) > 8 and 100000 < int(account_text) < 100000000000: 31 | self.login_btn.setEnabled(True) 32 | else: 33 | self.login_btn.setEnabled(False) 34 | 35 | # 是否登录成功 36 | def checked_login(self): 37 | # 获取账号密码文本 38 | account_text = self.name_line.currentText() 39 | password_text = self.password_line.text() 40 | # 将内容返回给登录信号 41 | self.login_signal.emit(account_text, password_text) 42 | 43 | # 显示注册界面函数 44 | def show_register_pane(self): 45 | # print("121212") 46 | # 绑定显示注册界面信号 47 | self.show_register_pane_signal.emit() 48 | 49 | # 显示二维码界面 50 | def show_qrcode_pane(self): 51 | # 绑定显示二维码界面信号 52 | self.show_qrcode_signal.emit() 53 | 54 | # 实现记住密码复选框的点击 55 | def rember_pwd(self, checked): 56 | # print(checked) 57 | if not checked: 58 | self.antologin_checkbox.setChecked(False) 59 | 60 | # 实现自动登录的点击 61 | def auto_login(self, checked): 62 | # print(checked) 63 | if checked: 64 | self.rember_checkbox.setChecked(True) 65 | 66 | # 实现界面的动态效果,例如登录错误的窗口抖动动画 67 | def show_error_animation(self): 68 | animation = QPropertyAnimation(self) 69 | animation.setTargetObject(self.login_widget) 70 | animation.setPropertyName(b"pos") 71 | animation.setKeyValueAt(0, self.login_widget.pos()) 72 | animation.setKeyValueAt(0.2, self.login_widget.pos() - QPoint(15, 0)) 73 | animation.setKeyValueAt(0.5, self.login_widget.pos()) 74 | animation.setKeyValueAt(0.7, self.login_widget.pos() - QPoint(-15, 0)) 75 | animation.setKeyValueAt(1, self.login_widget.pos()) 76 | animation.setDuration(200) 77 | animation.setLoopCount(5) 78 | animation.start(QAbstractAnimation.DeleteWhenStopped) 79 | 80 | # 显示设置界面 81 | def show_setup_pane(self): 82 | # 绑定显示设置界面的信号 83 | self.show_setup_pane_signal.emit() 84 | 85 | # 将忘记密码的链接绑定到指定qq忘记密码界面 86 | def show_findpwd_link(self): 87 | link = "https://aq.qq.com/v2/uv_aq/html/reset_pwd/pc_reset_pwd_input_account.html" 88 | QDesktopServices.openUrl(QUrl(link)) 89 | 90 | 91 | if __name__ == '__main__': 92 | app = QApplication(sys.argv) 93 | login = Login() 94 | login.login_signal.connect(lambda a, p: print(a, p)) 95 | login.show() 96 | sys.exit(app.exec()) 97 | -------------------------------------------------------------------------------- /pane/register_pane.py: -------------------------------------------------------------------------------- 1 | # encoding:utf-8 2 | import sys 3 | 4 | from PyQt5.QtCore import Qt, pyqtSignal, QUrl 5 | from PyQt5.QtGui import QDesktopServices 6 | from PyQt5.QtWidgets import QApplication, QWidget 7 | from resource.Ui_register import Ui_Form 8 | 9 | 10 | # 注册界面实现类 11 | class Register(QWidget, Ui_Form): 12 | # 定义退出信号和显示二维码信号 13 | exit_signal = pyqtSignal() 14 | show_qrcode_signal = pyqtSignal() 15 | 16 | def __init__(self, parent=None, *args, **kwargs): 17 | super(Register, self).__init__(parent, *args, **kwargs) 18 | self.setAttribute(Qt.WA_StyledBackground, True) 19 | self.setupUi(self) 20 | 21 | # 退出按钮实现 22 | def exit_register_pane(self): 23 | # 绑定退出信号 24 | self.exit_signal.emit() 25 | 26 | # 点击注册QQ按钮,跳转qq注册界面 27 | def open_register_link(self): 28 | link = "http://zc.qq.com/" 29 | QDesktopServices.openUrl(QUrl(link)) 30 | 31 | # 二维码按钮实现 32 | def show_qrcode_pane(self): 33 | # 绑定二维码信号 34 | self.show_qrcode_signal.emit() 35 | 36 | 37 | if __name__ == '__main__': 38 | app = QApplication(sys.argv) 39 | register = Register() 40 | register.show() 41 | sys.exit(app.exec()) 42 | -------------------------------------------------------------------------------- /pane/setup_pane.py: -------------------------------------------------------------------------------- 1 | # encoding:utf-8 2 | import sys 3 | 4 | from PyQt5.QtCore import Qt, pyqtSignal 5 | from PyQt5.QtWidgets import QApplication, QWidget 6 | from resource.Ui_setup import Ui_Form 7 | 8 | # 代理设置实现类 9 | class Setup(QWidget, Ui_Form): 10 | # 退出信号 11 | exit_signal = pyqtSignal() 12 | 13 | def __init__(self, parent=None, *args, **kwargs): 14 | super(Setup, self).__init__(parent, *args, **kwargs) 15 | self.setAttribute(Qt.WA_StyledBackground, True) 16 | self.setupUi(self) 17 | # 显示第一界面 18 | def show_menu(self): 19 | # 绑定退出信号 20 | self.exit_signal.emit() 21 | # 实现逻辑,当第一个下拉框有内容时,才让其他文本框可以编辑 22 | def enable_test(self): 23 | if self.comboBox.currentIndex(): 24 | self.lineEdit.setEnabled(True) 25 | self.lineEdit_2.setEnabled(True) 26 | self.lineEdit_3.setEnabled(True) 27 | self.lineEdit_4.setEnabled(True) 28 | self.lineEdit_5.setEnabled(True) 29 | # 实现按钮逻辑 30 | if len(self.lineEdit.text()) > 0 and len(self.lineEdit_2.text()) > 0: 31 | self.pushButton.setEnabled(True) 32 | else: 33 | self.pushButton.setEnabled(False) 34 | else: 35 | self.lineEdit.setEnabled(False) 36 | self.lineEdit_2.setEnabled(False) 37 | self.lineEdit_3.setEnabled(False) 38 | self.lineEdit_4.setEnabled(False) 39 | self.lineEdit_5.setEnabled(False) 40 | # 同上 41 | def enable_pane(self): 42 | if self.comboBox_2.currentIndex(): 43 | self.comboBox_3.setEnabled(True) 44 | # self.comboBox_3.setCurrentIndex(1) 45 | self.lineEdit_6.setPlaceholderText("8080") 46 | self.lineEdit_6.setEnabled(True) 47 | else: 48 | self.comboBox_3.setEnabled(False) 49 | self.lineEdit_6.setEnabled(False) 50 | 51 | 52 | if __name__ == '__main__': 53 | app = QApplication(sys.argv) 54 | setup_pane = Setup() 55 | setup_pane.show() 56 | sys.exit(app.exec()) 57 | -------------------------------------------------------------------------------- /requirements/requirements.txt: -------------------------------------------------------------------------------- 1 | pyqt5 -------------------------------------------------------------------------------- /resource/UI/QR_code.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Form 4 | 5 | 6 | 7 | 0 8 | 0 9 | 520 10 | 350 11 | 12 | 13 | 14 | 15 | 520 16 | 350 17 | 18 | 19 | 20 | 21 | 520 22 | 350 23 | 24 | 25 | 26 | 扫描二维码 27 | 28 | 29 | 30 | :/login/QQ.png:/login/QQ.png 31 | 32 | 33 | 34 | 35 | 1 36 | 1 37 | 520 38 | 30 39 | 40 | 41 | 42 | 43 | 520 44 | 30 45 | 46 | 47 | 48 | 49 | 520 50 | 30 51 | 52 | 53 | 54 | image: url(:/login/版图.png); 55 | 56 | 57 | 58 | 59 | 60 | 1 61 | 31 62 | 520 63 | 319 64 | 65 | 66 | 67 | background-color: rgb(235, 242, 249); 68 | 69 | 70 | 71 | 72 | 140 73 | 60 74 | 221 75 | 31 76 | 77 | 78 | 79 | font: 11pt "黑体"; 80 | 81 | 82 | 83 | 用微信扫描二维码添加好友 84 | 85 | 86 | 87 | 88 | true 89 | 90 | 91 | 92 | 140 93 | 260 94 | 230 95 | 35 96 | 97 | 98 | 99 | 100 | 230 101 | 35 102 | 103 | 104 | 105 | 106 | 230 107 | 35 108 | 109 | 110 | 111 | QPushButton{ 112 | background-color:rgb(85, 170, 255); 113 | font: 10pt "微软雅黑"; 114 | color: rgb(255, 255, 255); 115 | border-radius:6px; 116 | } 117 | QPushButton:pressed{ 118 | background-color:rgb(0, 170, 255); 119 | } 120 | 121 | QPushButton:hover{ 122 | background-color:rgb(25, 225, 255); 123 | } 124 | 125 | 126 | 127 | 返回 128 | 129 | 130 | false 131 | 132 | 133 | 134 | 135 | true 136 | 137 | 138 | 139 | 110 140 | 120 141 | 121 142 | 121 143 | 144 | 145 | 146 | border-image: url(:/login/QR_code.jpg); 147 | 148 | 149 | 150 | 151 | 152 | true 153 | 154 | 155 | true 156 | 157 | 158 | 159 | 160 | false 161 | 162 | 163 | 164 | 270 165 | 120 166 | 121 167 | 121 168 | 169 | 170 | 171 | border-image: url(:/login/scan.png); 172 | 173 | 174 | 175 | 176 | 177 | false 178 | 179 | 180 | false 181 | 182 | 183 | label 184 | login_btn 185 | pushButton_2 186 | pushButton 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | pushButton 195 | clicked(bool) 196 | Form 197 | show_hide_menu() 198 | 199 | 200 | 222 201 | 221 202 | 203 | 204 | 170 205 | 370 206 | 207 | 208 | 209 | 210 | login_btn 211 | clicked() 212 | Form 213 | show_menu() 214 | 215 | 216 | 268 217 | 308 218 | 219 | 220 | -35 221 | 299 222 | 223 | 224 | 225 | 226 | 227 | show_hide_menu() 228 | show_menu() 229 | 230 | 231 | -------------------------------------------------------------------------------- /resource/UI/caculator.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | MainWindow 4 | 5 | 6 | 7 | 0 8 | 0 9 | 652 10 | 579 11 | 12 | 13 | 14 | 15 | 0 16 | 0 17 | 18 | 19 | 20 | 计算器 21 | 22 | 23 | 24 | :/login/计算器.png:/login/计算器.png 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 0 33 | 0 34 | 35 | 36 | 37 | 38 | 0 39 | 100 40 | 41 | 42 | 43 | 44 | 黑体 45 | 40 46 | 75 47 | false 48 | true 49 | false 50 | false 51 | false 52 | 53 | 54 | 55 | Qt::RightToLeft 56 | 57 | 58 | 59 | 60 | 61 | Qt::AlignBottom|Qt::AlignRight|Qt::AlignTrailing 62 | 63 | 64 | true 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 0 73 | 0 74 | 75 | 76 | 77 | 3 78 | 79 | 80 | true 81 | 82 | 83 | true 84 | 85 | 86 | gray 87 | 88 | 89 | num 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 0 98 | 0 99 | 100 | 101 | 102 | / 103 | 104 | 105 | true 106 | 107 | 108 | true 109 | 110 | 111 | orange 112 | 113 | 114 | opartor 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 0 123 | 0 124 | 125 | 126 | 127 | * 128 | 129 | 130 | true 131 | 132 | 133 | true 134 | 135 | 136 | orange 137 | 138 | 139 | opartor 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 0 148 | 0 149 | 150 | 151 | 152 | AC 153 | 154 | 155 | true 156 | 157 | 158 | true 159 | 160 | 161 | lightgray 162 | 163 | 164 | clear 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 0 173 | 0 174 | 175 | 176 | 177 | - 178 | 179 | 180 | true 181 | 182 | 183 | true 184 | 185 | 186 | orange 187 | 188 | 189 | opartor 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 0 198 | 0 199 | 200 | 201 | 202 | = 203 | 204 | 205 | true 206 | 207 | 208 | true 209 | 210 | 211 | equal 212 | 213 | 214 | caculater 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 0 223 | 0 224 | 225 | 226 | 227 | 9 228 | 229 | 230 | true 231 | 232 | 233 | true 234 | 235 | 236 | gray 237 | 238 | 239 | num 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 0 248 | 0 249 | 250 | 251 | 252 | 8 253 | 254 | 255 | true 256 | 257 | 258 | true 259 | 260 | 261 | gray 262 | 263 | 264 | num 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 0 273 | 0 274 | 275 | 276 | 277 | 5 278 | 279 | 280 | true 281 | 282 | 283 | true 284 | 285 | 286 | gray 287 | 288 | 289 | num 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 0 298 | 0 299 | 300 | 301 | 302 | 2 303 | 304 | 305 | true 306 | 307 | 308 | true 309 | 310 | 311 | gray 312 | 313 | 314 | num 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 0 323 | 0 324 | 325 | 326 | 327 | 6 328 | 329 | 330 | true 331 | 332 | 333 | true 334 | 335 | 336 | gray 337 | 338 | 339 | num 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 0 348 | 0 349 | 350 | 351 | 352 | 0 353 | 354 | 355 | true 356 | 357 | 358 | true 359 | 360 | 361 | gray 362 | 363 | 364 | num 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 0 373 | 0 374 | 375 | 376 | 377 | % 378 | 379 | 380 | true 381 | 382 | 383 | true 384 | 385 | 386 | lightgray 387 | 388 | 389 | num 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 0 398 | 0 399 | 400 | 401 | 402 | 1 403 | 404 | 405 | true 406 | 407 | 408 | true 409 | 410 | 411 | gray 412 | 413 | 414 | num 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 0 423 | 0 424 | 425 | 426 | 427 | 4 428 | 429 | 430 | true 431 | 432 | 433 | true 434 | 435 | 436 | gray 437 | 438 | 439 | num 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 0 448 | 0 449 | 450 | 451 | 452 | . 453 | 454 | 455 | true 456 | 457 | 458 | true 459 | 460 | 461 | gray 462 | 463 | 464 | num 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 0 473 | 0 474 | 475 | 476 | 477 | 7 478 | 479 | 480 | true 481 | 482 | 483 | true 484 | 485 | 486 | gray 487 | 488 | 489 | num 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 0 498 | 0 499 | 500 | 501 | 502 | +/- 503 | 504 | 505 | true 506 | 507 | 508 | true 509 | 510 | 511 | lightgray 512 | 513 | 514 | num 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 0 523 | 0 524 | 525 | 526 | 527 | + 528 | 529 | 530 | true 531 | 532 | 533 | true 534 | 535 | 536 | orange 537 | 538 | 539 | opartor 540 | 541 | 542 | 543 | 544 | 545 | 546 | 547 | 548 | 0 549 | 0 550 | 652 551 | 26 552 | 553 | 554 | 555 | 556 | 查看(V) 557 | 558 | 559 | 560 | 561 | 编辑(E) 562 | 563 | 564 | 565 | 566 | 帮助(H) 567 | 568 | 569 | 570 | 571 | 572 | 573 | 574 | 575 | 576 | 577 | Caculator_btn 578 | QPushButton 579 |
caculator_btn
580 | 581 | key_pressed() 582 | 583 |
584 |
585 | 586 | 587 | 588 | 589 | 590 | pushButton 591 | key_pressed() 592 | MainWindow 593 | get_key() 594 | 595 | 596 | 61 597 | 183 598 | 599 | 600 | -192 601 | 183 602 | 603 | 604 | 605 | 606 | pushButton_2 607 | key_pressed() 608 | MainWindow 609 | get_key() 610 | 611 | 612 | 213 613 | 178 614 | 615 | 616 | -227 617 | 102 618 | 619 | 620 | 621 | 622 | pushButton_3 623 | key_pressed() 624 | MainWindow 625 | get_key() 626 | 627 | 628 | 388 629 | 172 630 | 631 | 632 | -238 633 | -11 634 | 635 | 636 | 637 | 638 | pushButton_4 639 | key_pressed() 640 | MainWindow 641 | get_key() 642 | 643 | 644 | 570 645 | 171 646 | 647 | 648 | 856 649 | 181 650 | 651 | 652 | 653 | 654 | pushButton_6 655 | key_pressed() 656 | MainWindow 657 | get_key() 658 | 659 | 660 | 40 661 | 261 662 | 663 | 664 | -88 665 | 258 666 | 667 | 668 | 669 | 670 | pushButton_8 671 | key_pressed() 672 | MainWindow 673 | get_key() 674 | 675 | 676 | 213 677 | 264 678 | 679 | 680 | 6 681 | 222 682 | 683 | 684 | 685 | 686 | pushButton_7 687 | key_pressed() 688 | MainWindow 689 | get_key() 690 | 691 | 692 | 373 693 | 258 694 | 695 | 696 | 331 697 | -16 698 | 699 | 700 | 701 | 702 | pushButton_5 703 | key_pressed() 704 | MainWindow 705 | get_key() 706 | 707 | 708 | 613 709 | 240 710 | 711 | 712 | 844 713 | 240 714 | 715 | 716 | 717 | 718 | pushButton_9 719 | key_pressed() 720 | MainWindow 721 | get_key() 722 | 723 | 724 | 577 725 | 352 726 | 727 | 728 | 757 729 | 346 730 | 731 | 732 | 733 | 734 | pushButton_13 735 | key_pressed() 736 | MainWindow 737 | get_key() 738 | 739 | 740 | 553 741 | 418 742 | 743 | 744 | 786 745 | 418 746 | 747 | 748 | 749 | 750 | pushButton_17 751 | key_pressed() 752 | MainWindow 753 | get_key() 754 | 755 | 756 | 591 757 | 501 758 | 759 | 760 | 745 761 | 501 762 | 763 | 764 | 765 | 766 | pushButton_19 767 | key_pressed() 768 | MainWindow 769 | get_key() 770 | 771 | 772 | 418 773 | 521 774 | 775 | 776 | 406 777 | 655 778 | 779 | 780 | 781 | 782 | pushButton_20 783 | key_pressed() 784 | MainWindow 785 | get_key() 786 | 787 | 788 | 178 789 | 521 790 | 791 | 792 | 154 793 | 672 794 | 795 | 796 | 797 | 798 | pushButton_14 799 | key_pressed() 800 | MainWindow 801 | get_key() 802 | 803 | 804 | 50 805 | 424 806 | 807 | 808 | -89 809 | 404 810 | 811 | 812 | 813 | 814 | pushButton_16 815 | key_pressed() 816 | MainWindow 817 | get_key() 818 | 819 | 820 | 223 821 | 424 822 | 823 | 824 | -38 825 | 382 826 | 827 | 828 | 829 | 830 | pushButton_15 831 | key_pressed() 832 | MainWindow 833 | get_key() 834 | 835 | 836 | 375 837 | 434 838 | 839 | 840 | 66 841 | 676 842 | 843 | 844 | 845 | 846 | pushButton_11 847 | key_pressed() 848 | MainWindow 849 | get_key() 850 | 851 | 852 | 408 853 | 334 854 | 855 | 856 | 497 857 | 603 858 | 859 | 860 | 861 | 862 | pushButton_12 863 | key_pressed() 864 | MainWindow 865 | get_key() 866 | 867 | 868 | 249 869 | 349 870 | 871 | 872 | -160 873 | 300 874 | 875 | 876 | 877 | 878 | pushButton_10 879 | key_pressed() 880 | MainWindow 881 | get_key() 882 | 883 | 884 | 55 885 | 328 886 | 887 | 888 | -139 889 | 328 890 | 891 | 892 | 893 | 894 | 895 | get_key() 896 | 897 |
898 | -------------------------------------------------------------------------------- /resource/UI/login.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Form 4 | 5 | 6 | true 7 | 8 | 9 | 10 | 0 11 | 0 12 | 520 13 | 350 14 | 15 | 16 | 17 | 18 | 520 19 | 350 20 | 21 | 22 | 23 | 24 | 520 25 | 350 26 | 27 | 28 | 29 | Tim登录 30 | 31 | 32 | 33 | :/login/QQ.png:/login/QQ.png 34 | 35 | 36 | QWidget#Form{ 37 | 38 | 39 | border-image: url(:/login/登录图片.png); 40 | } 41 | 42 | 43 | 44 | 45 | 0 46 | 190 47 | 520 48 | 160 49 | 50 | 51 | 52 | 53 | 520 54 | 160 55 | 56 | 57 | 58 | 59 | 520 60 | 160 61 | 62 | 63 | 64 | 65 | 66 | 479 67 | 117 68 | 30 69 | 30 70 | 71 | 72 | 73 | 74 | 30 75 | 30 76 | 77 | 78 | 79 | 80 | 30 81 | 30 82 | 83 | 84 | 85 | background-color:transparent ; 86 | image: url(:/login/二维码.png); 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 390 96 | 50 97 | 93 98 | 28 99 | 100 | 101 | 102 | 103 | background-color:transparent ; 104 | color: rgb(0, 170, 255); 105 | 106 | 107 | 找回密码 108 | 109 | 110 | true 111 | 112 | 113 | 114 | 115 | false 116 | 117 | 118 | 119 | 159 120 | 107 121 | 230 122 | 35 123 | 124 | 125 | 126 | 127 | 230 128 | 35 129 | 130 | 131 | 132 | 133 | 230 134 | 35 135 | 136 | 137 | 138 | QPushButton{ 139 | background-color:rgb(85, 170, 255); 140 | font: 10pt "微软雅黑"; 141 | color: rgb(255, 255, 255); 142 | border-radius:6px; 143 | } 144 | QPushButton:pressed{ 145 | background-color:rgb(0, 170, 255); 146 | } 147 | QPushButton:disabled{ 148 | background-color:rgb(172, 172, 172); 149 | } 150 | QPushButton:hover{ 151 | background-color:rgb(25, 225, 255); 152 | } 153 | 154 | 155 | 156 | 登录 157 | 158 | 159 | false 160 | 161 | 162 | 163 | 164 | true 165 | 166 | 167 | 168 | 39 169 | 21 170 | 101 171 | 101 172 | 173 | 174 | 175 | border-radius:16px; 176 | border-image: url(:/login/1.jpeg); 177 | 178 | 179 | 180 | 181 | 80 182 | 80 183 | 20 184 | 20 185 | 186 | 187 | 188 | 189 | 20 190 | 20 191 | 192 | 193 | 194 | 195 | 20 196 | 20 197 | 198 | 199 | 200 | image: url(:/login/在线.png); 201 | image: url(:/login/在线.png); 202 | 203 | 204 | 205 | 206 | 207 | true 208 | 209 | 210 | false 211 | 212 | 213 | 214 | 215 | 216 | 217 | 303 218 | 82 219 | 87 220 | 19 221 | 222 | 223 | 224 | font: 9pt "微软雅黑"; 225 | color:rgb(191, 197, 203); 226 | 227 | 228 | 自动登录 229 | 230 | 231 | 232 | 233 | 234 | 9 235 | 117 236 | 30 237 | 30 238 | 239 | 240 | 241 | 242 | 30 243 | 30 244 | 245 | 246 | 247 | 248 | 30 249 | 30 250 | 251 | 252 | 253 | image: url(:/login/添加好友.png); 254 | background-color:transparent ; 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | true 264 | 265 | 266 | 267 | 160 268 | 82 269 | 87 270 | 19 271 | 272 | 273 | 274 | font: 9pt "微软雅黑"; 275 | color:rgb(191, 197, 203); 276 | 277 | 278 | 记住密码 279 | 280 | 281 | 282 | 283 | 284 | 390 285 | 22 286 | 93 287 | 28 288 | 289 | 290 | 291 | background-color:transparent ; 292 | color: rgb(0, 170, 255); 293 | QPushButton { 294 | color: rgb(0, 170, 255); 295 | } 296 | QPushButton:pressed{ 297 | font-color:rgb(0, 0, 0); 298 | color: rgb(0, 170, 255); 299 | } 300 | QPushButton:hover{ 301 | color: rgb(0, 170, 255); 302 | } 303 | 304 | 305 | 注册账号 306 | 307 | 308 | true 309 | 310 | 311 | 312 | 313 | 314 | 159 315 | 47 316 | 230 317 | 30 318 | 319 | 320 | 321 | 322 | 230 323 | 30 324 | 325 | 326 | 327 | 328 | 230 329 | 30 330 | 331 | 332 | 333 | QLineEdit{ 334 | font-size:16px; 335 | border:none; 336 | border-bottom:1px solid lightgray; 337 | background-color:transparent; 338 | font: 10pt "黑体"; 339 | } 340 | QLineEdit:hover{ 341 | border-bottom:1px solid gray; 342 | } 343 | QLineEdit:focus{ 344 | border-bottom:1px solid rgb(18,183,245); 345 | } 346 | 347 | 348 | 349 | 350 | 351 | 352 | QLineEdit::Password 353 | 354 | 355 | 请输入你的密码 356 | 357 | 358 | true 359 | 360 | 361 | 362 | 363 | 364 | 160 365 | 20 366 | 230 367 | 30 368 | 369 | 370 | 371 | 372 | 230 373 | 30 374 | 375 | 376 | 377 | 378 | 230 379 | 30 380 | 381 | 382 | 383 | QComboBox{ 384 | font-size:20px; 385 | border:none; 386 | border-bottom:1px solid lightgray; 387 | background-color:transparent; 388 | } 389 | QComboBox:hover{ 390 | border-bottom:1px solid gray; 391 | } 392 | QComboBox:focus{ 393 | border-bottom:1px solid rgb(18,183,245); 394 | } 395 | QComboBox::drop-down{ 396 | background-color:transparent; 397 | width:40px; 398 | height:30px; 399 | } 400 | QComboBox::down-arrow{ 401 | image: url(:/login/下拉.png); 402 | width:60px; 403 | height:20px; 404 | } 405 | QComboBox QAbstractItemView{ 406 | min-height:60px; 407 | } 408 | QComboBox QAbstractItemView:item{ 409 | color:lightblus; 410 | } 411 | 412 | 413 | true 414 | 415 | 416 | 417 | 1234567890 418 | 419 | 420 | 421 | :/login/QQ.png:/login/QQ.png 422 | 423 | 424 | 425 | 426 | 2345678901 427 | 428 | 429 | 430 | :/login/file.jpg:/login/file.jpg 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 0 439 | 0 440 | 31 441 | 31 442 | 443 | 444 | 445 | background-color:transparent ; 446 | border-image: url(:/login/下拉.png); 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | name_line 459 | editTextChanged(QString) 460 | Form 461 | check_login() 462 | 463 | 464 | 259 465 | 222 466 | 467 | 468 | 649 469 | 226 470 | 471 | 472 | 473 | 474 | password_line 475 | textChanged(QString) 476 | Form 477 | check_login() 478 | 479 | 480 | 302 481 | 246 482 | 483 | 484 | 608 485 | 255 486 | 487 | 488 | 489 | 490 | rember_checkbox 491 | clicked(bool) 492 | Form 493 | rember_pwd() 494 | 495 | 496 | 183 497 | 279 498 | 499 | 500 | 532 501 | 279 502 | 503 | 504 | 505 | 506 | antologin_checkbox 507 | clicked(bool) 508 | Form 509 | auto_login() 510 | 511 | 512 | 328 513 | 279 514 | 515 | 516 | 566 517 | 291 518 | 519 | 520 | 521 | 522 | login_btn 523 | clicked() 524 | Form 525 | checked_login() 526 | 527 | 528 | 275 529 | 312 530 | 531 | 532 | 584 533 | 312 534 | 535 | 536 | 537 | 538 | register_btn_2 539 | clicked() 540 | Form 541 | show_register_pane() 542 | 543 | 544 | 25 545 | 322 546 | 547 | 548 | -60 549 | 322 550 | 551 | 552 | 553 | 554 | pushButton_2 555 | clicked() 556 | Form 557 | show_qrcode_pane() 558 | 559 | 560 | 496 561 | 323 562 | 563 | 564 | 652 565 | 323 566 | 567 | 568 | 569 | 570 | pushButton 571 | clicked() 572 | Form 573 | show_setup_pane() 574 | 575 | 576 | 7 577 | 13 578 | 579 | 580 | -199 581 | 13 582 | 583 | 584 | 585 | 586 | register_btn 587 | clicked() 588 | Form 589 | show_register_pane() 590 | 591 | 592 | 449 593 | 228 594 | 595 | 596 | 538 597 | 180 598 | 599 | 600 | 601 | 602 | password_btn 603 | clicked() 604 | Form 605 | show_findpwd_link() 606 | 607 | 608 | 425 609 | 258 610 | 611 | 612 | 530 613 | 163 614 | 615 | 616 | 617 | 618 | 619 | show_hide_menu() 620 | online_menu() 621 | choke_menu() 622 | busy_menu() 623 | check_login() 624 | checked_login() 625 | show_register_pane() 626 | enable_login() 627 | show_qrcode_pane() 628 | rember_pwd() 629 | auto_login() 630 | show_setup_pane() 631 | show_findpwd_link() 632 | 633 | 634 | -------------------------------------------------------------------------------- /resource/UI/register.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Form 4 | 5 | 6 | 7 | 0 8 | 0 9 | 520 10 | 350 11 | 12 | 13 | 14 | 15 | 520 16 | 350 17 | 18 | 19 | 20 | 21 | 520 22 | 350 23 | 24 | 25 | 26 | 添加账号 27 | 28 | 29 | 30 | :/login/QQ.png:/login/QQ.png 31 | 32 | 33 | QWidget#Form{ 34 | 35 | 36 | border-image: url(:/login/登录图片.png); 37 | } 38 | 39 | 40 | 41 | 42 | 180 43 | 230 44 | 150 45 | 35 46 | 47 | 48 | 49 | 50 | 150 51 | 35 52 | 53 | 54 | 55 | 56 | 150 57 | 35 58 | 59 | 60 | 61 | background-color:rgb(244, 244, 244) ; 62 | font: 75 9pt "微软雅黑"; 63 | border-radius:6px; 64 | 65 | 66 | 67 | 68 | 注册QQ账号 69 | 70 | 71 | 72 | :/login/添加好友.png:/login/添加好友.png 73 | 74 | 75 | 76 | 77 | 78 | 10 79 | 310 80 | 30 81 | 30 82 | 83 | 84 | 85 | 86 | 30 87 | 30 88 | 89 | 90 | 91 | 92 | 30 93 | 30 94 | 95 | 96 | 97 | image: url(:/login/QQ.png); 98 | background-color:transparent ; 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 470 108 | 310 109 | 30 110 | 30 111 | 112 | 113 | 114 | 115 | 30 116 | 30 117 | 118 | 119 | 120 | 121 | 30 122 | 30 123 | 124 | 125 | 126 | background-color:transparent ; 127 | image: url(:/login/二维码.png); 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | true 136 | 137 | 138 | 139 | 140 140 | 290 141 | 230 142 | 35 143 | 144 | 145 | 146 | 147 | 230 148 | 35 149 | 150 | 151 | 152 | 153 | 230 154 | 35 155 | 156 | 157 | 158 | QPushButton{ 159 | background-color:rgb(85, 170, 255); 160 | font: 10pt "微软雅黑"; 161 | color: rgb(255, 255, 255); 162 | border-radius:6px; 163 | } 164 | QPushButton:pressed{ 165 | background-color:rgb(0, 170, 255); 166 | } 167 | 168 | QPushButton:hover{ 169 | background-color:rgb(25, 225, 255); 170 | } 171 | 172 | 173 | 174 | 登录 175 | 176 | 177 | false 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | pushButton_2 187 | clicked() 188 | Form 189 | exit_register_pane() 190 | 191 | 192 | 27 193 | 327 194 | 195 | 196 | -26 197 | 361 198 | 199 | 200 | 201 | 202 | pushButton 203 | clicked() 204 | Form 205 | open_register_link() 206 | 207 | 208 | 228 209 | 240 210 | 211 | 212 | 174 213 | 420 214 | 215 | 216 | 217 | 218 | login_btn_2 219 | clicked() 220 | Form 221 | exit_register_pane() 222 | 223 | 224 | 179 225 | 302 226 | 227 | 228 | -75 229 | 283 230 | 231 | 232 | 233 | 234 | pushButton_3 235 | clicked() 236 | Form 237 | show_qrcode_pane() 238 | 239 | 240 | 488 241 | 322 242 | 243 | 244 | 541 245 | 317 246 | 247 | 248 | 249 | 250 | 251 | exit_register_pane() 252 | open_register_link() 253 | show_qrcode_pane() 254 | 255 | 256 | -------------------------------------------------------------------------------- /resource/UI/setup.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Form 4 | 5 | 6 | 7 | 0 8 | 0 9 | 520 10 | 350 11 | 12 | 13 | 14 | 15 | 520 16 | 350 17 | 18 | 19 | 20 | 21 | 520 22 | 350 23 | 24 | 25 | 26 | 设置 27 | 28 | 29 | 30 | :/login/QQ.png:/login/QQ.png 31 | 32 | 33 | 34 | 35 | 1 36 | 1 37 | 520 38 | 30 39 | 40 | 41 | 42 | 43 | 520 44 | 30 45 | 46 | 47 | 48 | 49 | 520 50 | 30 51 | 52 | 53 | 54 | image: url(:/login/版图.png); 55 | 56 | 57 | 58 | 59 | 60 | 1 61 | 31 62 | 520 63 | 289 64 | 65 | 66 | 67 | background-color: rgb(235, 242, 249); 68 | font: 9pt "黑体"; 69 | 70 | 71 | 72 | 73 | 30 74 | 40 75 | 72 76 | 15 77 | 78 | 79 | 80 | font: 10pt "黑体"; 81 | 82 | 83 | 网络设置 84 | 85 | 86 | 87 | 88 | 89 | 40 90 | 80 91 | 72 92 | 15 93 | 94 | 95 | 96 | 类型: 97 | 98 | 99 | 100 | 101 | 102 | 30 103 | 120 104 | 72 105 | 15 106 | 107 | 108 | 109 | 用户名: 110 | 111 | 112 | 113 | 114 | 115 | 20 116 | 190 117 | 101 118 | 16 119 | 120 | 121 | 122 | font: 10pt "黑体"; 123 | 124 | 125 | 登录服务器 126 | 127 | 128 | 129 | 130 | 131 | 50 132 | 230 133 | 72 134 | 15 135 | 136 | 137 | 138 | 类型: 139 | 140 | 141 | 142 | 143 | 144 | 90 145 | 71 146 | 111 147 | 31 148 | 149 | 150 | 151 | font: 75 7pt "微软雅黑"; 152 | 153 | 154 | 155 | 不使用代理 156 | 157 | 158 | 159 | 160 | HTTP代理 161 | 162 | 163 | 164 | 165 | SOCKS5代理 166 | 167 | 168 | 169 | 170 | 使用浏览器设置 171 | 172 | 173 | 174 | 175 | 176 | 177 | 210 178 | 80 179 | 41 180 | 21 181 | 182 | 183 | 184 | 地址: 185 | 186 | 187 | 188 | 189 | false 190 | 191 | 192 | 193 | 250 194 | 70 195 | 121 196 | 31 197 | 198 | 199 | 200 | QLineEdit{ 201 | background-color:rgb(255, 255, 255); 202 | border-radius:6px; 203 | } 204 | 205 | QLineEdit:disabled{ 206 | background-color:rgb(245, 248, 252); 207 | } 208 | 209 | 210 | 211 | 212 | 213 | 380 214 | 80 215 | 72 216 | 15 217 | 218 | 219 | 220 | 端口: 221 | 222 | 223 | 224 | 225 | false 226 | 227 | 228 | 229 | 420 230 | 70 231 | 71 232 | 31 233 | 234 | 235 | 236 | QLineEdit{ 237 | background-color:rgb(255, 255, 255); 238 | border-radius:6px; 239 | } 240 | 241 | QLineEdit:disabled{ 242 | background-color:rgb(245, 248, 252); 243 | } 244 | 245 | 246 | 247 | 248 | false 249 | 250 | 251 | 252 | 90 253 | 110 254 | 113 255 | 31 256 | 257 | 258 | 259 | QLineEdit{ 260 | background-color:rgb(255, 255, 255); 261 | border-radius:6px; 262 | } 263 | 264 | QLineEdit:disabled{ 265 | background-color:rgb(245, 248, 252); 266 | } 267 | 268 | 269 | 270 | 271 | 272 | 210 273 | 120 274 | 41 275 | 20 276 | 277 | 278 | 279 | 密码: 280 | 281 | 282 | 283 | 284 | false 285 | 286 | 287 | 288 | 250 289 | 110 290 | 121 291 | 31 292 | 293 | 294 | 295 | QLineEdit{ 296 | background-color:rgb(255, 255, 255); 297 | border-radius:6px; 298 | } 299 | 300 | QLineEdit:disabled{ 301 | background-color:rgb(245, 248, 252); 302 | } 303 | 304 | 305 | 306 | 307 | 308 | 390 309 | 120 310 | 21 311 | 16 312 | 313 | 314 | 315 | 域: 316 | 317 | 318 | 319 | 320 | false 321 | 322 | 323 | 324 | 420 325 | 110 326 | 71 327 | 31 328 | 329 | 330 | 331 | QLineEdit{ 332 | background-color:rgb(255, 255, 255); 333 | border-radius:6px; 334 | } 335 | 336 | QLineEdit:disabled{ 337 | background-color:rgb(245, 248, 252); 338 | } 339 | 340 | 341 | 342 | 343 | false 344 | 345 | 346 | 347 | 420 348 | 150 349 | 71 350 | 28 351 | 352 | 353 | 354 | background-color: rgb(240, 245, 250); 355 | font: 9pt "黑体"; 356 | 357 | 358 | 测试 359 | 360 | 361 | 362 | 363 | 364 | 100 365 | 221 366 | 111 367 | 31 368 | 369 | 370 | 371 | font: 75 7pt "微软雅黑"; 372 | 373 | 374 | 375 | 不使用高级选项 376 | 377 | 378 | 379 | 380 | UDP类型 381 | 382 | 383 | 384 | 385 | TCp类型 386 | 387 | 388 | 389 | 390 | 391 | 392 | 220 393 | 230 394 | 72 395 | 15 396 | 397 | 398 | 399 | 地址: 400 | 401 | 402 | 403 | 404 | false 405 | 406 | 407 | 408 | 270 409 | 221 410 | 101 411 | 31 412 | 413 | 414 | 415 | QLineEdit{ 416 | background-color:rgb(85, 170, 255); 417 | color: rgb(255, 255, 255); 418 | border-radius:6px; 419 | } 420 | 421 | QLineEdit:disabled{ 422 | background-color:rgb(245, 248, 252); 423 | } 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 183.60.48.174 433 | 434 | 435 | 436 | 437 | sz.tencent.com 438 | 439 | 440 | 441 | 442 | sz2.tencent.com 443 | 444 | 445 | 446 | 447 | sz3.tencent.com 448 | 449 | 450 | 451 | 452 | sz4.tencent.com 453 | 454 | 455 | 456 | 457 | sz5.tencent.com 458 | 459 | 460 | 461 | 462 | 463 | 464 | 380 465 | 230 466 | 72 467 | 15 468 | 469 | 470 | 471 | 端口: 472 | 473 | 474 | 475 | 476 | false 477 | 478 | 479 | 480 | 420 481 | 220 482 | 71 483 | 31 484 | 485 | 486 | 487 | QLineEdit{ 488 | background-color:rgb(255, 255, 255); 489 | border-radius:6px; 490 | } 491 | 492 | QLineEdit:disabled{ 493 | background-color:rgb(245, 248, 252); 494 | } 495 | 496 | 497 | 498 | 499 | 500 | 501 | 1 502 | 320 503 | 520 504 | 30 505 | 506 | 507 | 508 | 509 | 520 510 | 30 511 | 512 | 513 | 514 | 515 | 520 516 | 30 517 | 518 | 519 | 520 | background-color: rgb(205, 226, 242); 521 | 522 | 523 | 524 | 525 | 302 526 | 0 527 | 201 528 | 28 529 | 530 | 531 | 532 | color: rgb(85, 85, 85); 533 | background-color: rgb(242, 242, 242); 534 | font: 9pt "黑体"; 535 | 536 | 537 | 538 | QDialogButtonBox::Cancel|QDialogButtonBox::Ok 539 | 540 | 541 | 542 | 543 | 544 | 545 | 546 | 547 | 548 | buttonBox 549 | rejected() 550 | Form 551 | show_menu() 552 | 553 | 554 | 466 555 | 333 556 | 557 | 558 | 879 559 | 333 560 | 561 | 562 | 563 | 564 | buttonBox 565 | accepted() 566 | Form 567 | show_menu() 568 | 569 | 570 | 343 571 | 329 572 | 573 | 574 | 551 575 | 340 576 | 577 | 578 | 579 | 580 | lineEdit 581 | textChanged(QString) 582 | Form 583 | enable_test() 584 | 585 | 586 | 307 587 | 113 588 | 589 | 590 | 651 591 | 113 592 | 593 | 594 | 595 | 596 | lineEdit_2 597 | textChanged(QString) 598 | Form 599 | enable_test() 600 | 601 | 602 | 447 603 | 118 604 | 605 | 606 | 532 607 | 125 608 | 609 | 610 | 611 | 612 | comboBox 613 | activated(QString) 614 | Form 615 | enable_test() 616 | 617 | 618 | 135 619 | 114 620 | 621 | 622 | 702 623 | 53 624 | 625 | 626 | 627 | 628 | comboBox_2 629 | activated(QString) 630 | Form 631 | enable_pane() 632 | 633 | 634 | 153 635 | 263 636 | 637 | 638 | 676 639 | 263 640 | 641 | 642 | 643 | 644 | comboBox_3 645 | activated(QString) 646 | Form 647 | enable_pane() 648 | 649 | 650 | 330 651 | 270 652 | 653 | 654 | 555 655 | 286 656 | 657 | 658 | 659 | 660 | lineEdit_6 661 | textChanged(QString) 662 | Form 663 | enable_pane() 664 | 665 | 666 | 437 667 | 263 668 | 669 | 670 | 543 671 | 273 672 | 673 | 674 | 675 | 676 | lineEdit_3 677 | textChanged(QString) 678 | Form 679 | enable_test() 680 | 681 | 682 | 102 683 | 156 684 | 685 | 686 | -20 687 | 156 688 | 689 | 690 | 691 | 692 | lineEdit_4 693 | textChanged(QString) 694 | Form 695 | enable_test() 696 | 697 | 698 | 289 699 | 154 700 | 701 | 702 | 532 703 | 216 704 | 705 | 706 | 707 | 708 | lineEdit_5 709 | textChanged(QString) 710 | Form 711 | enable_test() 712 | 713 | 714 | 450 715 | 157 716 | 717 | 718 | 570 719 | 158 720 | 721 | 722 | 723 | 724 | pushButton 725 | clicked() 726 | Form 727 | enable_test() 728 | 729 | 730 | 467 731 | 195 732 | 733 | 734 | 600 735 | 205 736 | 737 | 738 | 739 | 740 | 741 | show_menu() 742 | enable_test() 743 | enable_pane() 744 | 745 | 746 | -------------------------------------------------------------------------------- /resource/Ui_QR_code.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Form implementation generated from reading ui file 'I:\python_base_Code\PyQt5学习\PyQt_Demo\resource\UI\QR_code.ui' 4 | # 5 | # Created by: PyQt5 UI code generator 5.13.0 6 | # 7 | # WARNING! All changes made in this file will be lost! 8 | 9 | 10 | from PyQt5 import QtCore, QtGui, QtWidgets 11 | 12 | 13 | # 二维码界面实现 14 | class Ui_Form(object): 15 | def setupUi(self, Form): 16 | Form.setObjectName("Form") 17 | Form.resize(520, 350) 18 | Form.setMinimumSize(QtCore.QSize(520, 350)) 19 | Form.setMaximumSize(QtCore.QSize(520, 350)) 20 | icon = QtGui.QIcon() 21 | icon.addPixmap(QtGui.QPixmap(":/login/QQ.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) 22 | Form.setWindowIcon(icon) 23 | self.widget = QtWidgets.QWidget(Form) 24 | self.widget.setGeometry(QtCore.QRect(1, 1, 520, 30)) 25 | self.widget.setMinimumSize(QtCore.QSize(520, 30)) 26 | self.widget.setMaximumSize(QtCore.QSize(520, 30)) 27 | self.widget.setStyleSheet("image: url(:/login/版图.png);") 28 | self.widget.setObjectName("widget") 29 | self.widget_2 = QtWidgets.QWidget(Form) 30 | self.widget_2.setGeometry(QtCore.QRect(1, 31, 520, 319)) 31 | self.widget_2.setStyleSheet("background-color: rgb(235, 242, 249);") 32 | self.widget_2.setObjectName("widget_2") 33 | self.label = QtWidgets.QLabel(self.widget_2) 34 | self.label.setGeometry(QtCore.QRect(140, 60, 221, 31)) 35 | self.label.setStyleSheet("font: 11pt \"黑体\";\n" 36 | "") 37 | self.label.setObjectName("label") 38 | self.login_btn = QtWidgets.QPushButton(self.widget_2) 39 | self.login_btn.setEnabled(True) 40 | self.login_btn.setGeometry(QtCore.QRect(140, 260, 230, 35)) 41 | self.login_btn.setMinimumSize(QtCore.QSize(230, 35)) 42 | self.login_btn.setMaximumSize(QtCore.QSize(230, 35)) 43 | self.login_btn.setStyleSheet("QPushButton{\n" 44 | " background-color:rgb(85, 170, 255);\n" 45 | " font: 10pt \"微软雅黑\";\n" 46 | " color: rgb(255, 255, 255);\n" 47 | " border-radius:6px;\n" 48 | "}\n" 49 | "QPushButton:pressed{\n" 50 | " background-color:rgb(0, 170, 255);\n" 51 | "}\n" 52 | "\n" 53 | "QPushButton:hover{\n" 54 | " background-color:rgb(25, 225, 255);\n" 55 | "}\n" 56 | "") 57 | self.login_btn.setCheckable(False) 58 | self.login_btn.setObjectName("login_btn") 59 | self.pushButton = QtWidgets.QPushButton(self.widget_2) 60 | self.pushButton.setEnabled(True) 61 | self.pushButton.setGeometry(QtCore.QRect(110, 120, 121, 121)) 62 | self.pushButton.setStyleSheet("border-image: url(:/login/QR_code.jpg);") 63 | self.pushButton.setText("") 64 | self.pushButton.setCheckable(True) 65 | self.pushButton.setChecked(True) 66 | self.pushButton.setObjectName("pushButton") 67 | self.pushButton_2 = QtWidgets.QPushButton(self.widget_2) 68 | self.pushButton_2.setEnabled(False) 69 | self.pushButton_2.setGeometry(QtCore.QRect(270, 120, 121, 121)) 70 | self.pushButton_2.setStyleSheet("border-image: url(:/login/scan.png);") 71 | self.pushButton_2.setText("") 72 | self.pushButton_2.setCheckable(False) 73 | self.pushButton_2.setFlat(False) 74 | self.pushButton_2.setObjectName("pushButton_2") 75 | self.label.raise_() 76 | self.login_btn.raise_() 77 | self.pushButton_2.raise_() 78 | self.pushButton.raise_() 79 | 80 | self.retranslateUi(Form) 81 | self.pushButton.clicked['bool'].connect(Form.show_hide_menu) 82 | self.login_btn.clicked.connect(Form.show_menu) 83 | QtCore.QMetaObject.connectSlotsByName(Form) 84 | 85 | def retranslateUi(self, Form): 86 | _translate = QtCore.QCoreApplication.translate 87 | Form.setWindowTitle(_translate("Form", "扫描二维码")) 88 | self.label.setText(_translate("Form", "用微信扫描二维码添加好友")) 89 | self.login_btn.setText(_translate("Form", "返回")) 90 | 91 | 92 | import rc.login_rc 93 | 94 | if __name__ == "__main__": 95 | import sys 96 | 97 | app = QtWidgets.QApplication(sys.argv) 98 | Form = QtWidgets.QWidget() 99 | ui = Ui_Form() 100 | ui.setupUi(Form) 101 | Form.show() 102 | sys.exit(app.exec_()) 103 | -------------------------------------------------------------------------------- /resource/Ui_caculator.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Form implementation generated from reading ui file 'I:\python_base_Code\PyQt5学习\PyQt_Demo\resource\UI\caculator.ui' 4 | # 5 | # Created by: PyQt5 UI code generator 5.13.0 6 | # 7 | # WARNING! All changes made in this file will be lost! 8 | 9 | 10 | from PyQt5 import QtCore, QtGui, QtWidgets 11 | 12 | 13 | # 显示计算器界面 14 | class Ui_MainWindow(object): 15 | def setupUi(self, MainWindow): 16 | MainWindow.setObjectName("MainWindow") 17 | MainWindow.resize(652, 579) 18 | sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) 19 | sizePolicy.setHorizontalStretch(0) 20 | sizePolicy.setVerticalStretch(0) 21 | sizePolicy.setHeightForWidth(MainWindow.sizePolicy().hasHeightForWidth()) 22 | MainWindow.setSizePolicy(sizePolicy) 23 | icon = QtGui.QIcon() 24 | icon.addPixmap(QtGui.QPixmap(":/login/计算器.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) 25 | MainWindow.setWindowIcon(icon) 26 | self.centralwidget = QtWidgets.QWidget(MainWindow) 27 | self.centralwidget.setObjectName("centralwidget") 28 | self.gridLayout = QtWidgets.QGridLayout(self.centralwidget) 29 | self.gridLayout.setObjectName("gridLayout") 30 | self.lineEdit = QtWidgets.QLineEdit(self.centralwidget) 31 | sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) 32 | sizePolicy.setHorizontalStretch(0) 33 | sizePolicy.setVerticalStretch(0) 34 | sizePolicy.setHeightForWidth(self.lineEdit.sizePolicy().hasHeightForWidth()) 35 | self.lineEdit.setSizePolicy(sizePolicy) 36 | self.lineEdit.setMinimumSize(QtCore.QSize(0, 100)) 37 | font = QtGui.QFont() 38 | font.setFamily("黑体") 39 | font.setPointSize(40) 40 | font.setBold(True) 41 | font.setItalic(False) 42 | font.setUnderline(False) 43 | font.setWeight(75) 44 | font.setStrikeOut(False) 45 | font.setKerning(False) 46 | self.lineEdit.setFont(font) 47 | self.lineEdit.setLayoutDirection(QtCore.Qt.RightToLeft) 48 | self.lineEdit.setText("") 49 | self.lineEdit.setAlignment(QtCore.Qt.AlignBottom | QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing) 50 | self.lineEdit.setReadOnly(True) 51 | self.lineEdit.setObjectName("lineEdit") 52 | self.gridLayout.addWidget(self.lineEdit, 0, 0, 1, 4) 53 | self.pushButton_15 = Caculator_btn(self.centralwidget) 54 | sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) 55 | sizePolicy.setHorizontalStretch(0) 56 | sizePolicy.setVerticalStretch(0) 57 | sizePolicy.setHeightForWidth(self.pushButton_15.sizePolicy().hasHeightForWidth()) 58 | self.pushButton_15.setSizePolicy(sizePolicy) 59 | self.pushButton_15.setCheckable(True) 60 | self.pushButton_15.setAutoExclusive(True) 61 | self.pushButton_15.setObjectName("pushButton_15") 62 | self.gridLayout.addWidget(self.pushButton_15, 4, 2, 1, 1) 63 | self.pushButton_4 = Caculator_btn(self.centralwidget) 64 | sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) 65 | sizePolicy.setHorizontalStretch(0) 66 | sizePolicy.setVerticalStretch(0) 67 | sizePolicy.setHeightForWidth(self.pushButton_4.sizePolicy().hasHeightForWidth()) 68 | self.pushButton_4.setSizePolicy(sizePolicy) 69 | self.pushButton_4.setCheckable(True) 70 | self.pushButton_4.setAutoExclusive(True) 71 | self.pushButton_4.setObjectName("pushButton_4") 72 | self.gridLayout.addWidget(self.pushButton_4, 1, 3, 1, 1) 73 | self.pushButton_5 = Caculator_btn(self.centralwidget) 74 | sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) 75 | sizePolicy.setHorizontalStretch(0) 76 | sizePolicy.setVerticalStretch(0) 77 | sizePolicy.setHeightForWidth(self.pushButton_5.sizePolicy().hasHeightForWidth()) 78 | self.pushButton_5.setSizePolicy(sizePolicy) 79 | self.pushButton_5.setCheckable(True) 80 | self.pushButton_5.setAutoExclusive(True) 81 | self.pushButton_5.setObjectName("pushButton_5") 82 | self.gridLayout.addWidget(self.pushButton_5, 2, 3, 1, 1) 83 | self.pushButton = Caculator_btn(self.centralwidget) 84 | sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) 85 | sizePolicy.setHorizontalStretch(0) 86 | sizePolicy.setVerticalStretch(0) 87 | sizePolicy.setHeightForWidth(self.pushButton.sizePolicy().hasHeightForWidth()) 88 | self.pushButton.setSizePolicy(sizePolicy) 89 | self.pushButton.setCheckable(True) 90 | self.pushButton.setAutoExclusive(True) 91 | self.pushButton.setObjectName("pushButton") 92 | self.gridLayout.addWidget(self.pushButton, 1, 0, 1, 1) 93 | self.pushButton_9 = Caculator_btn(self.centralwidget) 94 | sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) 95 | sizePolicy.setHorizontalStretch(0) 96 | sizePolicy.setVerticalStretch(0) 97 | sizePolicy.setHeightForWidth(self.pushButton_9.sizePolicy().hasHeightForWidth()) 98 | self.pushButton_9.setSizePolicy(sizePolicy) 99 | self.pushButton_9.setCheckable(True) 100 | self.pushButton_9.setAutoExclusive(True) 101 | self.pushButton_9.setObjectName("pushButton_9") 102 | self.gridLayout.addWidget(self.pushButton_9, 3, 3, 1, 1) 103 | self.pushButton_17 = Caculator_btn(self.centralwidget) 104 | sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) 105 | sizePolicy.setHorizontalStretch(0) 106 | sizePolicy.setVerticalStretch(0) 107 | sizePolicy.setHeightForWidth(self.pushButton_17.sizePolicy().hasHeightForWidth()) 108 | self.pushButton_17.setSizePolicy(sizePolicy) 109 | self.pushButton_17.setCheckable(True) 110 | self.pushButton_17.setAutoExclusive(True) 111 | self.pushButton_17.setObjectName("pushButton_17") 112 | self.gridLayout.addWidget(self.pushButton_17, 5, 3, 1, 1) 113 | self.pushButton_7 = Caculator_btn(self.centralwidget) 114 | sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) 115 | sizePolicy.setHorizontalStretch(0) 116 | sizePolicy.setVerticalStretch(0) 117 | sizePolicy.setHeightForWidth(self.pushButton_7.sizePolicy().hasHeightForWidth()) 118 | self.pushButton_7.setSizePolicy(sizePolicy) 119 | self.pushButton_7.setCheckable(True) 120 | self.pushButton_7.setAutoExclusive(True) 121 | self.pushButton_7.setObjectName("pushButton_7") 122 | self.gridLayout.addWidget(self.pushButton_7, 2, 2, 1, 1) 123 | self.pushButton_8 = Caculator_btn(self.centralwidget) 124 | sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) 125 | sizePolicy.setHorizontalStretch(0) 126 | sizePolicy.setVerticalStretch(0) 127 | sizePolicy.setHeightForWidth(self.pushButton_8.sizePolicy().hasHeightForWidth()) 128 | self.pushButton_8.setSizePolicy(sizePolicy) 129 | self.pushButton_8.setCheckable(True) 130 | self.pushButton_8.setAutoExclusive(True) 131 | self.pushButton_8.setObjectName("pushButton_8") 132 | self.gridLayout.addWidget(self.pushButton_8, 2, 1, 1, 1) 133 | self.pushButton_12 = Caculator_btn(self.centralwidget) 134 | sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) 135 | sizePolicy.setHorizontalStretch(0) 136 | sizePolicy.setVerticalStretch(0) 137 | sizePolicy.setHeightForWidth(self.pushButton_12.sizePolicy().hasHeightForWidth()) 138 | self.pushButton_12.setSizePolicy(sizePolicy) 139 | self.pushButton_12.setCheckable(True) 140 | self.pushButton_12.setAutoExclusive(True) 141 | self.pushButton_12.setObjectName("pushButton_12") 142 | self.gridLayout.addWidget(self.pushButton_12, 3, 1, 1, 1) 143 | self.pushButton_16 = Caculator_btn(self.centralwidget) 144 | sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) 145 | sizePolicy.setHorizontalStretch(0) 146 | sizePolicy.setVerticalStretch(0) 147 | sizePolicy.setHeightForWidth(self.pushButton_16.sizePolicy().hasHeightForWidth()) 148 | self.pushButton_16.setSizePolicy(sizePolicy) 149 | self.pushButton_16.setCheckable(True) 150 | self.pushButton_16.setAutoExclusive(True) 151 | self.pushButton_16.setObjectName("pushButton_16") 152 | self.gridLayout.addWidget(self.pushButton_16, 4, 1, 1, 1) 153 | self.pushButton_11 = Caculator_btn(self.centralwidget) 154 | sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) 155 | sizePolicy.setHorizontalStretch(0) 156 | sizePolicy.setVerticalStretch(0) 157 | sizePolicy.setHeightForWidth(self.pushButton_11.sizePolicy().hasHeightForWidth()) 158 | self.pushButton_11.setSizePolicy(sizePolicy) 159 | self.pushButton_11.setCheckable(True) 160 | self.pushButton_11.setAutoExclusive(True) 161 | self.pushButton_11.setObjectName("pushButton_11") 162 | self.gridLayout.addWidget(self.pushButton_11, 3, 2, 1, 1) 163 | self.pushButton_20 = Caculator_btn(self.centralwidget) 164 | sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) 165 | sizePolicy.setHorizontalStretch(0) 166 | sizePolicy.setVerticalStretch(0) 167 | sizePolicy.setHeightForWidth(self.pushButton_20.sizePolicy().hasHeightForWidth()) 168 | self.pushButton_20.setSizePolicy(sizePolicy) 169 | self.pushButton_20.setCheckable(True) 170 | self.pushButton_20.setAutoExclusive(True) 171 | self.pushButton_20.setObjectName("pushButton_20") 172 | self.gridLayout.addWidget(self.pushButton_20, 5, 0, 1, 2) 173 | self.pushButton_3 = Caculator_btn(self.centralwidget) 174 | sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) 175 | sizePolicy.setHorizontalStretch(0) 176 | sizePolicy.setVerticalStretch(0) 177 | sizePolicy.setHeightForWidth(self.pushButton_3.sizePolicy().hasHeightForWidth()) 178 | self.pushButton_3.setSizePolicy(sizePolicy) 179 | self.pushButton_3.setCheckable(True) 180 | self.pushButton_3.setAutoExclusive(True) 181 | self.pushButton_3.setObjectName("pushButton_3") 182 | self.gridLayout.addWidget(self.pushButton_3, 1, 2, 1, 1) 183 | self.pushButton_14 = Caculator_btn(self.centralwidget) 184 | sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) 185 | sizePolicy.setHorizontalStretch(0) 186 | sizePolicy.setVerticalStretch(0) 187 | sizePolicy.setHeightForWidth(self.pushButton_14.sizePolicy().hasHeightForWidth()) 188 | self.pushButton_14.setSizePolicy(sizePolicy) 189 | self.pushButton_14.setCheckable(True) 190 | self.pushButton_14.setAutoExclusive(True) 191 | self.pushButton_14.setObjectName("pushButton_14") 192 | self.gridLayout.addWidget(self.pushButton_14, 4, 0, 1, 1) 193 | self.pushButton_10 = Caculator_btn(self.centralwidget) 194 | sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) 195 | sizePolicy.setHorizontalStretch(0) 196 | sizePolicy.setVerticalStretch(0) 197 | sizePolicy.setHeightForWidth(self.pushButton_10.sizePolicy().hasHeightForWidth()) 198 | self.pushButton_10.setSizePolicy(sizePolicy) 199 | self.pushButton_10.setCheckable(True) 200 | self.pushButton_10.setAutoExclusive(True) 201 | self.pushButton_10.setObjectName("pushButton_10") 202 | self.gridLayout.addWidget(self.pushButton_10, 3, 0, 1, 1) 203 | self.pushButton_19 = Caculator_btn(self.centralwidget) 204 | sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) 205 | sizePolicy.setHorizontalStretch(0) 206 | sizePolicy.setVerticalStretch(0) 207 | sizePolicy.setHeightForWidth(self.pushButton_19.sizePolicy().hasHeightForWidth()) 208 | self.pushButton_19.setSizePolicy(sizePolicy) 209 | self.pushButton_19.setCheckable(True) 210 | self.pushButton_19.setAutoExclusive(True) 211 | self.pushButton_19.setObjectName("pushButton_19") 212 | self.gridLayout.addWidget(self.pushButton_19, 5, 2, 1, 1) 213 | self.pushButton_6 = Caculator_btn(self.centralwidget) 214 | sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) 215 | sizePolicy.setHorizontalStretch(0) 216 | sizePolicy.setVerticalStretch(0) 217 | sizePolicy.setHeightForWidth(self.pushButton_6.sizePolicy().hasHeightForWidth()) 218 | self.pushButton_6.setSizePolicy(sizePolicy) 219 | self.pushButton_6.setCheckable(True) 220 | self.pushButton_6.setAutoExclusive(True) 221 | self.pushButton_6.setObjectName("pushButton_6") 222 | self.gridLayout.addWidget(self.pushButton_6, 2, 0, 1, 1) 223 | self.pushButton_2 = Caculator_btn(self.centralwidget) 224 | sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) 225 | sizePolicy.setHorizontalStretch(0) 226 | sizePolicy.setVerticalStretch(0) 227 | sizePolicy.setHeightForWidth(self.pushButton_2.sizePolicy().hasHeightForWidth()) 228 | self.pushButton_2.setSizePolicy(sizePolicy) 229 | self.pushButton_2.setCheckable(True) 230 | self.pushButton_2.setAutoExclusive(True) 231 | self.pushButton_2.setObjectName("pushButton_2") 232 | self.gridLayout.addWidget(self.pushButton_2, 1, 1, 1, 1) 233 | self.pushButton_13 = Caculator_btn(self.centralwidget) 234 | sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) 235 | sizePolicy.setHorizontalStretch(0) 236 | sizePolicy.setVerticalStretch(0) 237 | sizePolicy.setHeightForWidth(self.pushButton_13.sizePolicy().hasHeightForWidth()) 238 | self.pushButton_13.setSizePolicy(sizePolicy) 239 | self.pushButton_13.setCheckable(True) 240 | self.pushButton_13.setAutoExclusive(True) 241 | self.pushButton_13.setObjectName("pushButton_13") 242 | self.gridLayout.addWidget(self.pushButton_13, 4, 3, 1, 1) 243 | MainWindow.setCentralWidget(self.centralwidget) 244 | self.menubar = QtWidgets.QMenuBar(MainWindow) 245 | self.menubar.setGeometry(QtCore.QRect(0, 0, 652, 26)) 246 | self.menubar.setObjectName("menubar") 247 | self.menu = QtWidgets.QMenu(self.menubar) 248 | self.menu.setObjectName("menu") 249 | self.menu_2 = QtWidgets.QMenu(self.menubar) 250 | self.menu_2.setObjectName("menu_2") 251 | self.menu_3 = QtWidgets.QMenu(self.menubar) 252 | self.menu_3.setObjectName("menu_3") 253 | MainWindow.setMenuBar(self.menubar) 254 | self.statusbar = QtWidgets.QStatusBar(MainWindow) 255 | self.statusbar.setObjectName("statusbar") 256 | MainWindow.setStatusBar(self.statusbar) 257 | self.menubar.addAction(self.menu.menuAction()) 258 | self.menubar.addAction(self.menu_2.menuAction()) 259 | self.menubar.addAction(self.menu_3.menuAction()) 260 | 261 | self.retranslateUi(MainWindow) 262 | self.pushButton.key_pressed.connect(MainWindow.get_key) 263 | self.pushButton_2.key_pressed.connect(MainWindow.get_key) 264 | self.pushButton_3.key_pressed.connect(MainWindow.get_key) 265 | self.pushButton_4.key_pressed.connect(MainWindow.get_key) 266 | self.pushButton_6.key_pressed.connect(MainWindow.get_key) 267 | self.pushButton_8.key_pressed.connect(MainWindow.get_key) 268 | self.pushButton_7.key_pressed.connect(MainWindow.get_key) 269 | self.pushButton_5.key_pressed.connect(MainWindow.get_key) 270 | self.pushButton_9.key_pressed.connect(MainWindow.get_key) 271 | self.pushButton_13.key_pressed.connect(MainWindow.get_key) 272 | self.pushButton_17.key_pressed.connect(MainWindow.get_key) 273 | self.pushButton_19.key_pressed.connect(MainWindow.get_key) 274 | self.pushButton_20.key_pressed.connect(MainWindow.get_key) 275 | self.pushButton_14.key_pressed.connect(MainWindow.get_key) 276 | self.pushButton_16.key_pressed.connect(MainWindow.get_key) 277 | self.pushButton_15.key_pressed.connect(MainWindow.get_key) 278 | self.pushButton_11.key_pressed.connect(MainWindow.get_key) 279 | self.pushButton_12.key_pressed.connect(MainWindow.get_key) 280 | self.pushButton_10.key_pressed.connect(MainWindow.get_key) 281 | QtCore.QMetaObject.connectSlotsByName(MainWindow) 282 | 283 | def retranslateUi(self, MainWindow): 284 | _translate = QtCore.QCoreApplication.translate 285 | MainWindow.setWindowTitle(_translate("MainWindow", "计算器")) 286 | self.pushButton_15.setText(_translate("MainWindow", "3")) 287 | self.pushButton_15.setProperty("bg", _translate("MainWindow", "gray")) 288 | self.pushButton_15.setProperty("role", _translate("MainWindow", "num")) 289 | self.pushButton_4.setText(_translate("MainWindow", "/")) 290 | self.pushButton_4.setProperty("bg", _translate("MainWindow", "orange")) 291 | self.pushButton_4.setProperty("role", _translate("MainWindow", "opartor")) 292 | self.pushButton_5.setText(_translate("MainWindow", "*")) 293 | self.pushButton_5.setProperty("bg", _translate("MainWindow", "orange")) 294 | self.pushButton_5.setProperty("role", _translate("MainWindow", "opartor")) 295 | self.pushButton.setText(_translate("MainWindow", "AC")) 296 | self.pushButton.setProperty("bg", _translate("MainWindow", "lightgray")) 297 | self.pushButton.setProperty("role", _translate("MainWindow", "clear")) 298 | self.pushButton_9.setText(_translate("MainWindow", "-")) 299 | self.pushButton_9.setProperty("bg", _translate("MainWindow", "orange")) 300 | self.pushButton_9.setProperty("role", _translate("MainWindow", "opartor")) 301 | self.pushButton_17.setText(_translate("MainWindow", "=")) 302 | self.pushButton_17.setProperty("bg", _translate("MainWindow", "equal")) 303 | self.pushButton_17.setProperty("role", _translate("MainWindow", "caculater")) 304 | self.pushButton_7.setText(_translate("MainWindow", "9")) 305 | self.pushButton_7.setProperty("bg", _translate("MainWindow", "gray")) 306 | self.pushButton_7.setProperty("role", _translate("MainWindow", "num")) 307 | self.pushButton_8.setText(_translate("MainWindow", "8")) 308 | self.pushButton_8.setProperty("bg", _translate("MainWindow", "gray")) 309 | self.pushButton_8.setProperty("role", _translate("MainWindow", "num")) 310 | self.pushButton_12.setText(_translate("MainWindow", "5")) 311 | self.pushButton_12.setProperty("bg", _translate("MainWindow", "gray")) 312 | self.pushButton_12.setProperty("role", _translate("MainWindow", "num")) 313 | self.pushButton_16.setText(_translate("MainWindow", "2")) 314 | self.pushButton_16.setProperty("bg", _translate("MainWindow", "gray")) 315 | self.pushButton_16.setProperty("role", _translate("MainWindow", "num")) 316 | self.pushButton_11.setText(_translate("MainWindow", "6")) 317 | self.pushButton_11.setProperty("bg", _translate("MainWindow", "gray")) 318 | self.pushButton_11.setProperty("role", _translate("MainWindow", "num")) 319 | self.pushButton_20.setText(_translate("MainWindow", "0")) 320 | self.pushButton_20.setProperty("bg", _translate("MainWindow", "gray")) 321 | self.pushButton_20.setProperty("role", _translate("MainWindow", "num")) 322 | self.pushButton_3.setText(_translate("MainWindow", "%")) 323 | self.pushButton_3.setProperty("bg", _translate("MainWindow", "lightgray")) 324 | self.pushButton_3.setProperty("role", _translate("MainWindow", "num")) 325 | self.pushButton_14.setText(_translate("MainWindow", "1")) 326 | self.pushButton_14.setProperty("bg", _translate("MainWindow", "gray")) 327 | self.pushButton_14.setProperty("role", _translate("MainWindow", "num")) 328 | self.pushButton_10.setText(_translate("MainWindow", "4")) 329 | self.pushButton_10.setProperty("bg", _translate("MainWindow", "gray")) 330 | self.pushButton_10.setProperty("role", _translate("MainWindow", "num")) 331 | self.pushButton_19.setText(_translate("MainWindow", ".")) 332 | self.pushButton_19.setProperty("bg", _translate("MainWindow", "gray")) 333 | self.pushButton_19.setProperty("role", _translate("MainWindow", "num")) 334 | self.pushButton_6.setText(_translate("MainWindow", "7")) 335 | self.pushButton_6.setProperty("bg", _translate("MainWindow", "gray")) 336 | self.pushButton_6.setProperty("role", _translate("MainWindow", "num")) 337 | self.pushButton_2.setText(_translate("MainWindow", "+/-")) 338 | self.pushButton_2.setProperty("bg", _translate("MainWindow", "lightgray")) 339 | self.pushButton_2.setProperty("role", _translate("MainWindow", "num")) 340 | self.pushButton_13.setText(_translate("MainWindow", "+")) 341 | self.pushButton_13.setProperty("bg", _translate("MainWindow", "orange")) 342 | self.pushButton_13.setProperty("role", _translate("MainWindow", "opartor")) 343 | self.menu.setTitle(_translate("MainWindow", "查看(V)")) 344 | self.menu_2.setTitle(_translate("MainWindow", "编辑(E)")) 345 | self.menu_3.setTitle(_translate("MainWindow", "帮助(H)")) 346 | 347 | 348 | from pane.caculator_btn import Caculator_btn 349 | import rc.login_rc 350 | 351 | if __name__ == "__main__": 352 | import sys 353 | 354 | app = QtWidgets.QApplication(sys.argv) 355 | MainWindow = QtWidgets.QMainWindow() 356 | ui = Ui_MainWindow() 357 | ui.setupUi(MainWindow) 358 | MainWindow.show() 359 | sys.exit(app.exec_()) 360 | -------------------------------------------------------------------------------- /resource/Ui_login.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Form implementation generated from reading ui file 'I:\python_base_Code\PyQt5学习\PyQt_Demo\resource\UI\login.ui' 4 | # 5 | # Created by: PyQt5 UI code generator 5.13.0 6 | # 7 | # WARNING! All changes made in this file will be lost! 8 | 9 | 10 | from PyQt5 import QtCore, QtGui, QtWidgets 11 | 12 | 13 | # 登录界面实现 14 | class Ui_Form(object): 15 | def setupUi(self, Form): 16 | Form.setObjectName("Form") 17 | Form.setEnabled(True) 18 | Form.resize(520, 350) 19 | Form.setMinimumSize(QtCore.QSize(520, 350)) 20 | Form.setMaximumSize(QtCore.QSize(520, 350)) 21 | icon = QtGui.QIcon() 22 | icon.addPixmap(QtGui.QPixmap(":/login/QQ.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) 23 | Form.setWindowIcon(icon) 24 | Form.setStyleSheet("QWidget#Form{\n" 25 | " \n" 26 | " \n" 27 | " border-image: url(:/login/登录图片.png);\n" 28 | "}") 29 | self.login_widget = QtWidgets.QWidget(Form) 30 | self.login_widget.setGeometry(QtCore.QRect(0, 190, 520, 160)) 31 | self.login_widget.setMinimumSize(QtCore.QSize(520, 160)) 32 | self.login_widget.setMaximumSize(QtCore.QSize(520, 160)) 33 | self.login_widget.setObjectName("login_widget") 34 | self.pushButton_2 = QtWidgets.QPushButton(self.login_widget) 35 | self.pushButton_2.setGeometry(QtCore.QRect(479, 117, 30, 30)) 36 | self.pushButton_2.setMinimumSize(QtCore.QSize(30, 30)) 37 | self.pushButton_2.setMaximumSize(QtCore.QSize(30, 30)) 38 | self.pushButton_2.setStyleSheet("background-color:transparent ;\n" 39 | "image: url(:/login/二维码.png);") 40 | self.pushButton_2.setText("") 41 | self.pushButton_2.setObjectName("pushButton_2") 42 | self.password_btn = QtWidgets.QPushButton(self.login_widget) 43 | self.password_btn.setGeometry(QtCore.QRect(390, 50, 93, 28)) 44 | self.password_btn.setStyleSheet("\n" 45 | "background-color:transparent ;\n" 46 | "color: rgb(0, 170, 255);") 47 | self.password_btn.setFlat(True) 48 | self.password_btn.setObjectName("password_btn") 49 | self.login_btn = QtWidgets.QPushButton(self.login_widget) 50 | self.login_btn.setEnabled(False) 51 | self.login_btn.setGeometry(QtCore.QRect(159, 107, 230, 35)) 52 | self.login_btn.setMinimumSize(QtCore.QSize(230, 35)) 53 | self.login_btn.setMaximumSize(QtCore.QSize(230, 35)) 54 | self.login_btn.setStyleSheet("QPushButton{\n" 55 | " background-color:rgb(85, 170, 255);\n" 56 | " font: 10pt \"微软雅黑\";\n" 57 | " color: rgb(255, 255, 255);\n" 58 | " border-radius:6px;\n" 59 | "}\n" 60 | "QPushButton:pressed{\n" 61 | " background-color:rgb(0, 170, 255);\n" 62 | "}\n" 63 | "QPushButton:disabled{\n" 64 | " background-color:rgb(172, 172, 172);\n" 65 | "}\n" 66 | "QPushButton:hover{\n" 67 | " background-color:rgb(25, 225, 255);\n" 68 | "}\n" 69 | "") 70 | self.login_btn.setCheckable(False) 71 | self.login_btn.setObjectName("login_btn") 72 | self.head_widget = QtWidgets.QWidget(self.login_widget) 73 | self.head_widget.setEnabled(True) 74 | self.head_widget.setGeometry(QtCore.QRect(39, 21, 101, 101)) 75 | self.head_widget.setStyleSheet("border-radius:16px;\n" 76 | "border-image: url(:/login/1.jpeg);") 77 | self.head_widget.setObjectName("head_widget") 78 | self.state_btn_2 = QtWidgets.QPushButton(self.head_widget) 79 | self.state_btn_2.setGeometry(QtCore.QRect(80, 80, 20, 20)) 80 | self.state_btn_2.setMinimumSize(QtCore.QSize(20, 20)) 81 | self.state_btn_2.setMaximumSize(QtCore.QSize(20, 20)) 82 | self.state_btn_2.setStyleSheet("image: url(:/login/在线.png);\n" 83 | "image: url(:/login/在线.png);") 84 | self.state_btn_2.setText("") 85 | self.state_btn_2.setCheckable(True) 86 | self.state_btn_2.setChecked(False) 87 | self.state_btn_2.setObjectName("state_btn_2") 88 | self.antologin_checkbox = QtWidgets.QCheckBox(self.login_widget) 89 | self.antologin_checkbox.setGeometry(QtCore.QRect(303, 82, 87, 19)) 90 | self.antologin_checkbox.setStyleSheet("font: 9pt \"微软雅黑\";\n" 91 | "color:rgb(191, 197, 203);") 92 | self.antologin_checkbox.setObjectName("antologin_checkbox") 93 | self.register_btn_2 = QtWidgets.QPushButton(self.login_widget) 94 | self.register_btn_2.setGeometry(QtCore.QRect(9, 117, 30, 30)) 95 | self.register_btn_2.setMinimumSize(QtCore.QSize(30, 30)) 96 | self.register_btn_2.setMaximumSize(QtCore.QSize(30, 30)) 97 | self.register_btn_2.setStyleSheet("image: url(:/login/添加好友.png);\n" 98 | "background-color:transparent ;\n" 99 | "") 100 | self.register_btn_2.setText("") 101 | self.register_btn_2.setObjectName("register_btn_2") 102 | self.rember_checkbox = QtWidgets.QCheckBox(self.login_widget) 103 | self.rember_checkbox.setEnabled(True) 104 | self.rember_checkbox.setGeometry(QtCore.QRect(160, 82, 87, 19)) 105 | self.rember_checkbox.setStyleSheet("font: 9pt \"微软雅黑\";\n" 106 | "color:rgb(191, 197, 203);") 107 | self.rember_checkbox.setObjectName("rember_checkbox") 108 | self.register_btn = QtWidgets.QPushButton(self.login_widget) 109 | self.register_btn.setGeometry(QtCore.QRect(390, 22, 93, 28)) 110 | self.register_btn.setStyleSheet("background-color:transparent ;\n" 111 | "color: rgb(0, 170, 255);\n" 112 | "QPushButton {\n" 113 | " color: rgb(0, 170, 255);\n" 114 | "}\n" 115 | "QPushButton:pressed{\n" 116 | " font-color:rgb(0, 0, 0);\n" 117 | " color: rgb(0, 170, 255);\n" 118 | "}\n" 119 | "QPushButton:hover{\n" 120 | " color: rgb(0, 170, 255);\n" 121 | "}") 122 | self.register_btn.setFlat(True) 123 | self.register_btn.setObjectName("register_btn") 124 | self.password_line = QtWidgets.QLineEdit(self.login_widget) 125 | self.password_line.setGeometry(QtCore.QRect(159, 47, 230, 30)) 126 | self.password_line.setMinimumSize(QtCore.QSize(230, 30)) 127 | self.password_line.setMaximumSize(QtCore.QSize(230, 30)) 128 | self.password_line.setStyleSheet("QLineEdit{\n" 129 | " font-size:16px;\n" 130 | " border:none;\n" 131 | " border-bottom:1px solid lightgray;\n" 132 | " background-color:transparent;\n" 133 | " font: 10pt \"黑体\";\n" 134 | "}\n" 135 | "QLineEdit:hover{\n" 136 | " border-bottom:1px solid gray;\n" 137 | "}\n" 138 | "QLineEdit:focus{\n" 139 | " border-bottom:1px solid rgb(18,183,245);\n" 140 | "}\n" 141 | "") 142 | self.password_line.setText("") 143 | self.password_line.setEchoMode(QtWidgets.QLineEdit.Password) 144 | self.password_line.setClearButtonEnabled(True) 145 | self.password_line.setObjectName("password_line") 146 | self.name_line = QtWidgets.QComboBox(self.login_widget) 147 | self.name_line.setGeometry(QtCore.QRect(160, 20, 230, 30)) 148 | self.name_line.setMinimumSize(QtCore.QSize(230, 30)) 149 | self.name_line.setMaximumSize(QtCore.QSize(230, 30)) 150 | self.name_line.setStyleSheet("QComboBox{\n" 151 | " font-size:20px;\n" 152 | " border:none;\n" 153 | " border-bottom:1px solid lightgray;\n" 154 | " background-color:transparent;\n" 155 | "}\n" 156 | "QComboBox:hover{\n" 157 | " border-bottom:1px solid gray;\n" 158 | "}\n" 159 | "QComboBox:focus{\n" 160 | " border-bottom:1px solid rgb(18,183,245);\n" 161 | "}\n" 162 | "QComboBox::drop-down{\n" 163 | " background-color:transparent;\n" 164 | " width:40px;\n" 165 | " height:30px;\n" 166 | "}\n" 167 | "QComboBox::down-arrow{\n" 168 | " image: url(:/login/下拉.png);\n" 169 | " width:60px;\n" 170 | " height:20px;\n" 171 | "}\n" 172 | "QComboBox QAbstractItemView{\n" 173 | " min-height:60px;\n" 174 | "}\n" 175 | "QComboBox QAbstractItemView:item{\n" 176 | " color:lightblus;\n" 177 | "}") 178 | self.name_line.setEditable(True) 179 | self.name_line.setObjectName("name_line") 180 | self.name_line.addItem(icon, "") 181 | icon1 = QtGui.QIcon() 182 | icon1.addPixmap(QtGui.QPixmap(":/login/file.jpg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) 183 | self.name_line.addItem(icon1, "") 184 | self.pushButton = QtWidgets.QPushButton(Form) 185 | self.pushButton.setGeometry(QtCore.QRect(0, 0, 31, 31)) 186 | self.pushButton.setStyleSheet("background-color:transparent ;\n" 187 | "border-image: url(:/login/下拉.png);") 188 | self.pushButton.setText("") 189 | self.pushButton.setObjectName("pushButton") 190 | 191 | self.retranslateUi(Form) 192 | self.name_line.editTextChanged['QString'].connect(Form.check_login) 193 | self.password_line.textChanged['QString'].connect(Form.check_login) 194 | self.rember_checkbox.clicked['bool'].connect(Form.rember_pwd) 195 | self.antologin_checkbox.clicked['bool'].connect(Form.auto_login) 196 | self.login_btn.clicked.connect(Form.checked_login) 197 | self.register_btn_2.clicked.connect(Form.show_register_pane) 198 | self.pushButton_2.clicked.connect(Form.show_qrcode_pane) 199 | self.pushButton.clicked.connect(Form.show_setup_pane) 200 | self.register_btn.clicked.connect(Form.show_register_pane) 201 | self.password_btn.clicked.connect(Form.show_findpwd_link) 202 | QtCore.QMetaObject.connectSlotsByName(Form) 203 | 204 | def retranslateUi(self, Form): 205 | _translate = QtCore.QCoreApplication.translate 206 | Form.setWindowTitle(_translate("Form", "Tim登录")) 207 | self.password_btn.setText(_translate("Form", "找回密码")) 208 | self.login_btn.setText(_translate("Form", "登录")) 209 | self.antologin_checkbox.setText(_translate("Form", "自动登录")) 210 | self.rember_checkbox.setText(_translate("Form", "记住密码")) 211 | self.register_btn.setText(_translate("Form", "注册账号")) 212 | self.password_line.setPlaceholderText(_translate("Form", "请输入你的密码")) 213 | self.name_line.setItemText(0, _translate("Form", "1234567890")) 214 | self.name_line.setItemText(1, _translate("Form", "2345678901")) 215 | 216 | 217 | import rc.login_rc 218 | 219 | if __name__ == "__main__": 220 | import sys 221 | 222 | app = QtWidgets.QApplication(sys.argv) 223 | Form = QtWidgets.QWidget() 224 | ui = Ui_Form() 225 | ui.setupUi(Form) 226 | Form.show() 227 | sys.exit(app.exec_()) 228 | -------------------------------------------------------------------------------- /resource/Ui_register.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Form implementation generated from reading ui file 'I:\python_base_Code\PyQt5学习\PyQt_Demo\resource\UI\register.ui' 4 | # 5 | # Created by: PyQt5 UI code generator 5.13.0 6 | # 7 | # WARNING! All changes made in this file will be lost! 8 | 9 | 10 | from PyQt5 import QtCore, QtGui, QtWidgets 11 | 12 | 13 | # 注册界面实现 14 | class Ui_Form(object): 15 | def setupUi(self, Form): 16 | Form.setObjectName("Form") 17 | Form.resize(520, 350) 18 | Form.setMinimumSize(QtCore.QSize(520, 350)) 19 | Form.setMaximumSize(QtCore.QSize(520, 350)) 20 | icon = QtGui.QIcon() 21 | icon.addPixmap(QtGui.QPixmap(":/login/QQ.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) 22 | Form.setWindowIcon(icon) 23 | Form.setStyleSheet("QWidget#Form{\n" 24 | " \n" 25 | " \n" 26 | " border-image: url(:/login/登录图片.png);\n" 27 | "}") 28 | self.pushButton = QtWidgets.QPushButton(Form) 29 | self.pushButton.setGeometry(QtCore.QRect(180, 230, 150, 35)) 30 | self.pushButton.setMinimumSize(QtCore.QSize(150, 35)) 31 | self.pushButton.setMaximumSize(QtCore.QSize(150, 35)) 32 | self.pushButton.setStyleSheet("background-color:rgb(244, 244, 244) ;\n" 33 | "font: 75 9pt \"微软雅黑\";\n" 34 | "border-radius:6px;\n" 35 | "\n" 36 | "") 37 | icon1 = QtGui.QIcon() 38 | icon1.addPixmap(QtGui.QPixmap(":/login/添加好友.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) 39 | self.pushButton.setIcon(icon1) 40 | self.pushButton.setObjectName("pushButton") 41 | self.pushButton_2 = QtWidgets.QPushButton(Form) 42 | self.pushButton_2.setGeometry(QtCore.QRect(10, 310, 30, 30)) 43 | self.pushButton_2.setMinimumSize(QtCore.QSize(30, 30)) 44 | self.pushButton_2.setMaximumSize(QtCore.QSize(30, 30)) 45 | self.pushButton_2.setStyleSheet("image: url(:/login/QQ.png);\n" 46 | "background-color:transparent ;") 47 | self.pushButton_2.setText("") 48 | self.pushButton_2.setObjectName("pushButton_2") 49 | self.pushButton_3 = QtWidgets.QPushButton(Form) 50 | self.pushButton_3.setGeometry(QtCore.QRect(470, 310, 30, 30)) 51 | self.pushButton_3.setMinimumSize(QtCore.QSize(30, 30)) 52 | self.pushButton_3.setMaximumSize(QtCore.QSize(30, 30)) 53 | self.pushButton_3.setStyleSheet("background-color:transparent ;\n" 54 | "image: url(:/login/二维码.png);") 55 | self.pushButton_3.setText("") 56 | self.pushButton_3.setObjectName("pushButton_3") 57 | self.login_btn_2 = QtWidgets.QPushButton(Form) 58 | self.login_btn_2.setEnabled(True) 59 | self.login_btn_2.setGeometry(QtCore.QRect(140, 290, 230, 35)) 60 | self.login_btn_2.setMinimumSize(QtCore.QSize(230, 35)) 61 | self.login_btn_2.setMaximumSize(QtCore.QSize(230, 35)) 62 | self.login_btn_2.setStyleSheet("QPushButton{\n" 63 | " background-color:rgb(85, 170, 255);\n" 64 | " font: 10pt \"微软雅黑\";\n" 65 | " color: rgb(255, 255, 255);\n" 66 | " border-radius:6px;\n" 67 | "}\n" 68 | "QPushButton:pressed{\n" 69 | " background-color:rgb(0, 170, 255);\n" 70 | "}\n" 71 | "\n" 72 | "QPushButton:hover{\n" 73 | " background-color:rgb(25, 225, 255);\n" 74 | "}\n" 75 | "") 76 | self.login_btn_2.setCheckable(False) 77 | self.login_btn_2.setObjectName("login_btn_2") 78 | 79 | self.retranslateUi(Form) 80 | self.pushButton_2.clicked.connect(Form.exit_register_pane) 81 | self.pushButton.clicked.connect(Form.open_register_link) 82 | self.login_btn_2.clicked.connect(Form.exit_register_pane) 83 | self.pushButton_3.clicked.connect(Form.show_qrcode_pane) 84 | QtCore.QMetaObject.connectSlotsByName(Form) 85 | 86 | def retranslateUi(self, Form): 87 | _translate = QtCore.QCoreApplication.translate 88 | Form.setWindowTitle(_translate("Form", "添加账号")) 89 | self.pushButton.setText(_translate("Form", " 注册QQ账号")) 90 | self.login_btn_2.setText(_translate("Form", "登录")) 91 | import rc.login_rc 92 | 93 | 94 | if __name__ == "__main__": 95 | import sys 96 | app = QtWidgets.QApplication(sys.argv) 97 | Form = QtWidgets.QWidget() 98 | ui = Ui_Form() 99 | ui.setupUi(Form) 100 | Form.show() 101 | sys.exit(app.exec_()) 102 | -------------------------------------------------------------------------------- /resource/Ui_setup.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Form implementation generated from reading ui file 'I:\python_base_Code\PyQt5学习\PyQt_Demo\resource\UI\setup.ui' 4 | # 5 | # Created by: PyQt5 UI code generator 5.13.0 6 | # 7 | # WARNING! All changes made in this file will be lost! 8 | 9 | 10 | from PyQt5 import QtCore, QtGui, QtWidgets 11 | 12 | 13 | # 代理设置界面设置 14 | class Ui_Form(object): 15 | def setupUi(self, Form): 16 | Form.setObjectName("Form") 17 | Form.resize(520, 350) 18 | Form.setMinimumSize(QtCore.QSize(520, 350)) 19 | Form.setMaximumSize(QtCore.QSize(520, 350)) 20 | icon = QtGui.QIcon() 21 | icon.addPixmap(QtGui.QPixmap(":/login/QQ.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) 22 | Form.setWindowIcon(icon) 23 | self.widget = QtWidgets.QWidget(Form) 24 | self.widget.setGeometry(QtCore.QRect(1, 1, 520, 30)) 25 | self.widget.setMinimumSize(QtCore.QSize(520, 30)) 26 | self.widget.setMaximumSize(QtCore.QSize(520, 30)) 27 | self.widget.setStyleSheet("image: url(:/login/版图.png);") 28 | self.widget.setObjectName("widget") 29 | self.widget_2 = QtWidgets.QWidget(Form) 30 | self.widget_2.setGeometry(QtCore.QRect(1, 31, 520, 289)) 31 | self.widget_2.setStyleSheet("background-color: rgb(235, 242, 249);\n" 32 | "font: 9pt \"黑体\";") 33 | self.widget_2.setObjectName("widget_2") 34 | self.label = QtWidgets.QLabel(self.widget_2) 35 | self.label.setGeometry(QtCore.QRect(30, 40, 72, 15)) 36 | self.label.setStyleSheet("font: 10pt \"黑体\";") 37 | self.label.setObjectName("label") 38 | self.label_2 = QtWidgets.QLabel(self.widget_2) 39 | self.label_2.setGeometry(QtCore.QRect(40, 80, 72, 15)) 40 | self.label_2.setObjectName("label_2") 41 | self.label_3 = QtWidgets.QLabel(self.widget_2) 42 | self.label_3.setGeometry(QtCore.QRect(30, 120, 72, 15)) 43 | self.label_3.setObjectName("label_3") 44 | self.label_4 = QtWidgets.QLabel(self.widget_2) 45 | self.label_4.setGeometry(QtCore.QRect(20, 190, 101, 16)) 46 | self.label_4.setStyleSheet("font: 10pt \"黑体\";") 47 | self.label_4.setObjectName("label_4") 48 | self.label_5 = QtWidgets.QLabel(self.widget_2) 49 | self.label_5.setGeometry(QtCore.QRect(50, 230, 72, 15)) 50 | self.label_5.setObjectName("label_5") 51 | self.comboBox = QtWidgets.QComboBox(self.widget_2) 52 | self.comboBox.setGeometry(QtCore.QRect(90, 71, 111, 31)) 53 | self.comboBox.setStyleSheet("font: 75 7pt \"微软雅黑\";") 54 | self.comboBox.setObjectName("comboBox") 55 | self.comboBox.addItem("") 56 | self.comboBox.addItem("") 57 | self.comboBox.addItem("") 58 | self.comboBox.addItem("") 59 | self.label_6 = QtWidgets.QLabel(self.widget_2) 60 | self.label_6.setGeometry(QtCore.QRect(210, 80, 41, 21)) 61 | self.label_6.setObjectName("label_6") 62 | self.lineEdit = QtWidgets.QLineEdit(self.widget_2) 63 | self.lineEdit.setEnabled(False) 64 | self.lineEdit.setGeometry(QtCore.QRect(250, 70, 121, 31)) 65 | self.lineEdit.setStyleSheet("QLineEdit{\n" 66 | " background-color:rgb(255, 255, 255);\n" 67 | " border-radius:6px;\n" 68 | "}\n" 69 | "\n" 70 | "QLineEdit:disabled{\n" 71 | " background-color:rgb(245, 248, 252);\n" 72 | "}") 73 | self.lineEdit.setObjectName("lineEdit") 74 | self.label_7 = QtWidgets.QLabel(self.widget_2) 75 | self.label_7.setGeometry(QtCore.QRect(380, 80, 72, 15)) 76 | self.label_7.setObjectName("label_7") 77 | self.lineEdit_2 = QtWidgets.QLineEdit(self.widget_2) 78 | self.lineEdit_2.setEnabled(False) 79 | self.lineEdit_2.setGeometry(QtCore.QRect(420, 70, 71, 31)) 80 | self.lineEdit_2.setStyleSheet("QLineEdit{\n" 81 | " background-color:rgb(255, 255, 255);\n" 82 | " border-radius:6px;\n" 83 | "}\n" 84 | "\n" 85 | "QLineEdit:disabled{\n" 86 | " background-color:rgb(245, 248, 252);\n" 87 | "}") 88 | self.lineEdit_2.setObjectName("lineEdit_2") 89 | self.lineEdit_3 = QtWidgets.QLineEdit(self.widget_2) 90 | self.lineEdit_3.setEnabled(False) 91 | self.lineEdit_3.setGeometry(QtCore.QRect(90, 110, 113, 31)) 92 | self.lineEdit_3.setStyleSheet("QLineEdit{\n" 93 | " background-color:rgb(255, 255, 255);\n" 94 | " border-radius:6px;\n" 95 | "}\n" 96 | "\n" 97 | "QLineEdit:disabled{\n" 98 | " background-color:rgb(245, 248, 252);\n" 99 | "}") 100 | self.lineEdit_3.setObjectName("lineEdit_3") 101 | self.label_8 = QtWidgets.QLabel(self.widget_2) 102 | self.label_8.setGeometry(QtCore.QRect(210, 120, 41, 20)) 103 | self.label_8.setObjectName("label_8") 104 | self.lineEdit_4 = QtWidgets.QLineEdit(self.widget_2) 105 | self.lineEdit_4.setEnabled(False) 106 | self.lineEdit_4.setGeometry(QtCore.QRect(250, 110, 121, 31)) 107 | self.lineEdit_4.setStyleSheet("QLineEdit{\n" 108 | " background-color:rgb(255, 255, 255);\n" 109 | " border-radius:6px;\n" 110 | "}\n" 111 | "\n" 112 | "QLineEdit:disabled{\n" 113 | " background-color:rgb(245, 248, 252);\n" 114 | "}") 115 | self.lineEdit_4.setObjectName("lineEdit_4") 116 | self.label_9 = QtWidgets.QLabel(self.widget_2) 117 | self.label_9.setGeometry(QtCore.QRect(390, 120, 21, 16)) 118 | self.label_9.setObjectName("label_9") 119 | self.lineEdit_5 = QtWidgets.QLineEdit(self.widget_2) 120 | self.lineEdit_5.setEnabled(False) 121 | self.lineEdit_5.setGeometry(QtCore.QRect(420, 110, 71, 31)) 122 | self.lineEdit_5.setStyleSheet("QLineEdit{\n" 123 | " background-color:rgb(255, 255, 255);\n" 124 | " border-radius:6px;\n" 125 | "}\n" 126 | "\n" 127 | "QLineEdit:disabled{\n" 128 | " background-color:rgb(245, 248, 252);\n" 129 | "}") 130 | self.lineEdit_5.setObjectName("lineEdit_5") 131 | self.pushButton = QtWidgets.QPushButton(self.widget_2) 132 | self.pushButton.setEnabled(False) 133 | self.pushButton.setGeometry(QtCore.QRect(420, 150, 71, 28)) 134 | self.pushButton.setStyleSheet("background-color: rgb(240, 245, 250);\n" 135 | "font: 9pt \"黑体\";") 136 | self.pushButton.setObjectName("pushButton") 137 | self.comboBox_2 = QtWidgets.QComboBox(self.widget_2) 138 | self.comboBox_2.setGeometry(QtCore.QRect(100, 221, 111, 31)) 139 | self.comboBox_2.setStyleSheet("font: 75 7pt \"微软雅黑\";") 140 | self.comboBox_2.setObjectName("comboBox_2") 141 | self.comboBox_2.addItem("") 142 | self.comboBox_2.addItem("") 143 | self.comboBox_2.addItem("") 144 | self.label_10 = QtWidgets.QLabel(self.widget_2) 145 | self.label_10.setGeometry(QtCore.QRect(220, 230, 72, 15)) 146 | self.label_10.setObjectName("label_10") 147 | self.comboBox_3 = QtWidgets.QComboBox(self.widget_2) 148 | self.comboBox_3.setEnabled(False) 149 | self.comboBox_3.setGeometry(QtCore.QRect(270, 221, 101, 31)) 150 | self.comboBox_3.setStyleSheet("QLineEdit{\n" 151 | " background-color:rgb(85, 170, 255);\n" 152 | " color: rgb(255, 255, 255);\n" 153 | " border-radius:6px;\n" 154 | "}\n" 155 | "\n" 156 | "QLineEdit:disabled{\n" 157 | " background-color:rgb(245, 248, 252);\n" 158 | "}") 159 | self.comboBox_3.setObjectName("comboBox_3") 160 | self.comboBox_3.addItem("") 161 | self.comboBox_3.setItemText(0, "") 162 | self.comboBox_3.addItem("") 163 | self.comboBox_3.addItem("") 164 | self.comboBox_3.addItem("") 165 | self.comboBox_3.addItem("") 166 | self.comboBox_3.addItem("") 167 | self.comboBox_3.addItem("") 168 | self.label_11 = QtWidgets.QLabel(self.widget_2) 169 | self.label_11.setGeometry(QtCore.QRect(380, 230, 72, 15)) 170 | self.label_11.setObjectName("label_11") 171 | self.lineEdit_6 = QtWidgets.QLineEdit(self.widget_2) 172 | self.lineEdit_6.setEnabled(False) 173 | self.lineEdit_6.setGeometry(QtCore.QRect(420, 220, 71, 31)) 174 | self.lineEdit_6.setStyleSheet("QLineEdit{\n" 175 | " background-color:rgb(255, 255, 255);\n" 176 | " border-radius:6px;\n" 177 | "}\n" 178 | "\n" 179 | "QLineEdit:disabled{\n" 180 | " background-color:rgb(245, 248, 252);\n" 181 | "}") 182 | self.lineEdit_6.setObjectName("lineEdit_6") 183 | self.widget_3 = QtWidgets.QWidget(Form) 184 | self.widget_3.setGeometry(QtCore.QRect(1, 320, 520, 30)) 185 | self.widget_3.setMinimumSize(QtCore.QSize(520, 30)) 186 | self.widget_3.setMaximumSize(QtCore.QSize(520, 30)) 187 | self.widget_3.setStyleSheet("background-color: rgb(205, 226, 242);") 188 | self.widget_3.setObjectName("widget_3") 189 | self.buttonBox = QtWidgets.QDialogButtonBox(self.widget_3) 190 | self.buttonBox.setGeometry(QtCore.QRect(302, 0, 201, 28)) 191 | self.buttonBox.setStyleSheet("color: rgb(85, 85, 85);\n" 192 | "background-color: rgb(242, 242, 242);\n" 193 | "font: 9pt \"黑体\";\n" 194 | "") 195 | self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel | QtWidgets.QDialogButtonBox.Ok) 196 | self.buttonBox.setObjectName("buttonBox") 197 | 198 | self.retranslateUi(Form) 199 | self.buttonBox.rejected.connect(Form.show_menu) 200 | self.buttonBox.accepted.connect(Form.show_menu) 201 | self.lineEdit.textChanged['QString'].connect(Form.enable_test) 202 | self.lineEdit_2.textChanged['QString'].connect(Form.enable_test) 203 | self.comboBox.activated['QString'].connect(Form.enable_test) 204 | self.comboBox_2.activated['QString'].connect(Form.enable_pane) 205 | self.comboBox_3.activated['QString'].connect(Form.enable_pane) 206 | self.lineEdit_6.textChanged['QString'].connect(Form.enable_pane) 207 | self.lineEdit_3.textChanged['QString'].connect(Form.enable_test) 208 | self.lineEdit_4.textChanged['QString'].connect(Form.enable_test) 209 | self.lineEdit_5.textChanged['QString'].connect(Form.enable_test) 210 | self.pushButton.clicked.connect(Form.enable_test) 211 | QtCore.QMetaObject.connectSlotsByName(Form) 212 | 213 | def retranslateUi(self, Form): 214 | _translate = QtCore.QCoreApplication.translate 215 | Form.setWindowTitle(_translate("Form", "设置")) 216 | self.label.setText(_translate("Form", "网络设置")) 217 | self.label_2.setText(_translate("Form", " 类型:")) 218 | self.label_3.setText(_translate("Form", "用户名:")) 219 | self.label_4.setText(_translate("Form", "登录服务器")) 220 | self.label_5.setText(_translate("Form", "类型:")) 221 | self.comboBox.setItemText(0, _translate("Form", "不使用代理")) 222 | self.comboBox.setItemText(1, _translate("Form", "HTTP代理")) 223 | self.comboBox.setItemText(2, _translate("Form", "SOCKS5代理")) 224 | self.comboBox.setItemText(3, _translate("Form", "使用浏览器设置")) 225 | self.label_6.setText(_translate("Form", "地址:")) 226 | self.label_7.setText(_translate("Form", "端口:")) 227 | self.label_8.setText(_translate("Form", "密码:")) 228 | self.label_9.setText(_translate("Form", "域:")) 229 | self.pushButton.setText(_translate("Form", "测试")) 230 | self.comboBox_2.setItemText(0, _translate("Form", "不使用高级选项")) 231 | self.comboBox_2.setItemText(1, _translate("Form", "UDP类型")) 232 | self.comboBox_2.setItemText(2, _translate("Form", "TCp类型")) 233 | self.label_10.setText(_translate("Form", "地址:")) 234 | self.comboBox_3.setItemText(1, _translate("Form", "183.60.48.174")) 235 | self.comboBox_3.setItemText(2, _translate("Form", "sz.tencent.com")) 236 | self.comboBox_3.setItemText(3, _translate("Form", "sz2.tencent.com")) 237 | self.comboBox_3.setItemText(4, _translate("Form", "sz3.tencent.com")) 238 | self.comboBox_3.setItemText(5, _translate("Form", "sz4.tencent.com")) 239 | self.comboBox_3.setItemText(6, _translate("Form", "sz5.tencent.com")) 240 | self.label_11.setText(_translate("Form", "端口:")) 241 | 242 | 243 | import rc.login_rc 244 | 245 | if __name__ == "__main__": 246 | import sys 247 | 248 | app = QtWidgets.QApplication(sys.argv) 249 | Form = QtWidgets.QWidget() 250 | ui = Ui_Form() 251 | ui.setupUi(Form) 252 | Form.show() 253 | sys.exit(app.exec_()) 254 | -------------------------------------------------------------------------------- /resource/images/1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zengbolin/pyqt5_python-/55d7b82b940bff825e8282de0d15ecd3875a6eff/resource/images/1.jpeg -------------------------------------------------------------------------------- /resource/images/2.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zengbolin/pyqt5_python-/55d7b82b940bff825e8282de0d15ecd3875a6eff/resource/images/2.PNG -------------------------------------------------------------------------------- /resource/images/QQ.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zengbolin/pyqt5_python-/55d7b82b940bff825e8282de0d15ecd3875a6eff/resource/images/QQ.png -------------------------------------------------------------------------------- /resource/images/QR_code.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zengbolin/pyqt5_python-/55d7b82b940bff825e8282de0d15ecd3875a6eff/resource/images/QR_code.jpg -------------------------------------------------------------------------------- /resource/images/file.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zengbolin/pyqt5_python-/55d7b82b940bff825e8282de0d15ecd3875a6eff/resource/images/file.jpg -------------------------------------------------------------------------------- /resource/images/login.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 计算器.png 4 | 下拉.png 5 | scan.png 6 | QR_code.jpg 7 | 版图.png 8 | QQ.png 9 | 登录图片.png 10 | 二维码.png 11 | 忙碌-im.png 12 | 添加好友.png 13 | 隐身.png 14 | 在线.png 15 | 1.jpeg 16 | file.jpg 17 | 18 | 19 | -------------------------------------------------------------------------------- /resource/images/scan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zengbolin/pyqt5_python-/55d7b82b940bff825e8282de0d15ecd3875a6eff/resource/images/scan.png -------------------------------------------------------------------------------- /resource/images/下拉.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zengbolin/pyqt5_python-/55d7b82b940bff825e8282de0d15ecd3875a6eff/resource/images/下拉.png -------------------------------------------------------------------------------- /resource/images/二维码.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zengbolin/pyqt5_python-/55d7b82b940bff825e8282de0d15ecd3875a6eff/resource/images/二维码.png -------------------------------------------------------------------------------- /resource/images/在线.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zengbolin/pyqt5_python-/55d7b82b940bff825e8282de0d15ecd3875a6eff/resource/images/在线.png -------------------------------------------------------------------------------- /resource/images/忙碌-im.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zengbolin/pyqt5_python-/55d7b82b940bff825e8282de0d15ecd3875a6eff/resource/images/忙碌-im.png -------------------------------------------------------------------------------- /resource/images/捕获.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zengbolin/pyqt5_python-/55d7b82b940bff825e8282de0d15ecd3875a6eff/resource/images/捕获.PNG -------------------------------------------------------------------------------- /resource/images/添加好友.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zengbolin/pyqt5_python-/55d7b82b940bff825e8282de0d15ecd3875a6eff/resource/images/添加好友.png -------------------------------------------------------------------------------- /resource/images/版图.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zengbolin/pyqt5_python-/55d7b82b940bff825e8282de0d15ecd3875a6eff/resource/images/版图.png -------------------------------------------------------------------------------- /resource/images/登录图片.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zengbolin/pyqt5_python-/55d7b82b940bff825e8282de0d15ecd3875a6eff/resource/images/登录图片.png -------------------------------------------------------------------------------- /resource/images/计算器.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zengbolin/pyqt5_python-/55d7b82b940bff825e8282de0d15ecd3875a6eff/resource/images/计算器.png -------------------------------------------------------------------------------- /resource/images/隐身-im.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zengbolin/pyqt5_python-/55d7b82b940bff825e8282de0d15ecd3875a6eff/resource/images/隐身-im.png -------------------------------------------------------------------------------- /resource/images/隐身.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zengbolin/pyqt5_python-/55d7b82b940bff825e8282de0d15ecd3875a6eff/resource/images/隐身.png -------------------------------------------------------------------------------- /tools/Caculator.py: -------------------------------------------------------------------------------- 1 | # encoding:utf-8 2 | from PyQt5.QtCore import QObject, pyqtSignal 3 | 4 | 5 | # 计算器逻辑实现 6 | class Caculators(QObject): 7 | # 定义显示文本信号 8 | show_content = pyqtSignal(str) 9 | 10 | def __init__(self): 11 | super(Caculators, self).__init__() 12 | 13 | # 数字键位 num 运算符 opartor 14 | self.key_models = [] 15 | 16 | def parse_key_model(self, key_model): 17 | 18 | # AC键的功能实现 19 | if key_model["role"] == 'clear': 20 | print("清空所有内容") 21 | self.key_models = [] 22 | # 文本显示初始状态为 0 23 | self.show_content.emit('0') 24 | return 25 | 26 | # =号的功能实现 27 | if key_model['role'] == 'caculater': 28 | print("计算所有内容") 29 | # 使用参数接受运算结果 30 | result = self.caculate() 31 | # 文本显示暂时的结果 32 | self.show_content.emit(str(result)) 33 | return 34 | 35 | # 数字键和运算符 36 | # 开始状态为长度为0的时刻,处理用户一开始输入.的操作 37 | if len(self.key_models) == 0: 38 | if key_model['role'] == 'num': 39 | if key_model['title'] == '.': 40 | key_model['title'] = '0.' 41 | # 序列拼接 42 | self.key_models.append(key_model) 43 | # 文本显示 0. 44 | self.show_content.emit(self.key_models[-1]['title']) 45 | return 46 | 47 | # 处理正负号和百分号 48 | if key_model['title'] in ('%', '+/-'): 49 | # 若符号前面不为数字,就当作用户输入问题,不处理 50 | if self.key_models[-1]['role'] != 'num': 51 | return 52 | else: 53 | # 当用户输入%的逻辑处理 54 | if key_model['title'] == '%': 55 | # * 0.01 56 | self.key_models[-1]['title'] = str(float(self.key_models[-1]['title']) / 100) 57 | # 当用户输入负号的逻辑处理 58 | elif key_model['title'] == '-': 59 | self.key_models[-1]['title'] = str(float(self.key_models[-1]['title']) * (-1)) 60 | # 文本显示内容5% 就显示为 0.05 61 | self.show_content.emit(self.key_models[-1]['title']) 62 | return 63 | 64 | # 合并数字和运算符 65 | # 先判断前一个字符和后一个字符的类型是否一样 66 | if key_model['role'] == self.key_models[-1]['role']: 67 | # 当前一个输入为数字,后一个也为数字的逻辑 68 | if key_model['role'] == 'num': 69 | # 当前面输入有小数点,后面再输入小数点的逻辑处理 70 | if key_model['title'] == '.' and self.key_models[-1]['title'].__contains__('.'): 71 | return 72 | # 当0和0的拼接逻辑 73 | if self.key_models[-1]['title'] != '0': 74 | # 当第一个字符不为0 75 | self.key_models[-1]['title'] += key_model['title'] 76 | else: 77 | self.key_models[-1]['title'] = key_model['title'] 78 | # 展示最终拼接结果 79 | self.show_content.emit(self.key_models[-1]['title']) 80 | else: 81 | # 两个类型一样,但是只有一个为num类型 82 | self.key_models[-1]['title'] = key_model['title'] 83 | # 展示显示结果 84 | self.show_content.emit(str(self.caculate())) 85 | # 前后输入的类型不一样 86 | else: 87 | # 当有 . % +/- 等直接返回 88 | if key_model['title'] in (".", "%", "+/-"): 89 | return 90 | # 当为数字键时,直接在文本框显示 91 | if key_model['role'] == 'num': 92 | # 显示数字键 93 | self.show_content.emit(key_model['title']) 94 | else: 95 | # 显示计算结果 为= 96 | self.show_content.emit(str(self.caculate())) 97 | # 增加运算表达式 98 | self.key_models.append(key_model) 99 | 100 | def caculate(self): 101 | # 判断表达式是否成立 102 | if len(self.key_models) > 0 and self.key_models[-1]['role'] == 'opartor': 103 | # 去掉等号 104 | self.key_models.pop(-1) 105 | expression = "" 106 | # 拼接等式 107 | for model in self.key_models: 108 | expression += model['title'] 109 | 110 | # 计算表达式 111 | result = eval(expression) 112 | # print(result) 113 | return result 114 | --------------------------------------------------------------------------------