QLabel 的继承图:

PyQt5 控件学习(一个一个学习之QLabel)

 

QLabel 的描述:

PyQt5 控件学习(一个一个学习之QLabel)

它能少与用户交互的!主要是用来交互的!

 

QLabel 的继承:

它继承自QFrame  

QLabel 的功能作用:

QLabel 的功能作用之构造函数:

from PyQt5.Qt import * #刚开始学习可以这样一下导入
import sys

class Window(QWidget):
    def __init__(self):
        super().__init__()
        self.setWindowTitle("QLabel的学习")
        self.resize(400,400)
        self.set_ui()


    def set_ui(self):
        label = QLabel("hello world",self)
        label.move(100,100)
        label.adjustSize()
        label.setStyleSheet("background-color:cyan;")


if __name__ == '__main__':
    app =QApplication(sys.argv)

    window = Window()
    window.show()

    sys.exit(app.exec_())
View Code

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-04-02
  • 2021-10-18
  • 2021-06-15
  • 2021-12-05
  • 2021-06-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案