Setup-GUI.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:Red-GUI 作者: ScarletRav3n 项目源码 文件源码
def init_ui(self):

        # v.box
        gbox = QtWidgets.QGridLayout()
        box = QtWidgets.QVBoxLayout()
        self.rbox = QtWidgets.QVBoxLayout()
        self.hbox = QtWidgets.QHBoxLayout()

        # padding/margins
        gbox.setContentsMargins(0, 0, 0, 0)
        self.rbox.setContentsMargins(0, 0, 10, 10)
        self.hbox.setContentsMargins(0, 0, 10, 10)
        box.addStretch()
        self.hbox.addStretch()
        gbox.setSpacing(10)
        box.setSpacing(0)
        self.rbox.setSpacing(5)
        self.hbox.setSpacing(0)

        image = QtGui.QImage()
        image.loadFromData(urllib.request.urlopen('http://i.imgur.com/04DUqa3.png').read())
        png = QLabel(self)
        pixmap = QtGui.QPixmap(image)
        png.setPixmap(pixmap)
        gbox.addWidget(png, 0, 0, 1, 1, Qt.AlignTop)

        box.insertSpacing(1, 10)
        self.l1 = QLabel(self)
        self.l1.setWordWrap(True)
        self.large_font.setBold(True)
        self.l1.setFont(self.large_font)
        box.addWidget(self.l1, 0, Qt.AlignTop)

        hline = QtWidgets.QFrame()
        hline.setFrameShape(QtWidgets.QFrame.HLine)
        hline.setFrameShadow(QtWidgets.QFrame.Sunken)
        gbox.addWidget(hline, 0, 0, 1, 3, Qt.AlignBottom)

        # start form
        self.req_ui()

        self.rbox.setAlignment(Qt.AlignTop)
        box.addLayout(self.rbox, 1)
        gbox.addLayout(box, 0, 1, 1, 2)
        gbox.addLayout(self.hbox, 1, 0, 1, 3)
        self.setLayout(gbox)

        # window
        self.setFixedSize(490, 400)
        self.setWindowIcon(QtGui.QIcon('red.ico'))
        self.setWindowTitle('Red Discord Bot - Setup')
        self.show()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号