本文整理汇总了Python中MainWindow.MainWindow.addNewDataView方法的典型用法代码示例。如果您正苦于以下问题:Python MainWindow.addNewDataView方法的具体用法?Python MainWindow.addNewDataView怎么用?Python MainWindow.addNewDataView使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MainWindow.MainWindow
的用法示例。
在下文中一共展示了MainWindow.addNewDataView方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: PyQtGuiController
# 需要导入模块: from MainWindow import MainWindow [as 别名]
# 或者: from MainWindow.MainWindow import addNewDataView [as 别名]
class PyQtGuiController(GuiControllerBase):
def __init__(self):
super(PyQtGuiController, self).__init__()
self.app = QtGui.QApplication(sys.argv)
self.win = MainWindow(self)
def getDirName(self, title, dir, filter):
temp = QtGui.QFileDialog.getExistingDirectory(self.win, title, dir)
return str(temp)
def getFileNames(self, title, dir, filter):
temp = QtGui.QFileDialog.getOpenFileNames(self.win, title, dir, filter)
fileNames = map(str, temp)
return fileNames
def getSaveName(self, title, dir, filter):
temp = QtGui.QFileDialog.getSaveFileName(self.win, title, dir, filter)
fileName = str(temp)
return fileName
def getInputName(self, window):
name, ok = QtGui.QInputDialog.getText(self.win, "Enter the name",
"Name:", QtGui.QLineEdit.Normal, window.getName())
return name, ok
def getInputPara(self, window, title, initial = 0.0):
data, ok = QtGui.QInputDialog.getDouble(self.win, "Enter the " + title.lower(),
title.capitalize() + ":", initial)
return data, ok
def showMessageOnStatusBar(self, text):
return self.win.showMessageOnStatusBar(text)
def getMessageOnStatusBar(self):
return self.win.getMessageOnStatusBar()
def addNewDataView(self, data):
return self.win.addNewDataView(data)
def startApplication(self):
self.win.show()
sys.exit(self.app.exec_())