qt相当不错了,视图分离的模式非常棒.文档清晰,实例丰富.跨平台
你还要要求多少呢
import sys
from PyQt5 import QtGui
from PyQt5.QtCore import pyqtSlot
from PyQt5.QtWidgets import QApplication, QWidget,QMainWindow,QStyleFactory
from PyQt5.uic import loadUi
class MainApp(QMainWindow):
def __init__(self, *args):
super(MainApp, self).__init__(*args)
loadUi('ui/main.ui', self)
self.mainPanel.clear()
self.panels = {}
@
pyqtSlot()
def on_optionAction_clicked(self):
if self.mainPanel.count() >= 4:
self.mainPanel.removeTab(0)
idx = self.mainPanel.addTab(loadUi("ui/options.ui"),u"参数管理")
@
pyqtSlot(int)
def on_mainPanel_tabCloseRequested(self,idx):
view = self.mainPanel.widget(idx)
view.deleteLater()
self.mainPanel.removeTab(idx)
app = QApplication(sys.argv)
widget = MainApp()
widget.show()
sys.exit(app.exec_())