def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) self.ui = Ui_Dialog() self.ui.setupUi(self) palette2 = QtGui.QPalette() palette2.setBrush(self.backgroundRole(), QBrush(QImage("./pics/genback.png"))) icon = QtGui.QIcon() b = QtGui.QPixmap("./pics/logo.png") icon.addPixmap(b) self.setWindowIcon(icon) self.setPalette(palette2) self.setStyleSheet('color: rgb(85, 0, 0);') self.ui.close.setStyleSheet('background-color: rgb(0, 147, 203); color: rgb(255, 255, 255);') b = QtGui.QPixmap("./pics/acadmin.png") self.ui.acadmin.setPixmap(QtGui.QPixmap(b)) b = QtGui.QPixmap("./pics/shaastra.png") self.ui.shaastra.setPixmap(QtGui.QPixmap(b)) QtCore.QObject.connect(self.ui.close, QtCore.SIGNAL("clicked()"), self.close)
def about(self): widget = QDialog() ui = Ui_Dialog() ui.setupUi(widget) widget.setFixedSize(400, 78) widget.setWindowTitle('О программе') widget.setWindowIcon(QIcon('icon.jpg')) widget.exec_()
def on_action_triggered(self): a = Ui_Dialog() d = QDialog() a.setupUi(d) d.exec()
def __init__(self): super(SecondWindow, self).__init__() self.ui = Ui_Dialog() self.ui.setupUi(self)
def thisProject(self): print "In thisProject" self.adminWindow1 = QtGui.QDialog() self.ui = Ui_Dialog() self.ui.setupUi(self.adminWindow1) self.adminWindow1.show()
def __init__(self): super(AboutDialog, self).__init__() self.ui = Ui_Dialog() self.ui.setupUi(self) self.setWindowTitle("关于")
def show_about_widget(self): self.ui_about = Ui_Dialog() self.about_win = QDialog() self.ui_about.setupUi(self.about_win) self.about_win.setWindowTitle('关于我们') self.about_win.show()
def openAbout(self): self.aboutWindow = QtWidgets.QDialog() self.ui = Ui_Dialog() self.ui.setupUi(self.aboutWindow) self.aboutWindow.show()