# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'HelloWorld.ui'
#
# Created by: PyQt5 UI code generator 5.15.1
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again.  Do not edit this file unless you know what you are doing.
'''单个窗体文件，不带有槽函数和信号关联'''
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_PrintHello(object):
    '''
    1、PrintHello 是1个QMainWinsow(GUI框架)类 , 需要QWidget.QMainWindow实例化,外部程序传递
    2、centralwidget 是1个QWidget(窗体)类 , 需要传递QMainWindow参数,此参数在内部已经传递, QMainWindow可以有多个QWidget对象
    3、LabHello 、Start 是 1个QLabel(标签)对象 , 需要传递QWidget参数,此参数已经内部传递 , QWidget可以有多个QLabel对象
    4、close 是1个QPushButton(按钮)对象 , 需要传递QWidget参数,此参数已经内部传递 , QWidget可以有多个QPushButton对象
    5、继承关系为 QMainWindow类 -> QWidget类 -> QLabel、QPushButton等其它最低级的对象
    '''
    def setupUi(self, PrintHello):
        PrintHello.setObjectName("PrintHello")
        PrintHello.resize(1000, 800) # 这里可以内部传递,也可以外部传递
        PrintHello.setWindowTitle("Hello World!")  # 这里设置窗体的标题不起作用,只能外部程序传递
        PrintHello.setToolButtonStyle(QtCore.Qt.ToolButtonTextUnderIcon)
        self.centralwidget = QtWidgets.QWidget(PrintHello) #QWidget类包含于QMainWindow类
        self.centralwidget.setObjectName("centralwidget")
        self.LabHello = QtWidgets.QLabel(self.centralwidget)#创建名为LabHello的标签对象
        self.LabHello.setEnabled(True)
        '''到上边左边距离均是100，为了对称可以让本身的长度800，宽度600 ，即到右边下边距离也是100'''
        self.LabHello.setGeometry(QtCore.QRect(100, 100, 800, 600)) #到左边上边的距离,本身的长度和宽度
        self.LabHello.setFrameShape(QtWidgets.QFrame.Panel)
        self.LabHello.setLineWidth(2)
        self.LabHello.setTextFormat(QtCore.Qt.AutoText)
        self.LabHello.setScaledContents(False)
        self.LabHello.setObjectName("LabHello")
        self.close = QtWidgets.QPushButton(self.centralwidget) # 名为close的按钮对象
        '''右对齐,到下边距离100,又因为自身高度100,实际上上沿到上边距离应为600;自身宽度200,到右边要求100,实际上d到左边应为700'''
        self.close.setGeometry(QtCore.QRect(700, 600, 200, 100))
        self.close.setAutoDefault(False)
        self.close.setDefault(True)
        self.close.setFlat(False)
        self.close.setObjectName("close")
        self.Start = QtWidgets.QLabel(self.centralwidget) # 名为start的标签对象
        '''左对齐(100),下方100,自身高度150,则到上沿距离应为(1000-250),这里多提高了150'''
        self.Start.setGeometry(QtCore.QRect(100, 600, 400, 150))
        self.Start.setObjectName("Start")
        PrintHello.setCentralWidget(self.centralwidget)
        self.menubar = QtWidgets.QMenuBar(PrintHello)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 21))
        self.menubar.setObjectName("menubar")
        PrintHello.setMenuBar(self.menubar)
        self.statusbar = QtWidgets.QStatusBar(PrintHello)
        self.statusbar.setObjectName("statusbar")
        PrintHello.setStatusBar(self.statusbar)

        self.retranslateUi(PrintHello)
        QtCore.QMetaObject.connectSlotsByName(PrintHello)

    def retranslateUi(self, PrintHello):
        _translate = QtCore.QCoreApplication.translate
        PrintHello.setWindowTitle(_translate("PrintHello", "MainWindow"))
        self.LabHello.setText(_translate("PrintHello", "<html><head/><body><p align=\"center\"><span style=\" font-size:18pt; font-weight:600; color:#5555ff;\">Hello World!</span></p></body></html>"))
        self.close.setText(_translate("PrintHello", "打开网址"))
        self.Start.setText(_translate("PrintHello", "<html><head/><body><p><a href=\"https://github.com/maicss/PyQt5-Chinese-tutorial\"><span style=\" font-size:14pt; font-weight:600; text-decoration: underline; color:#55aaff;\">A great start.</span></a></p></body></html>"))
