def __init__(self, parent=None): QMainWindow.__init__(self, parent) self.setWindowFlags(Qt.Window) self._mdi_area = QMdiArea() self._mdi_area.setHorizontalScrollBarPolicy(Qt.ScrollBarAsNeeded) self._mdi_area.setVerticalScrollBarPolicy(Qt.ScrollBarAsNeeded) self.setCentralWidget(self._mdi_area) # set the size of mid_area and DocumentViewManager based on the # screen size. screen = QDesktopWidget().availableGeometry() self._mdi_area.resize(screen.width() - 30, screen.height() - 80) self.resize(self._mdi_area.size()) self._mdi_area.subWindowActivated.connect(self.update_actions) self._viewer_mapper = QSignalMapper(self) self._viewer_mapper.mapped[QWidget].connect(self.set_active_sub_window) win_title = QApplication.translate("DocumentViewManager", "Document Viewer") self.setWindowTitle(win_title) self.setUnifiedTitleAndToolBarOnMac(True) self.statusBar().showMessage( QApplication.translate("DocumentViewManager", "Ready")) self._doc_viewers = {} self._create_menu_actions() self.update_actions()
def __init__(self): QMainWindow.__init__(self) self.setupUi(self) # self.connect(self.xTargetSlider, # SIGNAL("valueChanged(int)"), # self.xTargetChanged) self.connect(self.xValueSlider, SIGNAL("valueChanged(int)"), self.xValueChanged) self.connect(self.yTargetSlider, SIGNAL("valueChanged(int)"), self.yTargetChanged) self.connect(self.yValueSlider, SIGNAL("valueChanged(int)"), self.yValueChanged) self.timer = QTimer() self.timer.start(100) self.connect(self.timer, SIGNAL("timeout()"), self.roscb) # self.wobbler = move_head.Wobbler() self.valuex_publisher = rospy.Publisher("/eyeGaze/valuex/command", Int32, queue_size=10) self.targetx_publisher = rospy.Publisher("/eyeGaze/targetx/command", Int32, queue_size=10) self.valuey_publisher = rospy.Publisher("/eyeGaze/valuey/command", Int32, queue_size=10) self.targety_publisher = rospy.Publisher("/eyeGaze/targety/command", Int32, queue_size=10)
def __init__(self, parent): QMainWindow.__init__(self, parent) self.ui = Ui_TestsWindow() self.ui.setupUi(self) self.projects = {} self.changed = True self.algs = "acdrf"
def __init__(self): QMainWindow.__init__(self) self.ui = Ui_DemandGraphEditor() self.ui.setupUi(self) self.canvas = DemandGraphCanvas(self.ui.graphArea) self.ui.graphArea.setWidget(self.canvas) self.basename = self.windowTitle()
def __init__(self, parent=None): QMainWindow.__init__(self, parent) self.setWindowTitle('LCM Plotter') self.createMenu() self.createMainFrame() # Each channel has data and axis associated with it. # Dictionary key is the channel name and property. self.data = {} self.axes = {} self.lastPlot = None # Stop the program if CTRL-C is received self._stopEvent = threading.Event() signal.signal(signal.SIGINT, self.handleSigint) self._lcm = lcm.LCM() self.handlerThread = threading.Thread(target=self.pollLcm) self.handlerThread.setDaemon(True) self.handlerThread.start() self.connect(self, SIGNAL('redraw()'), self.on_draw) # Create redraw signal self.drawingThread = threading.Thread(target=self.drawLoop) self.drawingThread.setDaemon(True) self.drawingThread.start()
def __init__(self, doc): QMainWindow.__init__(self, None) self.doc = doc self.app = doc.app self._setupUi() # Create base elements self.model = MainWindowModel(document=doc.model) self.model2view = {} self.apanel = AccountPanel(mainwindow=self) self.tpanel = TransactionPanel(mainwindow=self) self.mepanel = MassEditionPanel(mainwindow=self) self.scpanel = SchedulePanel(mainwindow=self) self.bpanel = BudgetPanel(mainwindow=self) self.cdrpanel = CustomDateRangePanel(mainwindow=self) self.arpanel = AccountReassignPanel(mainwindow=self) self.expanel = ExportPanel(mainwindow=self) self.alookup = Lookup(self, model=self.model.account_lookup) self.clookup = Lookup(self, model=self.model.completion_lookup) self.drsel = DateRangeSelector(mainwindow=self, view=self.dateRangeSelectorView) self.sfield = SearchField(model=self.model.search_field, view=self.searchLineEdit) self.recentDocuments = Recent(self.app, 'recentDocuments') self.recentDocuments.addMenu(self.menuOpenRecent) self.model.view = self self.model.connect() self._updateUndoActions() self._bindSignals()
def __init__(self): QMainWindow.__init__(self) Ui_MainWindow.__init__(self) self._version = 0.1 # user interface configuration. self.setupUi(self) # Hide some stuff self.pushButton_moreOptions.setChecked(True) # Loads Bible self.BibleLoader = BibleLoader("BP05FNL") # Signal / Slots connections self.comboBox_book.currentIndexChanged.connect(self.populatesChapter) self.comboBox_chapter.currentIndexChanged.connect(self.populatesVerseFrom) self.comboBox_verseFrom.currentIndexChanged.connect(self.populatesVerseTo) self.pushButton_Start.clicked.connect(self.startGame) # Initalisation self.populatesBook() self.populatesVersion() self.setWindowTitle("Lexilogos") # Display self.show() self.dockWidget_settings.setMaximumWidth( self.dockWidget_settings.width())
def __init__(self): QMainWindow.__init__(self) uic.loadUi('PKMInterface.ui', self) self.setWindowTitle('PKMapp') self.setWindowIcon(QtGui.QIcon('my_icon.png')) self.lastWidth = self.width() self.lastHeight = self.height() self.timeLapse = None launchTime = time.time() try: self.kom = trainCommunicator.TrainCommunicator() self.kom.connect('192.168.0.200', 5550) print "Trains connected." except: print "Can't connect to trains" self.controller = BusControl(self) self.switchTable.setRowCount(0) self.reloadSwitchersTable() launchTime = time.time() - launchTime print "Launching time: ", launchTime, "s." #------------------map widget------------ self.rk = PKMMap.Map(self.controller, self.kom) self.rk.scaleObr = 0.5 self.rk.plus() self.scrollArea.setWidget(self.rk) self.scrollArea.setBackgroundRole(QPalette.Dark) self.scrollArea.setWidgetResizable(True) self.rk.setFocus() #=============================================== #dołączanie funkcji do przycisków self.trainSpeedButton.clicked.connect(self.trainButton) self.haltAllButton.clicked.connect(self.stopAll) self.backButton.clicked.connect(lambda: self.controlTrain("tyl")) self.haltButton.clicked.connect(lambda: self.controlTrain("stop")) self.forwardButton.clicked.connect(lambda: self.controlTrain("przod")) self.biggerButton.clicked.connect(self.biggerScreen) self.smallerButton.clicked.connect(self.smallerScreen) #inicjalizacja comboBox'ów trainNumbers = ['1', '2', '3', '6'] self.trainNoCombo.clear() self.trainNoCombo.addItems(trainNumbers) self.trainNoCombo.setCurrentIndex(0) self.resizeEvent = ( lambda old_method: (lambda event: (self._on_resized(event), old_method(event))[-1]))( self.resizeEvent) self.switchTable.resizeColumnsToContents() #Odbieranie sygnału przerwania z balisy if self.controller.terminale: QObject.connect(self.controller.terminale, SIGNAL("balisa_int"), self.balisaInterrupt) pass
def __init__(self, amz_files, parent=None): QMainWindow.__init__(self, parent) self.setupUi(self) loadFileIcon = QIcon.fromTheme('document-new', QIcon(QPixmap(load_icon_path))) downloadIcon = QIcon.fromTheme('go-down', QIcon(QPixmap(download_icon_path))) settingsIcon = QIcon.fromTheme('preferences-other', QIcon(QPixmap(settings_icon_path))) showIcon = QIcon.fromTheme('emblem-downloads', QIcon(QPixmap(show_icon_path))) exitIcon = QIcon.fromTheme('window-close', QIcon(QPixmap(exit_icon_path))) self.pythonPixmap = QPixmap(python_icon_path) self.pymazon_text = self.nowDownloadingLabel.text() self.actionLoadFiles.setIcon(loadFileIcon) self.actionDownload.setIcon(downloadIcon) self.actionSettings.setIcon(settingsIcon) self.actionShowDownloads.setIcon(showIcon) self.actionQuit.setIcon(exitIcon) self.albumArtLabel.setPixmap(self.pythonPixmap) self.settingsDialog = SettingsDialog(self) self.tree_model = None self.pbardelegate = ProgressBarDelegate() self.treeView.setItemDelegateForColumn(1, self.pbardelegate) self.downloader = None self.current_album = None self.old_albums = [] self.updateInfo.connect(self.update_album_info) self.resetInfo.connect(self.reset_displaybar_info) if amz_files: self.load_new_amz_files(amz_files)
def __init__(self, argc, argv, parent=None): """ Constructor """ QMainWindow.__init__(self, parent) self.setupUi(self) self.arxml = '' self.cfg = GaInOsCfg() #curtree 对应Gui树目录控件中被选中项 self.curtree = None #curobj则和curtree相互协调一致,但curobj是GaInOS的一个对象, #可能为Task、Event、Alarm或者Resource self.curobj = None if (argc == 3 and argv[1] == "--eclipse"): #与eclipse集成 dir = self.getProject(argv[2]) if (dir != argv[2] + '/'): self.getCfgArxml(dir) LoadArxml(self.cfg, self.arxml) else: QMessageBox( QMessageBox.Information, 'GaInOS Info', 'Cann\'t locate a ture exist OSEK(uTenux) Project,you can load/new arxml by hand!' ).exec_() self.arxml = argv[2] + '/' #sys.exit(-1); elif (argc == 3 and argv[1] == "--arxml"): #直接加载arxml self.arxml = argv[2] LoadArxml(self.cfg, self.arxml) self.initGui()
def __init__(self,debug=False,parent=None): QMainWindow.__init__(self,parent) self.w=Ui_Login() self.setupUi(self) self.Box_DB.addItem("mysql", userData=QtCore.QVariant("mysql")) self.Box_DB.addItem("postgresql", userData=QtCore.QVariant("postgresql")) self.Box_DB.activated[str].connect(self.onActivated) self.qs=QtCore.QSettings("metmi", "MMASGIS") loginPreset=self.qs.value("loginPresettings",-1).toPyObject() self.check_conn.setCheckState(2) if loginPreset!=-1: self.text_pass.setText(loginPreset.getPassword()) self.text_user.setText(loginPreset.getUser()) self.text_porta.setText(loginPreset.getPorta()) print "host",loginPreset.getHost() self.text_host.setText(loginPreset.getHost()) print "presetted rdbms",loginPreset.getFamilyDb() print " index incombo",self.Box_DB.findText(loginPreset.getFamilyDb()) self.Box_DB.setCurrentIndex(self.Box_DB.findText(loginPreset.getFamilyDb())) else: print "no loginPresettings found" self.porta={} self.porta['mysql']=str(3306) self.porta["postgresql"]=str(5432) self.text_porta.setText(self.porta[str(self.Box_DB.currentText())]) self.ds=None
def __init__(self, parent=None, working_dir='', data_dict=None): display( HTML( '<span style="font-size: 20px; color:blue">Check UI that poped up \ (maybe hidden behind this browser!)</span>')) QMainWindow.__init__(self, parent=parent) self.ui = UiMainWindow() self.ui.setupUi(self) self.setWindowTitle("Calibrated Transmission") self.working_dir = working_dir self.data_dict = data_dict # Normalization data dictionary {'file_name': [], #'data': [[...],[...]]], #'metadata': [], #'shape': {}} # untouched array of images (used to move and rotate images) self.data_dict_raw = copy.deepcopy(data_dict) # initialization self.init_timestamp_dict() self.init_table() self.init_parameters() self.init_widgets() self.init_pyqtgrpah() self.init_statusbar() # display first image self.slider_file_changed(-1) self.ui.tableWidget.cellChanged['int', 'int'].connect(self.cell_changed)
def __init__(self, parent): QMainWindow.__init__(self, parent) font = self.font() font.setPointSize(14) self.setFont(font) self.log = Log(True, "logTest.log") self.initUI()
def __init__(self, parent = None): QMainWindow.__init__(self, parent) self.setupUi(self) self.setWindowFlags(self.windowFlags() | QtCore.Qt.WindowStaysOnTopHint) #self.addContextMenu() self.stdout_ = sys.stdout #sys.stdout = self self.flagRun = True self.staticKeyDict = { 999 : "wiseMin" } self.loadItems() self.loadScripts() self.pool = ThreadPool(6) self.keyDict = {} self.loadKey(self.keyTxt) self.autoRegKey() self.txt.appendPlainText("123") self.txt.appendPlainText("123456")
def __init__(self, application=None, title="VISPA"): #logging.debug(__name__ + ": __init__") self._justActivated = False self._startupScreen = None self._application = application QMainWindow.__init__(self) self._tabWidget = QTabWidget(self) self._tabWidget.setSizePolicy( QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)) self._tabWidget.setUsesScrollButtons(True) self.setCentralWidget(self._tabWidget) if hasattr(self._tabWidget, "setTabsClosable"): self._tabWidget.setTabsClosable(True) if "vispa" in title.lower(): self.createStartupScreen() self._fileMenu = self.menuBar().addMenu("&File") self._editMenu = self.menuBar().addMenu("&Edit") self._helpMenu = self.menuBar().addMenu("&Help") self._fileToolBar = self.addToolBar("File") self.ensurePolished() self.setWindowIcon(QIcon(":/resources/vispabutton.png")) self.setWindowTitle(title) self.statusBar() self._loadIni() if self._startupScreen: self._startupScreen.raise_() self.updateStartupScreenGeometry()
def __init__(self,tree,parent=None): self.tree=tree QMainWindow.__init__(self,parent) #self.w=Ui_ProgressBar() self.setupUi(self) #QMainWindow.__init__(self,parent) self.w=Ui_CercaGeo()
def __init__(self, parent=None, working_dir='', data_dict=None): display( HTML( '<span style="font-size: 20px; color:blue">Check UI that poped up \ (maybe hidden behind this browser!)</span>')) QMainWindow.__init__(self, parent=parent) self.ui = UiMainWindow() self.ui.setupUi(self) self.setWindowTitle("Metadata Overlapping Images") self.working_dir = working_dir self.data_dict = data_dict # Normalization data dictionary {'file_name': [], #'data': [[...],[...]]], #'metadata': [], #'shape': {}} # untouched array of images (used to move and rotate images) self.data_dict_raw = copy.deepcopy(data_dict) # initialization o_initialization = Initializer(parent=self) o_initialization.parameters() o_initialization.statusbar() o_initialization.table() o_initialization.widgets() o_initialization.pyqtgraph() o_initialization.event() # display first images self.slider_file_changed(0)
def __init__( self, workflow = [], parent = None, flags = QtCore.Qt.WindowFlags(0) ): QMainWindow.__init__(self, parent = parent, flags = flags ) uic.loadUi( "ui/ilastikShell.ui", self ) self._applets = [] for applet in workflow: self.addApplet(applet)
def __init__(self): QMainWindow.__init__(self) self.ui = Ui_MainWindow() self.ui.setupUi(self) self.ui.btnBack.hide() self.ui.areaModule.hide() self.addModuleButtons()
def __init__(self): QMainWindow.__init__(self) self.setupUi(self) self.setupTable() self.settings = Settings(self) self.ocr_all_set = False self.fields = [self.name, self.sell, self.buy, self.demand_num, self.demand, self.supply_num, self.supply] self.canvases = [self.name_img, self.sell_img, self.buy_img, self.demand_img, self.demand_text_img, self.supply_img, self.supply_text_img] #setup buttons self.add_button.clicked.connect(self.addFiles) self.remove_button.clicked.connect(self.removeFile) self.save_button.clicked.connect(self.addItemToTable) self.skip_button.clicked.connect(self.nextLine) self.ocr_button.clicked.connect(self.performOCR) self.ocr_all.clicked.connect(self.runOCRAll) self.export_button.clicked.connect(self.exportTable) self.clear_table.clicked.connect(self.clearTable) QObject.connect(self.actionHow_to_use, SIGNAL('triggered()'), self.howToUse) QObject.connect(self.actionAbout, SIGNAL('triggered()'), self.About) QObject.connect(self.actionOpen, SIGNAL('triggered()'), self.addFiles) QObject.connect(self.actionPreferences, SIGNAL('triggered()'), self.openSettings) QObject.connect(self.actionCalibrate, SIGNAL('triggered()'), self.openCalibrate) self.error_close = False if not isfile("./tessdata/big.traineddata"): QMessageBox.critical(self,"Error", "OCR training data not found!\n"+\ "Make sure tessdata directory exists and contains big.traineddata.") self.error_close = True #set up required items for nn self.training_image_dir = self.settings.app_path +"\\nn_training_images\\"
def __init__(self): QMainWindow.__init__(self) self.ui = Ui_MainWindow() self.ui.setupUi(self) self.action_dict = {'horn' : 0, 'lights' : 0, 'fault' : 0,} self.acceleration = 0 self.steering = 0 # List of available commands self.dict = {} self.dict['HORN_OFF'] = '8600' self.dict['HORN_ON'] = '8601' self.dict['LIGHTS_OFF'] = '8500' self.dict['LIGHTS_SOFT'] = '8501' self.dict['LIGHTS'] = '8502' self.dict['FAULT'] = ['8304',' 8404',' 8301',' 8401'] self.dict['FAULT_OFF'] = ['8300',' 8400'] self.dict['STEER_LEFT']=['817F','817E','817D','817C','817B','817A','8179','8178','8177','8176','8175','8174','8173','8172','8171','8170','816F','816E','816D','816C','816B','816A','8169','8168','8167','8166','8165','8164','8163','8162','8161','8160','815F','815E','815D','815C','815B','815A','8159','8158','8157','8156','8155','8154','8153','8152','8151','8150','814F','814E','814D','814C','814B','814A','8149','8148','8147','8146','8145','8144','8143','8142','8141'] self.dict['STEER_RIGHT']=['8100','8101','8102','8103','8104','8105','8106','8107','8108','8109','810A','810B','810C','810D','810E','810F','8110','8111','8112','8113','8114','8115','8116','8117','8118','8119','811A','811B','811C','811D','811E','811F','8120','8121','8122','8123','8124','8125','8126','8127','8128','8129','812A','812B','812C','812D','812E','812F','8130','8131','8132','8133','8134','8135','8136','8137','8138','8139','813A','813B','813C','813D','813E','813F'] self.dict['SPEED_BACK']=['827F','827E','827D','827C','827B','827A','8279','8278','8277','8276','8275','8274','8273','8272','8271','8270','826F','826E','826D','826C','826B','826A','8269','8268','8267','8266','8265','8264','8263','8262','8261','8260','825F','825E','825D','825C','825B','825A','8259','8258','8257','8256','8255','8254','8253','8252','8251','8250','824F','824E','824D','824C','824B','824A','8249','8248','8247','8246','8245','8244','8243','8242','8241'] self.dict['SPEED_FRONT']=['8200','8201','8202','8203','8204','8205','8206','8207','8208','8209','820A','820B','820C','820D','820E','820F','8210','8211','8212','8213','8214','8215','8216','8217','8218','8219','821A','821B','821C','821D','821E','821F','8220','8221','8222','8223','8224','8225','8226','8227','8228','8229','822A','822B','822C','822D','822E','822F','8230','8231','8232','8233','8234','8235','8236','8237','8238','8239','823A','823B','823C','823D','823E','823F'] self.dict['NO_SPEED']='8200' self.dict['NO_STEER'] = '8100' self.ui.connectPB.clicked.connect(self.tryToConnect) self.ui.quitPB.clicked.connect(self.quit)
def __init__(self, parent = None): QMainWindow.__init__(self, parent) self.setupUi(self) #self.treeWidget.setHeaderHidden(True) # qt 4.4 delegate = MyItemDelegate(self.treeWidget.itemDelegate()) self.treeWidget.setItemDelegate(delegate) headerItem = self.treeWidget.headerItem() headerItem.setText(0, tr("available devices")) headerItem.setTextAlignment(0, Qt.AlignHCenter) headerItem.setToolTip(0, QString("%1 %2") .arg(self.windowTitle(), "0.1")+ QString("\n%1") .arg(u"Copyright (C) 2010 Ingo Bressler")+ QString("\n%1\n%2\n%3") .arg("This program comes with ABSOLUTELY", "NO WARRANTY. This is free software, use", "and redistribute it under the terms of "+ "the GPLv3.")+ QString("\n%1\n%2") .arg(tr("For information, feedback and "+ "contributions, please visit:"), "http://github.com/ibressler/dfmon")) self.treeWidget.setMouseTracking(True) QObject.connect(self.treeWidget, SIGNAL("contentChanged(void)"), self.updateGeometry) QObject.connect(self.treeWidget, SIGNAL("contentChanged(void)"), self.centralwidget.updateGeometry) QObject.connect(self.treeWidget, SIGNAL("contentChanged(void)"), self.contentChanged) self.treeWidget.clear() # clears and rebuilds the tree
def __init__(self): # Init the baseclass QMainWindow.__init__(self) # Load widgetGallery ui file uic.loadUi(os.path.split(__file__)[0] + "\UI\multiColorUI.ui", self) MainScheme = QColorScheme() leftScheme = QColorScheme(QColor(100, 100, 0), QColor(200, 150, 150), 2.5, apply=False) rightScheme = QColorScheme(QColor(50, 100, 50), QColor(200, 150, 150), 2.5, apply=False) errorScheme = QColorScheme(QColor(250, 100, 100), QColor(200, 50, 50), 5, monochromeText=True, apply=False) leftScheme.applyScheme(self.leftWidget) rightScheme.applyScheme(self.rightWidget) errorScheme.applyScheme(self.pushButton_7) errorScheme.applyScheme(self.pushButton_8)
def __init__(self, parent = None): QMainWindow.__init__(self, parent) self.ui = Ui_ModuleEditor() self.ui.setupUi(self) self.curFilename = "" self.untouch() self.module = None self.ignoreUIChange = True for domain in module.AstrophysicalDomains: self.ui.domainCombo.addItem(domain) numConds = 0 self.checkboxMap = {} for condition in sorted(module.StoppingConditions, key=lambda k: module.StoppingConditions[k]): row = numConds // STOPCOND_GRID_WIDTH col = numConds % STOPCOND_GRID_WIDTH numConds += 1 condBox = QCheckBox(condition, self) self.ui.stopcondGrid.addWidget(condBox, row, col) self.checkboxMap[condition] = condBox self.connect(condBox, SIGNAL("stateChanged(int)"), self.stopCondChanged) self.resetUI() self.disableUI() self.ignoreUIChange = False
def __init__(self, parent=None, o_norm=None, configuration=''): display(HTML('<span style="font-size: 20px; color:blue">Check UI that poped up \ (maybe hidden behind this browser!)</span>')) self.o_norm = o_norm self.list_files = self.o_norm.data['sample']['file_name'] self.basename_list_files = [os.path.basename(_file) for _file in self.list_files] self.list_data = self.o_norm.data['sample']['data'] # have a format {'files': [], 'data': [], 'basename_files': []} # self.list_reference = self.get_list_files(start_index=0, end_index=-1) # self.list_target = self.get_list_files(start_index=1) self.list_reference = self.get_list_files() self.list_target = self.get_list_files() self.working_dir = os.path.dirname(self.list_files[0]) QMainWindow.__init__(self, parent=parent) self.ui = UiMainWindow() self.ui.setupUi(self) self.setWindowTitle("Panoramic Stitching") o_initialization = GuiInitialization(parent=self, configuration=configuration) o_initialization.all() self.check_status_of_stitching_button()
def __init__(self, parent=None): QMainWindow.__init__(self, parent) self.setWindowFlags(Qt.Window) self._mdi_area = QMdiArea() self._mdi_area.setHorizontalScrollBarPolicy(Qt.ScrollBarAsNeeded) self._mdi_area.setVerticalScrollBarPolicy(Qt.ScrollBarAsNeeded) self.setCentralWidget(self._mdi_area) # set the size of mid_area and DocumentViewManager based on the # screen size. screen = QDesktopWidget().availableGeometry() self._mdi_area.resize(screen.width() - 30, screen.height() - 80) self.resize(self._mdi_area.size()) self._mdi_area.subWindowActivated.connect(self.update_actions) self._viewer_mapper = QSignalMapper(self) self._viewer_mapper.mapped[QWidget].connect(self.set_active_sub_window) win_title = QApplication.translate( "DocumentViewManager", "Document Viewer" ) self.setWindowTitle(win_title) self.setUnifiedTitleAndToolBarOnMac(True) self.statusBar().showMessage( QApplication.translate( "DocumentViewManager", "Ready" ) ) self._doc_viewers = {} self._create_menu_actions() self.update_actions()
def __init__(self, filename=None, il = None, xl = None): QMainWindow.__init__(self) self.segyioargs = { k: v for k, v in [('iline', il), ('xline', xl)] if v is not None } self.setAttribute(Qt.WA_DeleteOnClose) title = filename if filename is not None else "SEG-Y Viewer" self.setWindowTitle(title) self._segy_view_widget = SegyViewWidget(filename, show_toolbar=True, segyioargs = self.segyioargs, parent = self) self.setCentralWidget(self._segy_view_widget) self.setWindowIcon(resource_icon("350px-SEGYIO.png")) toolbar = self._segy_view_widget.toolbar() open_button = QToolButton() open_button.setToolTip("Open a SEG-Y file") open_button.setIcon(resource_icon("folder.png")) open_button.clicked.connect(self._open_file) first_action = toolbar.actions()[0] toolbar.insertWidget(first_action, open_button) toolbar.insertSeparator(first_action)
def __init__(self, parent = None): ''' @type parent: QWidget ''' QMainWindow.__init__(self, parent) self.ui = uic.loadUi(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'ui/main.ui'), self) self.__lastupdatedlabel = QLabel() self.ui.statusbar.addWidget(self.__lastupdatedlabel, 1) self.contextmenu = QMenu(self) self.contextmenu.addAction("Update Shows", self.updateshows) self.contextmenu.addSeparator() self.contextmenu.addAction("Remove Selected", self.removeshows) self.connect(self.ui.showlist, SIGNAL('customContextMenuRequested(const QPoint&)'), self.showcontextmenu) self.connect(self.ui.searchbutton, SIGNAL('pressed()'), self.search) self.connect(self.ui.addbutton, SIGNAL('pressed()'), self.add) self.connect(self.ui.searchtext, SIGNAL('textChanged(QString)'), self.enablesearch) self.connect(self.ui.showlist, SIGNAL('doubleClicked(QModelIndex)'), self.openshow) self.connect(self.ui.refreshshowsbutton, SIGNAL('pressed()'), self.updateshows) self.connect(self.ui.removeshowsbutton, SIGNAL('pressed()'), self.removeshows) self.connect(self.ui.getshowlistbutton, SIGNAL('pressed()'), self.getshowlist) self.connect(self.ui.settingsautoswitchshowtab, SIGNAL('stateChanged(int)'), self.settingsautoswitchshowtabvaluechanged) self.connect(self.ui.settingsautoswitchseasontab, SIGNAL('stateChanged(int)'), self.settingsautoswitchseasontabvaluechanged)
def __init__(self, args): """ Constructor """ QMainWindow.__init__(self) self.setupUi(self) self.text = None self.path = "" self.lang_actions = {} for lang in enchant.list_languages(): action = self.menuLanguages.addAction(lang) action.setCheckable(True) action.triggered.connect(self.on_languageChanged) self.lang_actions[lang] = action self.spell_dict = enchant.Dict() self.lang_actions[self.spell_dict.tag].setChecked(True) self.current_language = self.spell_dict.tag self.lexers = self.get_lexers() self.setChanged(False) self.search = None self.spell_checker = None if len(args) > 1: self.path = args[1] self.open() self.textEdit.textChanged.connect(self.on_textChanged)
def __init__(self): QMainWindow.__init__(self) self.setupUi(self) trayicon = QIcon(os.path.join(sys.path[0],'data/tray.png')) self.tray = TrayIcon() self.tray.setIcon(trayicon) self.tray.setParent(self) self.tray.setContextMenu(self.menuMenu) self.tray.show() self.config = Config() self.client = GUIElement.Client(self.config) if os.name == 'posix': self.server = GUIElement.Server(self.config) self.preferences = GUIElement.Preferences(self.config) mount_tab = QTabWidget() mount_tab.setWindowTitle('NFS Mounter') mount_tab.addTab(self.client, 'Mount') if os.name == 'posix': mount_tab.addTab(self.server, 'Share') mount_tab.addTab(self.preferences, 'Preferences') if os.name == 'posix': nfs = NfsBrowser(self.client) self.setCentralWidget(mount_tab) self.actionAdd.connect(self.actionAdd, SIGNAL("triggered()"), self.client.add_line) self.tray.connect(self.tray, SIGNAL("activated(QSystemTrayIcon::ActivationReason)"), self.on_tray_clicked) self.actionExit.connect(self.actionExit, SIGNAL('triggered()'), self.on_actionExit_clicked)
def __init__(self, help_center_name, parent=None): QMainWindow.__init__(self, parent, Qt.WindowStaysOnTopHint) palette = self.palette() palette.setColor(self.backgroundRole(), QColor(255, 255, 224)) self.setPalette(palette) self.setAutoFillBackground(True) self.setMinimumWidth(300) self.setMinimumHeight(250) self.setWindowTitle("Help") self.setObjectName("ert-gui-help") central_widget = QWidget() layout = QVBoxLayout() central_widget.setLayout(layout) self.link_widget = QLabel() self.link_widget.setStyleSheet("font-weight: bold") self.link_widget.setMinimumHeight(20) self.help_widget = QLabel(HelpWindow.default_help_string) self.help_widget.setWordWrap(True) self.help_widget.setTextFormat(Qt.RichText) self.help_widget.linkActivated.connect(self.openHelpURL) layout.addWidget(self.link_widget) layout.addWidget(self.help_widget) layout.addStretch(1) HelpCenter.getHelpCenter(help_center_name).addListener(self) self.__position = None self.__geometry = None self.setCentralWidget(central_widget)
def __init__(self, control_system): QMainWindow.__init__(self) self.control_system = control_system self.control_system.response_received.connect(self.on_response_received) self.ui_main_window = ControlProgramForm.Ui_MainWindow() self.ui_main_window.setupUi(self) self.ui_main_window.undecoded_packages_textEdit.moveCursor(QTextCursor.EndOfBlock) self.connect(self.ui_main_window.enable_minimal_mode_pushButton, SIGNAL("clicked()"), self.on_enable_minimal_mode) self.connect(self.ui_main_window.enable_nominal_mode_pushButton, SIGNAL("clicked()"), self.on_enable_nominal_mode) self.connect(self.ui_main_window.enable_operating_mode_pushButton, SIGNAL("clicked()"), self.on_enable_operating_mode) self.connect(self.ui_main_window.enable_broadcasting_pushButton, SIGNAL("clicked()"), self.on_enable_broadcasting) self.connect(self.ui_main_window.disable_broadcasting_pushButton, SIGNAL("clicked()"), self.on_disable_broadcasting) self.connect(self.ui_main_window.set_real_time_pushButton, SIGNAL("clicked()"), self.on_set_real_time) self.connect(self.ui_main_window.device_power_enable_pushButton, SIGNAL("clicked()"), self.on_device_power_enable) self.connect(self.ui_main_window.device_power_disable_pushButton, SIGNAL("clicked()"), self.on_device_power_disable) self.connect(self.ui_main_window.transceiver_select_pushButton, SIGNAL("clicked()"), self.on_transceiver_select) self.connect(self.ui_main_window.device_command_pushButton, SIGNAL("clicked()"), self.on_device_command)
def __init__(self, qApp): QMainWindow.__init__(self) self._firstwidget = None self._workspace = QWorkspace() self.setCentralWidget(self._workspace) self.setAcceptDrops(True) self.setWindowTitle("Pivy Quarter MDI example") filemenu = self.menuBar().addMenu("&File") windowmenu = self.menuBar().addMenu("&Windows") fileopenaction = QAction("&Create Box", self) fileexitaction = QAction("E&xit", self) tileaction = QAction("Tile", self) cascadeaction = QAction("Cascade", self) filemenu.addAction(fileopenaction) filemenu.addAction(fileexitaction) windowmenu.addAction(tileaction) windowmenu.addAction(cascadeaction) self.connect(fileopenaction, QtCore.SIGNAL("triggered()"), self.createBoxInFreeCAD) self.connect(fileexitaction, QtCore.SIGNAL("triggered()"), QtGui.qApp.closeAllWindows) self.connect(tileaction, QtCore.SIGNAL("triggered()"), self._workspace.tile) self.connect(cascadeaction, QtCore.SIGNAL("triggered()"), self._workspace.cascade) windowmapper = QtCore.QSignalMapper(self) self.connect(windowmapper, QtCore.SIGNAL("mapped(QWidget *)"), self._workspace.setActiveWindow) self.dirname = os.curdir
def __init__(self, directory=".", debug=False): """ Initialisation method, setting the directory. :param directory: Root directory of the git repository. """ QMainWindow.__init__(self) self._ui = Ui_MainWindow() self._ui.setupUi(self) self._modifications_shown = True self._directory = directory self.current_branch = None self._models = {} self.set_current_directory(directory) self.enable_modifications_buttons(False) self.filter_main_class = FilterMainClass(self, directory, self._models) self.rebase_main_class = RebaseMainClass(self, directory, self._models) self.reset_history() self._applying = False self.connect_slots()
def __init__(self, parent=None, VIEWER_REFRESH_RATE=5, ch_all=[]): """ Constructor """ # QMainWindow.__init__(self, parent, Qt.FramelessWindowHint) QMainWindow.__init__(self, parent) self.setupUi(self) self.x = 200 self.pen = QPen() self.numPt = PIXEL_OFFSET self.isPause = False self.NUM_CHANNEL = len(CHIN_PARAM) # Create a gain_slider for each channel self.ch_all = [] for (addr, name, visual_gain, type, color), i in zip(CHIN_PARAM, xrange(NUM_CHANNEL)): exec interp( 'self.ch_#{name} = ViewChannel(hostDialog=self, name=name, id=i, color = color)' ) exec interp( 'self.connect(self.ch_#{name}.slider, SIGNAL("valueChanged(int)"), self.onChInGain)' ) exec interp('self.ch_all.append(self.ch_#{name})') #print self.ch_all self.timer = QTimer(self) self.connect(self.timer, SIGNAL("timeout()"), self.onTimeOut) self.timer.start(VIEWER_REFRESH_RATE)
def __init__(self, parent = None): """ Constructor """ QMainWindow.__init__(self, parent) self.setupUi(self) self.tableWidget.setColumnWidth(0,320) self.tableWidget.setColumnWidth(1,60) self.tableWidget.setColumnWidth(2,60) #self.tableWidget.setColumnWidth(3,200) header = self.tableWidget.horizontalHeader() header.setStretchLastSection(True) label_parent = self.label_drop_url.parent() qrect = self.label_drop_url.geometry() #self.removeWidget(self.label_drop_url) self.label_drop_url.deleteLater() self.label_drop_url = DragDropLabel(parent = label_parent,ui = self) self.label_drop_url.setGeometry(qrect) self.horizontalLayout_10.addWidget(self.label_drop_url) self.listWidget_process.setViewMode(QtGui.QListWidget.IconMode) self.listWidget_process.setIconSize(QtCore.QSize(20,20)) self.listWidget_process.setGridSize (QtCore.QSize(20,20)) self.listWidget_process.setDragDropMode(QtGui.QAbstractItemView.NoDragDrop) self.listWidget_process.setSelectionMode(QtGui.QAbstractItemView.NoSelection)
def __init__(self, parent=None): """ Constructor """ QMainWindow.__init__(self, parent) self.setupUi(self) self.fileNames = [] # files to convert self.mdfClass = Mdf() # instance of mdf self.mdfinfoClass = MdfInfo() # instance of mdfinfo self.convertSelection = 'Matlab' # by default Matlab conversion is selected self.MergeFiles = False # by default self.labFileName = [] # .lab file name self.defaultPath = None # default path to open for browsing files self.actionPlotSelectedChannel = QAction( "Plot", self.SelectedChannelList) # context menu to allow plot of channel self.SelectedChannelList.addAction(self.actionPlotSelectedChannel) self.connect(self.actionPlotSelectedChannel, SIGNAL("triggered()"), self.plotSelected) self.actionPlotChannel = QAction( "Plot", self.channelList) # context menu to allow plot of channel self.channelList.addAction(self.actionPlotChannel) self.connect(self.actionPlotChannel, SIGNAL("triggered()"), self.plot) self.actionFileRemove = QAction( "Delete", self.FileList) # context menu to remove selected file from list self.FileList.addAction(self.actionFileRemove) self.connect(self.actionFileRemove, SIGNAL("triggered()"), self.FileRemove)
def __init__(self, systray=True, debug=False, reset=False, parent=None): """ Constructor Keyword arguments: systray -- enables the system tray icon (default=True) debug -- enable debugging output (default=False) reset -- reset preferences (default=False) parent -- parent QWidget (default=None) """ QMainWindow.__init__(self, parent) self.ui = Ui_Qnotero() self.ui.setupUi(self) if not reset: self.restoreState() self.debug = debug self.reInit() self.noResults() if systray: self.sysTray = SysTray(self) self.sysTray.show() self.minimizeOnClose = True else: self.minimizeOnClose = False if getConfig("firstRun"): self.preferences(firstRun=True) if getConfig("autoUpdateCheck"): self.updateCheck()
def __init__(self): QMainWindow.__init__(self) self.tools = {} self.resize(300, 700) self.setWindowTitle('ERT') self.__main_widget = None self.central_widget = QWidget() self.central_layout = QVBoxLayout() self.central_widget.setLayout(self.central_layout) self.setCentralWidget(self.central_widget) self.toolbar = self.addToolBar("Tools") self.toolbar.setObjectName("Toolbar") self.toolbar.setToolButtonStyle(Qt.ToolButtonTextUnderIcon) self.setCorner(Qt.TopLeftCorner, Qt.LeftDockWidgetArea) self.setCorner(Qt.BottomLeftCorner, Qt.BottomDockWidgetArea) self.setCorner(Qt.TopRightCorner, Qt.RightDockWidgetArea) self.setCorner(Qt.BottomRightCorner, Qt.BottomDockWidgetArea) self.__view_menu = None self.__help_menu = None self.__createMenu() self.__fetchSettings()
def __init__(self): QMainWindow.__init__(self) self.ui = Ui_MainWindow() self.ui.setupUi(self) # Init MenuViews self.ui.actionLogView.setChecked(self.ui.logDockWidget.isVisible()) self.ui.actionToolBar.setChecked(self.ui.toolBar.isVisible()) self.bisect_runner = BisectRunner(self) self.bisect_runner.bisector_created.connect( self.ui.report_view.model().attach_bisector) self.ui.report_view.step_report_changed.connect( self.ui.build_info_browser.update_content) self.report_delegate = ReportItemDelegate() self.ui.report_view.setItemDelegateForColumn(0, self.report_delegate) self.bisect_runner.running_state_changed.connect( self.ui.actionStart_a_new_bisection.setDisabled) self.bisect_runner.running_state_changed.connect( self.ui.actionStop_the_bisection.setEnabled) self.persist = mkdtemp() self.read_settings()
def __init__(self, parent=None): QMainWindow.__init__(self, parent) self.ui = ui_windowSettings.Ui_windowSettings() self.ui.setupUi(self) # actions self.ui.btnSave.pressed.connect(self._saveSettings) self.ui.btnCancel.pressed.connect(self._cancel) self.ui.openBinNES.pressed.connect(self.openBinNES) self.ui.openBinSNES.pressed.connect(self.openBinSNES) self.ui.openBinN64.pressed.connect(self.openBinN64) self.ui.openBinGameCube.pressed.connect(self.openBinGameCube) self.ui.openBinWii.pressed.connect(self.openBinWii) self.ui.openBinPS1.pressed.connect(self.openBinPS1) self.ui.openBinPS2.pressed.connect(self.openBinPS2) self.ui.openBinGenesis.pressed.connect(self.openBinGenesis) self.ui.openBinDreamcast.pressed.connect(self.openBinDreamcast) self.ui.openBinGameBoy.pressed.connect(self.openBinGameBoy) self.ui.openBinGBA.pressed.connect(self.openBinGBA) self.ui.openBinNDS.pressed.connect(self.openBinNDS) # load current saved settings self._loadSettings()
def __init__(self, project_name, terminal_group = 'test', logs_dir = 'logs', parent = None): QMainWindow.__init__(self, parent) self.setupUi(self) self.script_name = '{}script.txt'.format(terminal_group) self.logs_dir = logs_dir self.teminal_group = terminal_group self.template_dir = os.path.join('templates', self.teminal_group) self.set_window_position() self.cfg_path = os.path.abspath(os.path.join('cfg', self.teminal_group + '.cfg' )) self.elements = utils.Elements(terminal_group) self.setup_listwidget() self.project_name = project_name self.init_window = None self.setcwd() self.setWindowTitle(self.windowTitle() + ' - {} - {} {}'.format( terminal_group, self.project_name, self.wdir)) self.kittysmanager = terminals.KittysManager(terminal_group, self.wdir, self.elements) self.commands = terminals.Commands(self.kittysmanager, self.listwidget) self.connect_custom_signals() self.template_action_list = [] self.add_templates() os.makedirs(self.logs_dir, exist_ok = True) os.makedirs(self.wdir, exist_ok = True) self.logslistview.setup(wdir = os.path.normpath(self.wdir)) self.connect_actions() self.script_file_path = os.path.join(self.wdir, self.script_name) self.load_script() self.sciscintilla.textChanged.connect(self.verify_set_lines)
def __init__(self, parent = None): """ Constructor """ QMainWindow.__init__(self, parent) self.setupUi(self) self.table_summary.setRowCount(3) self.table_summary.setColumnCount(2) self.table_summary.horizontalHeader().setVisible(True) self.table_summary.horizontalHeader().setVisible(True) self.table_summary_2.setRowCount(5) self.table_summary_2.setColumnCount(4) self.table_summary_2.horizontalHeader().setVisible(True) self.table_summary_2.horizontalHeader().setVisible(True) #hide the results widget self.results_tab = self.tabWidget.widget(1) self.results_iterate_tab = self.tabWidget.widget(2) self.results_diff_tab = self.tabWidget.widget(3) self.tabWidget.removeTab(1) self.tabWidget.removeTab(1) self.tabWidget.removeTab(1)
def __init__(self, parent=None, mode='online'): QMainWindow.__init__(self, parent) self.setupUi(self) self.setWindowIcon(QIcon('app_icon.png')) QtCore.QObject.connect(self.speedSlider, QtCore.SIGNAL("valueChanged (int)"), self.MyCube, QtCore.SLOT("updateSpeed(int)")) QtCore.QObject.connect(self.pushButton_Spin, QtCore.SIGNAL("clicked(bool)"), self.MyCube, QtCore.SLOT("spin(bool)")) QtCore.QObject.connect(self.pushButton_X, QtCore.SIGNAL("clicked(bool)"), self.MyCube, QtCore.SLOT("moveX(bool)")) QtCore.QObject.connect(self.pushButton_Y, QtCore.SIGNAL("clicked(bool)"), self.MyCube, QtCore.SLOT("moveY(bool)")) QtCore.QObject.connect(self.pushButton_Z, QtCore.SIGNAL("clicked(bool)"), self.MyCube, QtCore.SLOT("moveZ(bool)")) self.myConnector = Connector(self, mode=mode) self.timer = QtCore.QTimer() QtCore.QObject.connect(self.timer, QtCore.SIGNAL("timeout()"), self.myConnector.update) self.timer.start(50) # cycle time in ms (50)
def __init__(self, systray=True, debug=False, reset=False, parent=None): """ Constructor. Keyword arguments: systray -- Enables the system tray icon (default=True) debug -- Enable debugging output (default=False) reset -- Reset preferences (default=False) parent -- Parent QWidget (default=None) """ QMainWindow.__init__(self, parent) self.loadUi('qnotero') if not reset: self.restoreState() self.debug = debug self.reInit() self.noResults() if systray: self.sysTray = SysTray(self) self.sysTray.show() self.minimizeOnClose = True else: self.minimizeOnClose = False if getConfig(u"firstRun") or not os.path.exists(getConfig('zoteroPath')): self.preferences(firstRun=True) if getConfig(u"autoUpdateCheck"): self.updateCheck()
def __init__(self, parent=None): QMainWindow.__init__(self, parent) self.setupUi(self) self.setWindowIcon(QIcon("brickv-icon.png")) signal.signal(signal.SIGINT, self.exit_brickv) signal.signal(signal.SIGTERM, self.exit_brickv) self.setWindowTitle("Brick Viewer") self.table_view_header = ['#', 'Device Name', 'UID', 'FW Version'] # Remove dummy tab self.tab_widget.removeTab(1) self.last_tab = 0 self.plugins = [(self, None, None, None)] self.ipcon = None self.reset_view() self.button_advanced.setDisabled(True) self.callback_enumerate_signal.connect(self.callback_enumerate) self.tab_widget.currentChanged.connect(self.tab_changed) self.connect.pressed.connect(self.connect_pressed) self.button_advanced.pressed.connect(self.advanced_pressed) self.plugin_manager = PluginManager()
def __init__(self): QMainWindow.__init__(self) self.setupUi(self) #title2 = '我的个人防火墙' #print title2 #title = QString(u'我的个人防火墙') self.setWindowTitle(u'我的个人防火墙') #self.setWindowTitle(title) #self.setWindowIcon(QIcon(":/pics/pic.jpg")) self.tableView.setShowGrid(False) self.actionDisplay.triggered.connect(self.displayconnections) self.actionList_Rules.triggered.connect(self.listrules) self.actionAdd_Rules.triggered.connect(self.addrules) self.actionDisconnect.triggered.connect(self.disconnection) self.actionReconnect.triggered.connect(self.reconnection) self.actionMessage.triggered.connect(self.message) #self.menuRules.aboutToShow.connect(self.rulesMenuTriggered) #self.menuRules.actions()[0].triggered.connect(self.deleteMenuTriggered) #self.actionShow_active_only.triggered.connect(self.showActiveOnly) #self.actionShow_all.triggered.connect(self.showAll) self.actionExit.triggered.connect(self.realQuit) self.askusersig.connect(self.askUser) self.update_bytestatssig.connect(self.update_bytestats) self.refreshmodelsig.connect(self.refreshmodel) self.refreshconnectionssig.connect(self.refreshconnections) self.refreshrulessig.connect(self.refreshrules)
def __init__(self, parent=None, data=None): display( HTML( '<span style="font-size: 20px; color:blue">Check UI that poped up \ (maybe hidden behind this browser!)</span>')) self.live_data = data #self.list_files = self.o_norm.data['sample']['file_name'] #self.list_data = self.o_norm.data['sample']['data'] QMainWindow.__init__(self, parent=parent) self.ui = UiMainWindow() self.ui.setupUi(self) self.init_statusbar() self.setWindowTitle("Background ROI Selection Tool") self.ui.image_view = pg.ImageView() self.ui.image_view.ui.roiBtn.hide() self.ui.image_view.ui.menuBtn.hide() top_layout = QtGui.QVBoxLayout() top_layout.addWidget(self.ui.image_view) self.ui.widget.setLayout(top_layout) self.init_widgets() self.integrate_images() self.display_image()
def __init__( self ): # Init the baseclass QMainWindow.__init__( self ) # Load widgetGallery ui file uic.loadUi( os.path.split( __file__ )[0] + "\UI\widgetGallery.ui", self ) # Connect disable checkbox self.disableWidgets.toggled.connect(self.mainWidget.setDisabled) # Connect spread sliders to the scheme spread self.spreadSlider.sliderMoved.connect(self.spreadSliderChange) # Connect color pickers to base- and highlight-colors self.pickBaseColor.clicked.connect(self.slotBaseColor) self.pickHighlightColor.clicked.connect(self.slotHighlightColor) # Create ColorSchemer and apply to the whole app self.ColorScheme = QColorScheme() self.ColorScheme.loadSimpleScheme(os.path.split( __file__ )[0] + "\..\QColorScheme\Presets\SimpleNuke.ini") # Set initial values on the colorchips and spread slider to match the loaded scheme self.spreadSlider.setValue(self.ColorScheme.spread*1000) self.setBackgroundColor(self.chipBaseColor, self.ColorScheme.baseColor) self.setBackgroundColor(self.chipHighlightColor, self.ColorScheme.highlightColor)
def __init__(self, parent=None, exp_dict=None): display( HTML( '<span style="font-size: 20px; color:blue">Check UI that poped up \ (maybe hidden behind this browser!)</span>')) self.exp_dict = exp_dict QMainWindow.__init__(self, parent=parent) self.ui = UiMainWindow() self.ui.setupUi(self) self.init_statusbar() self.setWindowTitle("Display Images for Selected Metadata Range") self.ui.image_view = pg.ImageView() self.ui.image_view.ui.roiBtn.hide() self.ui.image_view.ui.menuBtn.hide() top_layout = QtGui.QVBoxLayout() top_layout.addWidget(self.ui.image_view) self.ui.widget.setLayout(top_layout) self.init_widgets() # self.integrate_images() # self.display_image() self.init_table() self.init_display()
def __init__(self): QMainWindow.__init__(self) self.setWindowTitle("QSingleApplication Demo") labelText = "<b>dallagnese.fr recipe</b><br /><br />\ Allows you to start your program only once.<br />\ Parameters of later calls can be handled by this application." self.setCentralWidget(QLabel(labelText))
def __init__(self, argv): QMainWindow.__init__(self) #Normalize the data if true self._normalize_data=True if 'notnormalize' in sys.argv: print sys.argv self._normalize_data=False sys.argv.remove('notnormalize') self.opPredict = None self.opTrain = None self.opThreshold = None self._colorTable16 = self._createDefault16ColorColorTable() #self.g = Graph(7, 2048*1024**2*5) self.g = Graph() self.fixableOperators = [] self.featureDlg=None #The old ilastik provided the following scale names: #['Tiny', 'Small', 'Medium', 'Large', 'Huge', 'Megahuge', 'Gigahuge'] #The corresponding scales are: self.featScalesList=[0.3, 0.7, 1, 1.6, 3.5, 5.0, 10.0] self.initUic() #if the filename was specified on command line, load it if len(sys.argv) >= 2: def loadFile(): self._openFile(sys.argv[1:]) QTimer.singleShot(0, loadFile)
def __init__(self, parent=None): QMainWindow.__init__(self, parent) self.setWindowTitle("Facadedevice server GUI") self.setFixedSize(600, 400) mWidget = mainWidget(self) self.setCentralWidget(mWidget)
def __init__(self, parent=None, scan_on_startup=False): QMainWindow.__init__(self, parent) self.resize(800, 500) self._widget = MainWidget(self, scan_on_startup=scan_on_startup) self.setCentralWidget(self._widget) settings = QSettings() self.restoreGeometry(settings.value('geometry', b'', QByteArray)) self.setWindowTitle('Marche') menu = self.menuBar() menuFile = menu.addMenu('File') menuFile.addAction(self._widget.actionAdd_host) menuFile.addAction(self._widget.actionScan_network) menuFile.addSeparator() menuFile.addAction(self._widget.actionLoad_session) menuFile.addAction(self._widget.actionSave_session_as) menuFile.addSeparator() menuFile.addAction(self._widget.actionExit) self._widget.actionExit.triggered.connect(self.close) menuEdit = menu.addMenu('Edit') menuEdit.addAction(self._widget.actionPreferences) menuJobs = menu.addMenu('Jobs') menuJobs.addAction(self._widget.actionReload) menuHelp = menu.addMenu('Help') menuHelp.addAction(self._widget.actionAbout) menuHelp.addAction(self._widget.actionAbout_Qt) self.statusBar().showMessage('Welcome!', 1000)
def __init__(self, parent = None, VIEWER_REFRESH_RATE = 5, ch_all = []): """ Constructor """ # QMainWindow.__init__(self, parent, Qt.FramelessWindowHint) QMainWindow.__init__(self, parent) self.setupUi(self) self.x = 200 self.pen = QPen() self.numPt = PIXEL_OFFSET self.isPause = False self.NUM_CHANNEL = len(CHIN_PARAM) # Create a gain_slider for each channel self.ch_all = [] for (addr, name, visual_gain, type, color), i in zip(CHIN_PARAM, xrange(NUM_CHANNEL)): exec interp('self.ch_#{name} = ViewChannel(hostDialog=self, name=name, id=i, color = color)') exec interp('self.connect(self.ch_#{name}.slider, SIGNAL("valueChanged(int)"), self.onChInGain)') exec interp('self.ch_all.append(self.ch_#{name})') #print self.ch_all self.timer = QTimer(self) self.connect(self.timer, SIGNAL("timeout()"), self.onTimeOut) self.timer.start(VIEWER_REFRESH_RATE)
def __init__(self): QMainWindow.__init__(self) self.setupUi(self) self._config = {} SubscriberApplication.instance().subscribed.connect(self.statusBar().clearMessage) SubscriberApplication.instance().subscriptionError.connect(self._subscriptionError) QTimer.singleShot(0, self._chooseTeam)
def __init__(self, parent=None, mouse_x=0, mouse_y=0): QMainWindow.__init__(self, parent=parent) self.setWindowModality(False) self.ui = UiMainWindowXaxis() self.ui.setupUi(self) self.parent = parent o_gui_utility = GuiUtility(parent=self.parent) self.yaxis_type = o_gui_utility.get_reduced_yaxis_type() big_table_data = self.parent.big_table_data self._lrdata = big_table_data[0, 0] width = self.width() height = self.height() self.setFixedSize(width, height) pos_main_gui = self.parent.pos() plot_gui_pos = self.parent.ui.data_stitching_plot.pos() plot_gui_height = self.parent.ui.data_stitching_plot.frameGeometry( ).height() self.move(mouse_x + plot_gui_pos.x(), plot_gui_pos.y() + plot_gui_height + mouse_y - 50) self.init_widgets()