所用工具python3.6+pyqt5
1,点击一个按钮弹出一个界面的实现:
在init里面一定要设置一个常量,不然页面会出现一闪而过的现象:出现这种现象的原因是,self.another不是一个全局变量,只是一个局部变量,会随着函数的结束而结束!!
然后定义一个方法,就是如同main函数里面的一样,只不过把开头和结尾去掉!!!
(还要注意:第一个界面新建的时候可以用Mainwindow,但是第二个就不能用Mainwindow,可以用Weight)
2,修改界面角标:
这个是首页(Mainwindow)
MainWindow.setWindowIcon(QtGui.QIcon("Image/logo.png"))
MainWindow.setWindowTitle("SQL智能收集工具")
这个第二个弹出界面的角标,第二个界面新建的时候是Weight(Form)
Form.setWindowIcon(QtGui.QIcon('Image/logo.png'))
Form.setWindowTitle(_translate("Form", "收集工具"))