QFontDialog的继承图:

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

QFontDialog的描述:

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

 

QFontDialog的继承:

它是继承自它的父类  QDialog 的 

QFontDialog的功能作用:

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

第一种构造方法:

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

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


    def set_ui(self):
        fontDialog = QFontDialog(self)
        self.fontDialog = fontDialog

        self.test()
        # fontDialog.show()
        # fontDialog.open()
        # fontDialog.exec()
    
    def test(self):
        btn = QPushButton(self)
        btn.setText("按钮")
        btn.move(0,300)
        btn.clicked.connect(lambda :self.fontDialog.open())

        



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
猜你喜欢
  • 2021-04-02
  • 2021-10-18
  • 2021-06-15
  • 2021-12-05
  • 2021-06-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案