QDialog
QDialog:对话框一般不作为主窗口,而是作为弹窗通过点击操作弹出,起到提示效果
# -*- coding = utf-8 -*- # @Time : 2022/9/6 10:07 # @Author : Arthur # @FileName : 窗口分类之QDialog.py # @Software : Pycharm import sys from PyQt5.QtWidgets import QApplication, QDialog, QPushButton class my_window(QDialog): def __init__(self): super(my_window, self).__init__() self.init_ui() def init_ui(self): self.setWindowTitle('对话框') btn = QPushButton('确定', self) btn.setGeometry(100, 100, 100, 30) if __name__ == '__main__': app = QApplication(sys.argv) w = my_window() w.show() app.exec_()
原创文章,作者:朋远方,如若转载,请注明出处:https://caovan.com/pyqt5changyongcaozuozhichuangkoufenlei/.html