## PySide2-Customized-Window
### 简介 Introduction
本Python模块是PySideX-Customized-Window的PySide2分支,允许用户创建自定义非客户区窗口,非客户区使用PySide2绘制,支持移动、最小化、最大化、贴边自动布局、背景模糊等功能。只支持Windows、ReactOS、Wine平台。
<br>
This Python module is the PySide2 branch of PySideX-Customized-Window, allows users to create windows with customized non-client area which are drawn with PySide2, support moving, minimizing, maximizing, auto-layout of borders, background blurring, etc. It only supports Windows, ReactOS and Wine.
### 安装命令 Installation command
*`python -m pip install PySide2-Customized-Window`*
### 示例代码 Example code
```
# -*- coding: utf-8 -*-
import sys
from PySide2.QtWidgets import *
from PySide2.QtGui import *
from PySide2.QtCore import *
from PySide2_Customized_Window import *
#class MyWindow(BlurWindow):
class MyWindow(CustomizedWindow):
def __init__(self):
super(MyWindow, self).__init__()
def MessageHandler(self, hwnd, message, wParam, lParam):
print(hwnd, message, wParam, lParam)
QApplication.setHighDpiScaleFactorRoundingPolicy(Qt.HighDpiScaleFactorRoundingPolicy.PassThrough)
QApplication.setAttribute(Qt.AA_EnableHighDpiScaling, True)
QApplication.setAttribute(Qt.AA_UseHighDpiPixmaps, True)
app = QApplication(sys.argv)
window = MyWindow()
list(map(window.setTitleTextColour, [QColor(0, 0, 139), QColor(119, 235, 255)], [1, 2], [1] * 2))
list(map(window.setMenuButtonColour, [QColor(0, 0, 139), QColor(119, 235, 255)], [1, 2], [1] * 2))
window.setWindowTitle('Window')
window.setDarkTheme(2)
window.setWindowIcon(QIcon('Icon.ico'))
splashscreen = window.splashScreen()
splashscreen.show()
window.resize(*window.getWindowSizeByClientSize([int(400 * window.dpi() / 96.0), int(175 * window.dpi() / 96.0)]))
button = QPushButton('Button', window.clientArea)
window.show()
splashscreen.finish(window)
app.exec_()
```
Raw data
{
"_id": null,
"home_page": "https://yuzhouren86.github.io",
"name": "PySide2-Customized-Window",
"maintainer": null,
"docs_url": null,
"requires_python": ">=2.6",
"maintainer_email": null,
"keywords": "Python GUI PySide",
"author": "YuZhouRen86",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/72/e5/385ad8ef1fa95909615593e64647e81b99029c33098635bd7ca5aed4b9ff/PySide2_Customized_Window-1.16.tar.gz",
"platform": null,
"description": "## PySide2-Customized-Window\n### \u7b80\u4ecb Introduction\n\u672cPython\u6a21\u5757\u662fPySideX-Customized-Window\u7684PySide2\u5206\u652f\uff0c\u5141\u8bb8\u7528\u6237\u521b\u5efa\u81ea\u5b9a\u4e49\u975e\u5ba2\u6237\u533a\u7a97\u53e3\uff0c\u975e\u5ba2\u6237\u533a\u4f7f\u7528PySide2\u7ed8\u5236\uff0c\u652f\u6301\u79fb\u52a8\u3001\u6700\u5c0f\u5316\u3001\u6700\u5927\u5316\u3001\u8d34\u8fb9\u81ea\u52a8\u5e03\u5c40\u3001\u80cc\u666f\u6a21\u7cca\u7b49\u529f\u80fd\u3002\u53ea\u652f\u6301Windows\u3001ReactOS\u3001Wine\u5e73\u53f0\u3002\n<br>\nThis Python module is the PySide2 branch of PySideX-Customized-Window, allows users to create windows with customized non-client area which are drawn with PySide2, support moving, minimizing, maximizing, auto-layout of borders, background blurring, etc. It only supports Windows, ReactOS and Wine.\n### \u5b89\u88c5\u547d\u4ee4 Installation command\n*`python -m pip install PySide2-Customized-Window`*\n### \u793a\u4f8b\u4ee3\u7801 Example code\n```\n# -*- coding: utf-8 -*-\nimport sys\nfrom PySide2.QtWidgets import *\nfrom PySide2.QtGui import *\nfrom PySide2.QtCore import *\nfrom PySide2_Customized_Window import *\n#class MyWindow(BlurWindow):\nclass MyWindow(CustomizedWindow):\n def __init__(self):\n super(MyWindow, self).__init__()\n def MessageHandler(self, hwnd, message, wParam, lParam):\n print(hwnd, message, wParam, lParam)\nQApplication.setHighDpiScaleFactorRoundingPolicy(Qt.HighDpiScaleFactorRoundingPolicy.PassThrough)\nQApplication.setAttribute(Qt.AA_EnableHighDpiScaling, True)\nQApplication.setAttribute(Qt.AA_UseHighDpiPixmaps, True)\napp = QApplication(sys.argv)\nwindow = MyWindow()\nlist(map(window.setTitleTextColour, [QColor(0, 0, 139), QColor(119, 235, 255)], [1, 2], [1] * 2))\nlist(map(window.setMenuButtonColour, [QColor(0, 0, 139), QColor(119, 235, 255)], [1, 2], [1] * 2))\nwindow.setWindowTitle('Window')\nwindow.setDarkTheme(2)\nwindow.setWindowIcon(QIcon('Icon.ico'))\nsplashscreen = window.splashScreen()\nsplashscreen.show()\nwindow.resize(*window.getWindowSizeByClientSize([int(400 * window.dpi() / 96.0), int(175 * window.dpi() / 96.0)]))\nbutton = QPushButton('Button', window.clientArea)\nwindow.show()\nsplashscreen.finish(window)\napp.exec_()\n```\n\n",
"bugtrack_url": null,
"license": null,
"summary": "A customized window based on PySide2.",
"version": "1.16",
"project_urls": {
"Homepage": "https://yuzhouren86.github.io"
},
"split_keywords": [
"python",
"gui",
"pyside"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "134f2d8dd0e311006113d68e88d2241f949975b5f98f55c92284284b5cfe46fb",
"md5": "93a8e22c4335bee6f9455a1de7dbd927",
"sha256": "dc62082b7c091c91669ffb446fddf8c0aceb6166aad18cfe5990f8b40c2e71c0"
},
"downloads": -1,
"filename": "PySide2_Customized_Window-1.16-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "93a8e22c4335bee6f9455a1de7dbd927",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=2.6",
"size": 14983,
"upload_time": "2024-06-22T11:00:58",
"upload_time_iso_8601": "2024-06-22T11:00:58.057324Z",
"url": "https://files.pythonhosted.org/packages/13/4f/2d8dd0e311006113d68e88d2241f949975b5f98f55c92284284b5cfe46fb/PySide2_Customized_Window-1.16-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "72e5385ad8ef1fa95909615593e64647e81b99029c33098635bd7ca5aed4b9ff",
"md5": "b476396efe12cabe3b5b4c5ae32bafac",
"sha256": "6fe310385ee16ed006ddec07fde949d03f582251cef258cd686ec27f1328eb63"
},
"downloads": -1,
"filename": "PySide2_Customized_Window-1.16.tar.gz",
"has_sig": false,
"md5_digest": "b476396efe12cabe3b5b4c5ae32bafac",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=2.6",
"size": 15233,
"upload_time": "2024-06-22T11:00:59",
"upload_time_iso_8601": "2024-06-22T11:00:59.955397Z",
"url": "https://files.pythonhosted.org/packages/72/e5/385ad8ef1fa95909615593e64647e81b99029c33098635bd7ca5aed4b9ff/PySide2_Customized_Window-1.16.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-06-22 11:00:59",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "pyside2-customized-window"
}