工控上位机控制系统通用UI框架
This commit is contained in:
38
wndMain/pageDataQuery/sub_uiQuery.py
Normal file
38
wndMain/pageDataQuery/sub_uiQuery.py
Normal file
@ -0,0 +1,38 @@
|
||||
# 数据查询内嵌页面子类
|
||||
from PySide6.QtWidgets import QWidget
|
||||
from PySide6.QtCore import Qt
|
||||
from wndMain.pageDataQuery.uiSub_Query import Ui_pageDataQuery
|
||||
|
||||
|
||||
class CSubPageQuery(QWidget):
|
||||
# public:
|
||||
def __init__(self, widgetSize: tuple[int, int], parent=None):
|
||||
super().__init__(parent)
|
||||
self.ui = Ui_pageDataQuery()
|
||||
self.ui.setupUi(self)
|
||||
# 按需声明对应的成员变量
|
||||
self.szStack = widgetSize
|
||||
pass
|
||||
|
||||
# 界面初始化
|
||||
def uiInit(self) -> None:
|
||||
self._screenAdapter() # 界面自适应
|
||||
self._changeWndStyle() # 设置成无框架边框
|
||||
self._centerWidget() # 居中显示
|
||||
pass
|
||||
|
||||
# ----------------------------------------
|
||||
# private:
|
||||
# 界面自适应
|
||||
def _screenAdapter(self) -> None:
|
||||
self.resize(self.szStack[0], self.szStack[1])
|
||||
pass
|
||||
|
||||
# 修改窗体属性
|
||||
def _changeWndStyle(self) -> None:
|
||||
self.setWindowFlags(Qt.WindowType.FramelessWindowHint)
|
||||
pass
|
||||
|
||||
# 窗口居中显示
|
||||
def _centerWidget(self) -> None:
|
||||
pass
|
||||
34
wndMain/pageDataQuery/uiSub_Query.py
Normal file
34
wndMain/pageDataQuery/uiSub_Query.py
Normal file
@ -0,0 +1,34 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
################################################################################
|
||||
## Form generated from reading UI file 'uiSub_Query.ui'
|
||||
##
|
||||
## Created by: Qt User Interface Compiler version 6.9.3
|
||||
##
|
||||
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||
################################################################################
|
||||
|
||||
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
|
||||
QMetaObject, QObject, QPoint, QRect,
|
||||
QSize, QTime, QUrl, Qt)
|
||||
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
|
||||
QFont, QFontDatabase, QGradient, QIcon,
|
||||
QImage, QKeySequence, QLinearGradient, QPainter,
|
||||
QPalette, QPixmap, QRadialGradient, QTransform)
|
||||
from PySide6.QtWidgets import (QApplication, QSizePolicy, QWidget)
|
||||
|
||||
class Ui_pageDataQuery(object):
|
||||
def setupUi(self, pageDataQuery):
|
||||
if not pageDataQuery.objectName():
|
||||
pageDataQuery.setObjectName(u"pageDataQuery")
|
||||
pageDataQuery.resize(758, 516)
|
||||
|
||||
self.retranslateUi(pageDataQuery)
|
||||
|
||||
QMetaObject.connectSlotsByName(pageDataQuery)
|
||||
# setupUi
|
||||
|
||||
def retranslateUi(self, pageDataQuery):
|
||||
pageDataQuery.setWindowTitle(QCoreApplication.translate("pageDataQuery", u"Form", None))
|
||||
# retranslateUi
|
||||
|
||||
Reference in New Issue
Block a user