如下所示:
成都创新互联主营甘南网站建设的网络公司,主营网站建设方案,成都App制作,甘南h5微信小程序定制开发搭建,甘南网站营销推广欢迎甘南等地区企业咨询from PyQt4 import QtGui,QtCore import sys class Web_Browser(QtGui.QDialog): def __init__(self,parent=None): QtGui.QWidget.__init__(self) self.resize(550,400) open=QtGui.QPushButton('OPEN') self.connect(open,QtCore.SIGNAL('clicked()'),self.ok) grid=QtGui.QGridLayout() grid.addWidget(open,1,0,1,1) self.setLayout(grid) self.setWindowTitle('main windows') def ok(self): web=Web_Browser() web.setModal(False) web.setWindowTitle('sub window') web.exec_() app=QtGui.QApplication(sys.argv) app.setFont(QtGui.QFont("Helvetica", 16)) main=Web_Browser() main.show() sys.exit(app.exec_())