box_layout.py 文件源码

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

项目:VIRTUAL-PHONE 作者: SumanKanrar-IEM 项目源码 文件源码
def window():
    app = QtWidgets.QApplication(sys.argv)
    w = QtWidgets.QWidget()
    b = QtWidgets.QPushButton('Push Me')
    l = QtWidgets.QLabel('Look at me')

    h_box = QtWidgets.QHBoxLayout()
    h_box.addStretch()
    h_box.addWidget(l)
    h_box.addStretch()

    v_box = QtWidgets.QVBoxLayout()
    v_box.addWidget(b)
    v_box.addLayout(h_box)

    w.setLayout(v_box)

    w.setWindowTitle('PyQt5 Lesson 4')
    w.show()

    sys.exit(app.exec_())
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号