A customized window based on PySideX.
Project description
PySideX-Customized-Window
简介 Introduction
本Python模块是一个基于PySideX的界面模块,允许用户创建自定义非客户区窗口,非客户区使用PySideX绘制,支持移动、最小化、最大化、贴边自动布局、背景模糊等功能,分为3个版本:PySide1-Customized-Window、PySide2-Customized-Window、PySide6-Customized-Window,分别对应PySide1/PySide2/PySide6。只支持Windows、ReactOS、Wine平台。
This Python module is a PySideX-based interface module that allows users to create windows with customized non-client area, which are drawn using PySideX, support moving, minimizing, maximizing, auto-layout of borders, background blurring, etc. There are 3 branches: PySide1-Customized-Window, PySide2- Customized-Window, PySide6-Customized-Window, which correspond to PySide1/PySide2/PySide6 respectively. It only supports Windows, ReactOS and Wine.
安装命令 Installation command
python -m pip install PySide1-Customized-Window
python -m pip install PySide2-Customized-Window
python -m pip install PySide6-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(int(400.0 * window.dpi() / 96.0), int(175.0 * window.dpi() / 96.0)
button = QPushButton('Button', window.clientArea)
window.show()
splashscreen.finish(window)
app.exec_()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
File details
Details for the file PySide1_Customized_Window-1.9-py3-none-any.whl
.
File metadata
- Download URL: PySide1_Customized_Window-1.9-py3-none-any.whl
- Upload date:
- Size: 12.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38cbc3f132e879963f10425aaae24e52050fa664b86e691995043a98b2707cda |
|
MD5 | aaa0d2dfc6cd94d37c80c6402b82560d |
|
BLAKE2b-256 | 47f0a290eb50822cb8c5ccbb1be060a6a3edc2ddd2bddd9a21c61c4f56ce967a |
File details
Details for the file PySide1_Customized_Window-1.9-py2-none-any.whl
.
File metadata
- Download URL: PySide1_Customized_Window-1.9-py2-none-any.whl
- Upload date:
- Size: 12.6 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 12e5e07bfbe0eb15afa25ebc2d6f73d54d7f6c0f343627f13c2f9f890a13b2cb |
|
MD5 | 568c54cb620354f3622ed8eafe94448e |
|
BLAKE2b-256 | e2ee04b334abb2834aabec09cdd05c7479afc7a79a5e7a8a07c7b9cba58f5b6b |