如下所示:
成都創(chuàng)新互聯(lián)主營甘南網(wǎng)站建設(shè)的網(wǎng)絡(luò)公司,主營網(wǎng)站建設(shè)方案,成都App制作,甘南h5微信小程序定制開發(fā)搭建,甘南網(wǎng)站營銷推廣歡迎甘南等地區(qū)企業(yè)咨詢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_())