本文整理汇总了Python中MainWindow.MainWindow类的典型用法代码示例。如果您正苦于以下问题:Python MainWindow类的具体用法?Python MainWindow怎么用?Python MainWindow使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MainWindow类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: controller
class controller():
def __init__(self):
self.initUI()
def initUI(self):
self.mw=MainWindow(self)
self.mw.show()
self.add_Filtermethods()
#self.need_Param()
def need_Param(self,a="HP",b="Chebychev 1",c="man"):
if a=="HP" and b=="Chebychev 1":
b="cheby1"
return self.filter.get(b).needHP()
else:
return "noch nicht implementiert"
def add_Filtermethods(self):
self.filter={}
fobj=open("init.txt","r")
for line in fobj:
line=line.strip()
#a= eval(line)
a=getattr(sys.modules[__name__], line)()
self.filter.update({line:a})
fobj.close
示例2: PyQtGuiController
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 getReloadDataIndex(self):
if self.dataModel.getCount() == 0:
self.showErrorMessage('Error', 'There\'re no enough data!')
return
names = self.dataModel.getNameDict()
return self.getDataIndex(names, "Select the data to be reloaded")
def getDataIndex(self, names, word):
items = names.keys()
item, ok = QtGui.QInputDialog.getItem(self.win, word, "Data:", items, 0, False)
if ok and item:
item = str(item)
index = int(names[item])
del names[item]
return index
def getRegisterDataIndex(self):
if self.dataModel.getCount() < 2:
self.showErrorMessage('Error', 'There\'re no enough data!')
return
names = self.dataModel.getNameDict()
fixedIndex = self.getDataIndex(names, "Select the fixed image")
if fixedIndex is not None:
movingIndex = self.getDataIndex(names, "Select the moving image")
if movingIndex is not None:
return (fixedIndex, movingIndex)
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 showErrorMessage(self, title, message):
QtGui.QMessageBox.information(self.win, title, message)
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_())
示例3: on_promisCheckBox_stateChanged
def on_promisCheckBox_stateChanged(self, p0):
MainWindow.on_promisCheckBox_stateChanged(self, p0)
# print "check int:%d"%p0
if(self.promisCheckBox.isChecked()):
self.capturer.set_promisc(True)
else:
self.capturer.set_promisc(False)
示例4: main
def main():
global app
global mainWindow
app = QApplication(sys.argv)
mainWindow = MainWindow()
mainWindow.show()
sys.exit(app.exec_())
示例5: _Run
def _Run(argv):
from CDUtilsPack.MetaUtils import UserException
from PackUtils.CoreBaseException import CoreBaseException
from SectionFactory import CreateSectionsByCfg
from MainWindow import MainWindow
try:
appLoop = QtGui.QApplication(argv) # for Qt widgets using
imgs = _ImageLoader(dir = 'Images')
sett = _CmdLineParser(argv)
absFileName = os.path.join(os.getcwd(), sett['cfg'])
del sett['cfg']
sectionDict = CreateSectionsByCfg(absFileName, imgs)
app = MainWindow(sectionDict, imgs)
app.show()
appLoop.exec()
except UserException as e:
print ("Aborted!\nStart-up error:", e)
except CoreBaseException as e:
print("Aborted!\n{0}: {1}".format(type(e).__name__, e))
示例6: run
def run():
# PySide fix: Check if QApplication already exists. Create QApplication if it doesn't exist
app = QtGui.QApplication.instance()
if not app:
app = QtGui.QApplication(sys.argv)
window = MainWindow()
window.show()
app.exec_()
示例7: on_stopButton_clicked
def on_stopButton_clicked(self):
MainWindow.on_stopButton_clicked(self)
if self.cap_thread != None and self.cap_thread.is_alive():
self.capturer.stop_capture()
self.cap_thread.join()
if self.ana_thread != None and self.ana_thread.is_alive():
self.analyzer.stop_analize()
self.ana_thread.join()
示例8: main
def main(argv):
app = QApplication(sys.argv)
# Constructing gui...
mainWindow = MainWindow()
mainWindow.show()
# Start event processing...
app.exec_()
示例9: PVDataTools
class PVDataTools(QtGui.QApplication):
def __init__(self, sys_argv):
super().__init__(sys_argv)
self.model = Model()
self.main_window = MainWindow(self.model)
self.main_window.show()
self.main_window.new_dataviewer()
示例10: main
def main():
import sys
app = QApplication(sys.argv)
screen = MainWindow()
screen.show()
sys.exit(app.exec_())
示例11: main
def main():
config = ConfigParser.SafeConfigParser(allow_no_value=True)
internalConfig = ConfigParser.SafeConfigParser(allow_no_value=True)
config.read("config.ini")
internalConfig.read("internal-config.ini")
w = MainWindow(config, internalConfig)
w.show()
return app.exec_()
示例12: App
class App(QApplication):
def __init__(self, argv):
super(App, self).__init__(argv)
self.mainwindow = MainWindow()
def exec_(self, *args, **kwargs):
self.mainwindow.show()
super(App, self).exec_()
示例13: main
def main():
app = QtGui.QApplication(sys.argv)
guiDelegate = delegate.GuiDelegate()
window = MainWindow(guiDelegate=guiDelegate)
guiDelegate.set_main_window(window)
window.show()
excode = app.exec_()
guiDelegate.exit()
sys.exit(excode)
示例14: on_startButton_clicked
def on_startButton_clicked(self):
MainWindow.on_startButton_clicked(self)
if self.capturer.adhandle == None:
curindex = self.devComboBox.currentIndex()
if not self.capturer.open_dev(curindex):
# TODO: handle open error
return
self.cap_thread = threading.Thread(target=self.capturer.start_capture)
self.cap_thread.start()
self.ana_thread = threading.Thread(target=self.analyzer.start_analize)
self.ana_thread.start()
示例15: main
def main(args):
mainApp=QtGui.QApplication(args)
fenetre=QWidget()
label1 = QLabel("Bienvenue")
MainWindow2=MainWindow()
MainWindow2.show()
r=mainApp.exec_()
return r