def context_menu(self): # sets up the menu menu = QtWidgets.QMenu() # creates a menu based on the filetype filename = self.model.fileName(self.treeView.currentIndex()) filetype = self.model.type(self.treeView.currentIndex()).split(" ")[0] # if file is not present here if filetype[-1].isdigit() == True: open = menu.addAction("Pull File") open.triggered.connect(self.read_file) # file exists in the curent system else: open = menu.addAction("Push File") open.triggered.connect(self.write_file) open = menu.addAction("Open File") open.triggered.connect(self.open_file) cursor = QtGui.QCursor() menu.exec_(cursor.pos())
def _createMietobjektMenu(self): menu = QtWidgets.QMenu(self._menubar, title="Mietobjekt") self._menubar.addMenu(menu) # Menüpunkt "Wohnungsstammdaten..." action = QAction(self, text="Objektstammdaten...") action.triggered.connect(self.onViewObjektStammdaten) menu.addAction(action) # # Menüpunkt "Mietverhältnis..." # action = QAction( self, text="Mietverhältnis..." ) # action.triggered.connect( self.onViewMietverhaeltnis ) # menu.addAction( action ) menu.addSeparator() # action = QAction( self, text="Mieterwechsel..." ) # action.triggered.connect( self.onMieterwechsel ) # menu.addAction( action ) action = QAction(self, text="Verwalterwechsel...") action.triggered.connect(self.onVerwalterwechsel) menu.addAction(action)
def __init__(self, icon, parent=None): super(SystemTrayIcon, self).__init__(icon, parent) self._path_actions = [] self._menu = QtWidgets.QMenu(parent) self.setContextMenu(self._menu) self._separator = self._menu.addSeparator() add_action = QtWidgets.QAction( "Adicionar", self, icon=QtGui.QIcon(str(pathRaiz)+"/img/plus.png"), triggered=self.add ) quit_action = QtWidgets.QAction( "Exit", self, icon=QtGui.QIcon(str(pathRaiz)+"/img/logout.png"), triggered=QtWidgets.QApplication.quit, ) self._menu.addAction(add_action) self._menu.addAction(quit_action) self.refresh_menu() self.activated.connect(self.onTrayIconActivated)
def __showPopup(self, pos): globalPos = self.mapToGlobal(pos) buttonIndex = self.itemAt(pos) if buttonIndex is not None: button = self.buttonList[buttonIndex] if button.property('button') and len(self.buttonList) - 1 > 1: menu = QtWidgets.QMenu() removeAction = menu.addAction('Remove') action = menu.exec_(globalPos) if action == removeAction: self.mainLayout.removeWidget(button) button.setParent(None) button.hide() button.deleteLater() currentButton = self.__currentButton() self.buttonList.remove(button) if currentButton == button: self.setCurrentIndex(0) else: index = self.buttonList.index(currentButton) self.setCurrentIndex(index) del menu
def right_clicked(self, position): index = self.ui.clientsTable.indexAt(position) client = self.table_model.clients[index.row()] menu = QtWidgets.QMenu() if client.open == 1: bring_front_action = QtWidgets.QAction("Bring to Front") bring_front_action.triggered.connect( lambda: self.bring_to_front_client_clicked.emit(client)) close_action = QtWidgets.QAction("Close Client") close_action.triggered.connect( lambda: self.close_client_clicked.emit(client)) menu.addAction(bring_front_action) menu.addAction(close_action) else: action = QtWidgets.QAction("Open Client") menu.addAction(action) action.triggered.connect( lambda: self.open_client_clicked.emit(client)) menu.exec_(self.mapToGlobal(position))
def __init__(self, parent, value='', file_types='', writable=True, label_text=None, save_mode=False, changable=True): super(A2PathField, self).__init__(parent) self.main_layout = QtWidgets.QHBoxLayout(self) self.main_layout.setContentsMargins(0, 0, 0, 0) self.line_field = QtWidgets.QLineEdit(self) self.line_field.setText(value) self.main_layout.addWidget(self.line_field) self.browse_button = QtWidgets.QPushButton('Browse...', self) self.browse_button.setIcon(a2ctrl.Icons.inst().folder2) self.browse_button.clicked.connect(self.browse) self.main_layout.addWidget(self.browse_button) self.options_menu = QtWidgets.QMenu() self.a2option_button = A2MoreButton(self) self.a2option_button.menu_called.connect(self.show_options_menu) self.main_layout.addWidget(self.a2option_button) self._set_delay = 150 self._field_set = False self._value = value self.file_types = file_types self.save_mode = save_mode self.browse_type = BrowseType.file self.label_text = label_text self._changable = None self.changable = changable self._writable = None self.writable = writable
def show_single_selection_context_menu(self, index, position): tree_item = self.tree_model.getItem(index) new_request_action = QtWidgets.QAction("New Request") new_request_action.triggered.connect( lambda: self.new_request_clicked(index)) new_dir_action = QtWidgets.QAction("New Folder") new_dir_action.triggered.connect(lambda: self.new_dir_clicked(index)) rename_action = QtWidgets.QAction("Rename") rename_action.triggered.connect(lambda: self.edit(index)) paste_action = QtWidgets.QAction("Paste") paste_action.triggered.connect(lambda: self.paste_clicked(index)) copy_action = QtWidgets.QAction("Copy") copy_action.triggered.connect(lambda: self.copy_clicked(index)) delete_action = QtWidgets.QAction("Delete") delete_action.triggered.connect(lambda: self.delete_clicked(index)) # TODO: Refactor all these if statements: menu = QtWidgets.QMenu(self) if tree_item.is_dir: menu.addAction(new_request_action) menu.addAction(new_dir_action) if self.copied_editor_item is not None: menu.addAction(paste_action) else: menu.addAction(copy_action) if index.isValid(): menu.addAction(delete_action) menu.addAction(rename_action) menu.exec_(self.viewport().mapToGlobal(position))
def __init__(self): self.hotkeyPressed = False self.app = QtWidgets.QApplication([]) desktop = self.app.desktop() file = QtCore.QFile(":/dark.qss") file.open(QtCore.QFile.ReadOnly | QtCore.QFile.Text) stream = QtCore.QTextStream(file) self.app.setStyleSheet(stream.readAll()) self.widget = WinFlingPopup() rec = desktop.availableGeometry(self.widget) self.widget.move(rec.width() / 2 - self.widget.width() / 2, rec.height() * 0.75 - self.widget.height() / 2) self.shortcut = WinFlingNewShortcut() self.shortcut.move(rec.width() / 2 - self.widget.width() / 2, rec.height() * 0.75 - self.widget.height() / 2) self.shortcut.hide() self.trayMenu = QtWidgets.QMenu() self.trayMenu.addAction("launch application") self.trayMenu.addAction("add shortcut") self.trayMenu.addAction("exit") self.trayMenu.triggered.connect(self.trayClicked) self.icon = QtWidgets.QSystemTrayIcon(QtGui.QIcon('thumbnail.png'), self.app) self.icon.setContextMenu(self.trayMenu) self.icon.show() self.timer = QtCore.QTimer() self.timer.timeout.connect(self.hotkeyTimerEvent) self.timer.start(30) keyboard.add_hotkey('ctrl+shift+a', self.launchPopup)
def _createImmoCenterMenu(self): # Menü "ImmoCenter" menu = QtWidgets.QMenu(self._menubar, title="ImmoCenter") self._menubar.addMenu(menu) # Menüpunkt "Alle Änderungen speichern" action = QAction(self, text="Alle Änderungen speichern") action.setShortcut(QKeySequence("Ctrl+Shift+s")) action.triggered.connect(self.onSaveAll) menu.addAction(action) menu.addSeparator() # Menü "Datenbank zum Server exportieren" action = QAction(self, text="Datenbank zum Server exportieren") action.triggered.connect(self.onExportDatabaseToServer) menu.addAction(action) # Menü "Datenbank vom Server importieren" action = QAction(self, text="Datenbank vom Server importieren") action.triggered.connect(self.onImportDatabaseFromServer) menu.addAction(action) menu.addSeparator() # Menüpunkt "Folgejahr einrichten" action = QAction(self, text="Folgejahr einrichten") action.triggered.connect(self.onFolgejahrEinrichten) menu.addAction(action) menu.addSeparator() # Menüpunkt "Ende" action = QAction(self, text="Ende") action.triggered.connect(self.onExit) action.setShortcut("Alt+F4") menu.addAction(action)
def setupUi(self, MainWindowForBevelTool): MainWindowForBevelTool.setObjectName("MainWindowForBevelTool") MainWindowForBevelTool.resize(654, 477) self.centralwidget = QtWidgets.QWidget(MainWindowForBevelTool) self.centralwidget.setObjectName("centralwidget") MainWindowForBevelTool.setCentralWidget(self.centralwidget) self.menubar = QtWidgets.QMenuBar(MainWindowForBevelTool) self.menubar.setGeometry(QtCore.QRect(0, 0, 654, 21)) self.menubar.setObjectName("menubar") self.menuEdit = QtWidgets.QMenu(self.menubar) self.menuEdit.setObjectName("menuEdit") MainWindowForBevelTool.setMenuBar(self.menubar) self.statusbar = QtWidgets.QStatusBar(MainWindowForBevelTool) self.statusbar.setObjectName("statusbar") MainWindowForBevelTool.setStatusBar(self.statusbar) self.simpleBevelOptionsAction = QtWidgets.QAction( MainWindowForBevelTool) self.simpleBevelOptionsAction.setCheckable(True) self.simpleBevelOptionsAction.setChecked(False) self.simpleBevelOptionsAction.setShortcutContext( QtCore.Qt.WidgetWithChildrenShortcut) self.simpleBevelOptionsAction.setObjectName("simpleBevelOptionsAction") self.fullBevelOptionsAction = QtWidgets.QAction(MainWindowForBevelTool) self.fullBevelOptionsAction.setCheckable(True) self.fullBevelOptionsAction.setObjectName("fullBevelOptionsAction") self.hardEdgesAction = QtWidgets.QAction(MainWindowForBevelTool) self.hardEdgesAction.setObjectName("hardEdgesAction") self.bevelSetEditorAction = QtWidgets.QAction(MainWindowForBevelTool) self.bevelSetEditorAction.setCheckable(True) self.bevelSetEditorAction.setObjectName("bevelSetEditorAction") self.menuEdit.addAction(self.simpleBevelOptionsAction) self.menuEdit.addAction(self.fullBevelOptionsAction) self.menuEdit.addAction(self.bevelSetEditorAction) self.menubar.addAction(self.menuEdit.menuAction()) self.retranslateUi(MainWindowForBevelTool) QtCore.QMetaObject.connectSlotsByName(MainWindowForBevelTool)
def __init__(self, icon, path, parent=None): QtWidgets.QSystemTrayIcon.__init__(self, icon, parent) self.setToolTip(f'Nasa wallpaper changer v1.2') self.project_path = path self.internetTimer = QtCore.QTimer() self.startTimer(5000) self.internet = internet_on() menu = QtWidgets.QMenu(parent) switch_back = menu.addAction("Change wallpaper one back") switch_back.triggered.connect(self.switch_back) switch_back.setIcon(QtGui.QIcon("Actions-go-previous-icon.png")) switch_next = menu.addAction("Change wallpaper one forward") switch_next.triggered.connect(self.switch_next) switch_next.setIcon(QtGui.QIcon("Actions-go-next-icon.png")) switch_current = menu.addAction("Change wallpaper to newest") switch_current.triggered.connect(self.switch_current) switch_current.setIcon(QtGui.QIcon("current-icon.png")) delete = menu.addAction("Delete picture") delete.triggered.connect(self.delete) delete.setIcon(QtGui.QIcon("delete.png")) info = menu.addAction("Picture info") info.triggered.connect(self.info) info.setIcon(QtGui.QIcon("Info-icon.png")) exit_ = menu.addAction("Exit") exit_.triggered.connect(lambda: sys.exit()) exit_.setIcon(QtGui.QIcon("Close-2-icon.png")) menu.addSeparator() self.setContextMenu(menu) self.activated.connect(self.onTrayIconActivated)
def _selectStatusSetup(self, layout): """Sets up the select status menu, adds it to the given layout @param layout: The layout to add the menu to @type layout: QLayout""" btn = QtWidgets.QPushButton("Select Status") btn.setFocusPolicy(QtCore.Qt.NoFocus) btn.setContentsMargins(0, 0, 0, 0) btn.setFlat(True) layout.addWidget(btn) self.select_status_btn = btn menu = QtWidgets.QMenu(self) btn.setMenu(menu) menu.triggered.connect(self._selectStatusHandle) for item in [ "Clear", None, "Succeeded", "Running", "Waiting", "Depend", "Dead", "Eaten" ]: if item: menu.addAction(item) else: menu.addSeparator()
def pop_menu(self, listwidget): # custom Context Menu listwidget.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) listwidget.customContextMenuRequested.connect( partial(self.context_menu, listwidget)) self.pop_menu = QtWidgets.QMenu(self) self.action_rename = QtWidgets.QAction(self) self.action_rename.setObjectName('action_rename') self.action_rename.setText('Rename') self.pop_menu.addAction(self.action_rename) self.action_remove = QtWidgets.QAction(self) self.action_remove.setObjectName('action_remove') self.action_remove.setText('Remove') self.pop_menu.addAction(self.action_remove) self.action_rename.triggered.connect(self.rename_item) self.action_remove.triggered.connect(self.remove_items) for each_actions in [self.action_rename, self.action_remove]: icon_name = str(each_actions.objectName()).split('_')[-1] current_icon = os.path.join(resources.getIconPath(), '{}.png'.format(icon_name)) icon = QtGui.QIcon() icon.addPixmap(QtGui.QPixmap(current_icon), QtGui.QIcon.Normal, QtGui.QIcon.Off) each_actions.setIcon(icon)
def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(731, 475) self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") self.gridLayout = QtWidgets.QGridLayout(self.centralwidget) self.gridLayout.setObjectName("gridLayout") self.textEdit = QtWidgets.QTextEdit(self.centralwidget) self.textEdit.setObjectName("textEdit") self.gridLayout.addWidget(self.textEdit, 0, 0, 1, 1) MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtWidgets.QMenuBar(MainWindow) self.menubar.setGeometry(QtCore.QRect(0, 0, 731, 21)) self.menubar.setObjectName("menubar") self.menu_File = QtWidgets.QMenu(self.menubar) self.menu_File.setObjectName("menu_File") MainWindow.setMenuBar(self.menubar) self.statusbar = QtWidgets.QStatusBar(MainWindow) self.statusbar.setObjectName("statusbar") MainWindow.setStatusBar(self.statusbar) self.actionShow_CCPL = QtWidgets.QAction(MainWindow) self.actionShow_CCPL.setObjectName("actionShow_CCPL") self.action_About = QtWidgets.QAction(MainWindow) self.action_About.setObjectName("action_About") self.action_Close = QtWidgets.QAction(MainWindow) self.action_Close.setCheckable(False) self.action_Close.setObjectName("action_Close") self.menu_File.addAction(self.actionShow_CCPL) self.menu_File.addAction(self.action_About) self.menu_File.addAction(self.action_Close) self.menubar.addAction(self.menu_File.menuAction()) self.retranslateUi(MainWindow) QtCore.QObject.connect(self.action_Close, QtCore.SIGNAL("triggered()"), MainWindow.close) QtCore.QMetaObject.connectSlotsByName(MainWindow)
def tab_menu(self, *args): """ Menu for the overall tab widget. """ if 'script' not in self.data: return menu = QtWidgets.QMenu() menu.addAction('Refresh Tab', self.process_script) menu.addAction( 'Copy Script Path to Clipboard', lambda: QtGui.QClipboard().setText(self.data.get('script'))) menu.addAction( 'Open Script in Default Editor', lambda: os.system('start {}'.format(self.data.get('script')))) if self.data.get('excluded'): menu.addSeparator() hidden_menu = menu.addMenu('Include Excluded Button(s)') for button in self.data.get('excluded', []): hidden_menu.addAction(button, partial(self.remove_exclude, button)) menu.addAction('Include All Excluded Buttons', self.remove_exclude) menu.exec_(QtGui.QCursor.pos())
def __init__(self, parent=None): super().__init__(parent=parent) self._currvalue = None self._options = [] self._menu = QtWidgets.QMenu(self) self._menu.setFixedWidth(self.width()) self._menu.setStyleSheet("""QMenu::item { max-height: 12px; margin: -2px; border: 3px solid #4d4d4d; padding-left:3px; }""") self._menu.aboutToShow.connect(self._setMenuSize) self.setMenu(self._menu) self.clearFocus() self.setStyleSheet("""QPushButton { background: #262626; height: 12px; border: 1px solid #4d4d4d; } QPushButton:hover { background: #1a1a1a; } QPushButton::menu-indicator { image: url(%s); subcontrol-position: right center; subcontrol-origin: padding; left: -2px; }""" % (icon.getIcon("dropdown_icon.png").replace(os.sep, '/')))
def pulsadoShortcutF12(self): if not self.trayIcon: restoreAction = QtWidgets.QAction(Iconos.PGN(), _("Show"), self, triggered=self.restauraTrayIcon) quitAction = QtWidgets.QAction(Iconos.Terminar(), _("Quit"), self, triggered=self.quitTrayIcon) trayIconMenu = QtWidgets.QMenu(self) trayIconMenu.addAction(restoreAction) trayIconMenu.addSeparator() trayIconMenu.addAction(quitAction) self.trayIcon = QtWidgets.QSystemTrayIcon(self) self.trayIcon.setContextMenu(trayIconMenu) self.trayIcon.setIcon(Iconos.Otros()) # Aplicacion()) self.trayIcon.activated.connect(self.activateTrayIcon) self.trayIcon.hide() if self.trayIcon: self.trayIcon.show() self.hide()
def _create_menu_bar(self): """ creates the menu bar :return: QtWidgets.QMenuBar """ self._menu_bar = QtWidgets.QMenuBar() prefs_menu = QtWidgets.QMenu("Preferences") prefs_menu.setToolTipsVisible(True) self._menu_bar.addMenu(prefs_menu) display_action = QtWidgets.QAction("Item Display", prefs_menu) display_action.setToolTip("Attribute item visibility preference's") display_action.triggered.connect(self.signal_display_prefs.emit) prefs_menu.addAction(display_action) self._restrict_action = QtWidgets.QAction("Restrict to current type", prefs_menu, checkable=True) self._restrict_action.setToolTip( "Restrict the editor to only apply attributes\n" "to objects of the same type as currently set") self._restrict_action.setChecked(True) prefs_menu.addAction(self._restrict_action) self._affect_children_action = QtWidgets.QAction("Affect children", prefs_menu, checkable=True) self._affect_children_action.setToolTip( "applies the attribute to all children of" "the current selection") self._affect_children_action.setChecked(True) prefs_menu.addAction(self._affect_children_action) # TODO: Implement help menu # self._menu_bar.addMenu("Help") return self._menu_bar
def __init__(self): super(Demo, self).__init__() w = QtWidgets.QWidget(self) self.setCentralWidget(w) lyt = QtWidgets.QVBoxLayout(w) w.setLayout(lyt) lyt.addWidget(QtWidgets.QLabel('a simple list:')) list_items = 'mango banana apple kiwi apple strawberry'.split() self.widget1 = A2List(self, list_items) lyt.addWidget(self.widget1) self.widget1.items_selected.connect(self.on_things_selection) self.widget1.names_selected.connect(self.on_things_selection) self.widget1.single_item_selected.connect(self.on_thing_selection) self.widget1.single_name_selected.connect(self.on_thing_selection) self.widget1.changed.connect(self.changed1) self.widget1.context_menu_requested.connect(self.build_context_menu) lyt.addWidget(QtWidgets.QLabel('a height adjusted list:')) self.widget2 = A2ListCompact(self) lyt.addWidget(self.widget2) self.widget2.items_selected.connect(self.on_things_selection) self.widget2.names_selected.connect(self.on_things_selection) self.widget2.single_item_selected.connect(self.on_thing_selection) self.widget2.single_name_selected.connect(self.on_thing_selection) self.widget2.changed.connect(self.changed2) menu = QtWidgets.QMenu(self) menu.addAction('blank action static menu') self.widget2.set_context_menu(menu) button = QtWidgets.QPushButton('add random') button.clicked.connect(self.bla) lyt.addWidget(button)
def create_menu(self, event): menu = QtWidgets.QMenu('TD') menu.addAction('Test1', self.show_test1) menu.addAction('Test2', self.show_test2) event.menu.addMenu(menu)
def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(2107, 1721) MainWindow.setAcceptDrops(True) icon = QtGui.QIcon() icon.addPixmap(QtGui.QPixmap(":/icons/Dave_icon.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) MainWindow.setWindowIcon(icon) MainWindow.setLocale(QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedStates)) self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.centralwidget) self.horizontalLayout_2.setObjectName("horizontalLayout_2") self.frame3d = QtWidgets.QFrame(self.centralwidget) self.frame3d.setAcceptDrops(False) self.frame3d.setFrameShape(QtWidgets.QFrame.NoFrame) self.frame3d.setFrameShadow(QtWidgets.QFrame.Raised) self.frame3d.setObjectName("frame3d") self.label_2 = QtWidgets.QLabel(self.frame3d) self.label_2.setGeometry(QtCore.QRect(580, 410, 161, 20)) self.label_2.setObjectName("label_2") self.horizontalLayout_2.addWidget(self.frame3d) MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtWidgets.QMenuBar(MainWindow) self.menubar.setGeometry(QtCore.QRect(0, 0, 2107, 31)) self.menubar.setObjectName("menubar") self.menuSolve_Statics = QtWidgets.QMenu(self.menubar) self.menuSolve_Statics.setObjectName("menuSolve_Statics") self.menuView = QtWidgets.QMenu(self.menubar) self.menuView.setObjectName("menuView") self.menuView_2 = QtWidgets.QMenu(self.menubar) self.menuView_2.setObjectName("menuView_2") self.menuWhat_if = QtWidgets.QMenu(self.menubar) self.menuWhat_if.setObjectName("menuWhat_if") self.menuMarine = QtWidgets.QMenu(self.menubar) self.menuMarine.setObjectName("menuMarine") self.menuRender = QtWidgets.QMenu(self.menubar) self.menuRender.setObjectName("menuRender") self.menuDynamics = QtWidgets.QMenu(self.menubar) self.menuDynamics.setObjectName("menuDynamics") MainWindow.setMenuBar(self.menubar) self.dockWidget = QtWidgets.QDockWidget(MainWindow) self.dockWidget.setFeatures(QtWidgets.QDockWidget.DockWidgetFloatable|QtWidgets.QDockWidget.DockWidgetMovable) self.dockWidget.setObjectName("dockWidget") self.dockWidgetContents = QtWidgets.QWidget() self.dockWidgetContents.setObjectName("dockWidgetContents") self.gridLayout = QtWidgets.QGridLayout(self.dockWidgetContents) self.gridLayout.setObjectName("gridLayout") self.treeView = QtWidgets.QTreeView(self.dockWidgetContents) self.treeView.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers) self.treeView.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection) self.treeView.setRootIsDecorated(True) self.treeView.setExpandsOnDoubleClick(False) self.treeView.setObjectName("treeView") self.treeView.header().setVisible(False) self.gridLayout.addWidget(self.treeView, 0, 0, 1, 1) self.dockWidget.setWidget(self.dockWidgetContents) MainWindow.addDockWidget(QtCore.Qt.DockWidgetArea(1), self.dockWidget) self.dockWidget_2 = QtWidgets.QDockWidget(MainWindow) self.dockWidget_2.setObjectName("dockWidget_2") self.dockWidgetContents_2 = QtWidgets.QWidget() self.dockWidgetContents_2.setObjectName("dockWidgetContents_2") self.horizontalLayout_4 = QtWidgets.QHBoxLayout(self.dockWidgetContents_2) self.horizontalLayout_4.setObjectName("horizontalLayout_4") self.frame_3 = QtWidgets.QFrame(self.dockWidgetContents_2) self.frame_3.setFrameShape(QtWidgets.QFrame.StyledPanel) self.frame_3.setFrameShadow(QtWidgets.QFrame.Raised) self.frame_3.setObjectName("frame_3") self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.frame_3) self.verticalLayout_2.setObjectName("verticalLayout_2") self.pbGenerateSceneCode = QtWidgets.QPushButton(self.frame_3) self.pbGenerateSceneCode.setObjectName("pbGenerateSceneCode") self.verticalLayout_2.addWidget(self.pbGenerateSceneCode) self.pbCopyFeedback = QtWidgets.QPushButton(self.frame_3) self.pbCopyFeedback.setObjectName("pbCopyFeedback") self.verticalLayout_2.addWidget(self.pbCopyFeedback) self.horizontalLayout_4.addWidget(self.frame_3) self.teFeedback = QtWidgets.QTextEdit(self.dockWidgetContents_2) self.teFeedback.setAutoFillBackground(False) self.teFeedback.setFrameShape(QtWidgets.QFrame.StyledPanel) self.teFeedback.setObjectName("teFeedback") self.horizontalLayout_4.addWidget(self.teFeedback) self.dockWidget_2.setWidget(self.dockWidgetContents_2) MainWindow.addDockWidget(QtCore.Qt.DockWidgetArea(8), self.dockWidget_2) self.dockWidget_3 = QtWidgets.QDockWidget(MainWindow) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Minimum) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.dockWidget_3.sizePolicy().hasHeightForWidth()) self.dockWidget_3.setSizePolicy(sizePolicy) self.dockWidget_3.setFloating(True) self.dockWidget_3.setFeatures(QtWidgets.QDockWidget.DockWidgetFloatable|QtWidgets.QDockWidget.DockWidgetMovable) self.dockWidget_3.setAllowedAreas(QtCore.Qt.LeftDockWidgetArea|QtCore.Qt.RightDockWidgetArea) self.dockWidget_3.setObjectName("dockWidget_3") self.dockWidgetContents_3 = QtWidgets.QWidget() sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Minimum) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.dockWidgetContents_3.sizePolicy().hasHeightForWidth()) self.dockWidgetContents_3.setSizePolicy(sizePolicy) self.dockWidgetContents_3.setObjectName("dockWidgetContents_3") self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.dockWidgetContents_3) self.verticalLayout_3.setObjectName("verticalLayout_3") self.widgetLayout = QtWidgets.QVBoxLayout() self.widgetLayout.setSpacing(0) self.widgetLayout.setSizeConstraint(QtWidgets.QLayout.SetMinimumSize) self.widgetLayout.setObjectName("widgetLayout") self.verticalLayout_3.addLayout(self.widgetLayout) self.dockWidget_3.setWidget(self.dockWidgetContents_3) MainWindow.addDockWidget(QtCore.Qt.DockWidgetArea(2), self.dockWidget_3) self.pythonDockWidget = QtWidgets.QDockWidget(MainWindow) self.pythonDockWidget.setFloating(True) self.pythonDockWidget.setFeatures(QtWidgets.QDockWidget.AllDockWidgetFeatures) self.pythonDockWidget.setObjectName("pythonDockWidget") self.dockWidgetContents_4 = QtWidgets.QWidget() self.dockWidgetContents_4.setObjectName("dockWidgetContents_4") self.verticalLayout = QtWidgets.QVBoxLayout(self.dockWidgetContents_4) self.verticalLayout.setObjectName("verticalLayout") self.label = QtWidgets.QLabel(self.dockWidgetContents_4) self.label.setObjectName("label") self.verticalLayout.addWidget(self.label) self.teHistory = QtWidgets.QTextEdit(self.dockWidgetContents_4) self.teHistory.setReadOnly(True) self.teHistory.setObjectName("teHistory") self.verticalLayout.addWidget(self.teHistory) self.frame_2 = QtWidgets.QFrame(self.dockWidgetContents_4) self.frame_2.setFrameShape(QtWidgets.QFrame.StyledPanel) self.frame_2.setFrameShadow(QtWidgets.QFrame.Raised) self.frame_2.setObjectName("frame_2") self.horizontalLayout = QtWidgets.QHBoxLayout(self.frame_2) self.horizontalLayout.setObjectName("horizontalLayout") self.pbCopyHistory = QtWidgets.QPushButton(self.frame_2) self.pbCopyHistory.setObjectName("pbCopyHistory") self.horizontalLayout.addWidget(self.pbCopyHistory) self.pbStartOver = QtWidgets.QPushButton(self.frame_2) self.pbStartOver.setObjectName("pbStartOver") self.horizontalLayout.addWidget(self.pbStartOver) self.verticalLayout.addWidget(self.frame_2) self.label_3 = QtWidgets.QLabel(self.dockWidgetContents_4) self.label_3.setObjectName("label_3") self.verticalLayout.addWidget(self.label_3) self.teCode = QtWidgets.QTextEdit(self.dockWidgetContents_4) self.teCode.setObjectName("teCode") self.verticalLayout.addWidget(self.teCode) self.cbAutoExecute = QtWidgets.QCheckBox(self.dockWidgetContents_4) self.cbAutoExecute.setChecked(True) self.cbAutoExecute.setObjectName("cbAutoExecute") self.verticalLayout.addWidget(self.cbAutoExecute) self.cbAutoStatics = QtWidgets.QCheckBox(self.dockWidgetContents_4) self.cbAutoStatics.setObjectName("cbAutoStatics") self.verticalLayout.addWidget(self.cbAutoStatics) self.frame = QtWidgets.QFrame(self.dockWidgetContents_4) self.frame.setFrameShape(QtWidgets.QFrame.StyledPanel) self.frame.setFrameShadow(QtWidgets.QFrame.Raised) self.frame.setObjectName("frame") self.horizontalLayout_3 = QtWidgets.QHBoxLayout(self.frame) self.horizontalLayout_3.setObjectName("horizontalLayout_3") self.pbRunCode = QtWidgets.QPushButton(self.frame) self.pbRunCode.setObjectName("pbRunCode") self.horizontalLayout_3.addWidget(self.pbRunCode) self.verticalLayout.addWidget(self.frame) self.pythonDockWidget.setWidget(self.dockWidgetContents_4) MainWindow.addDockWidget(QtCore.Qt.DockWidgetArea(2), self.pythonDockWidget) self.toolBar = QtWidgets.QToolBar(MainWindow) self.toolBar.setObjectName("toolBar") MainWindow.addToolBar(QtCore.Qt.TopToolBarArea, self.toolBar) self.dockWidget_4 = QtWidgets.QDockWidget(MainWindow) self.dockWidget_4.setFeatures(QtWidgets.QDockWidget.DockWidgetFloatable|QtWidgets.QDockWidget.DockWidgetMovable) self.dockWidget_4.setObjectName("dockWidget_4") self.dockWidgetContents_5 = QtWidgets.QWidget() self.dockWidgetContents_5.setObjectName("dockWidgetContents_5") self.gridLayout_2 = QtWidgets.QGridLayout(self.dockWidgetContents_5) self.gridLayout_2.setObjectName("gridLayout_2") self.dispPropTree = QtWidgets.QTreeWidget(self.dockWidgetContents_5) self.dispPropTree.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers) self.dispPropTree.setAlternatingRowColors(True) self.dispPropTree.setRootIsDecorated(False) self.dispPropTree.setObjectName("dispPropTree") item_0 = QtWidgets.QTreeWidgetItem(self.dispPropTree) item_1 = QtWidgets.QTreeWidgetItem(item_0) self.dispPropTree.header().setVisible(False) self.gridLayout_2.addWidget(self.dispPropTree, 0, 0, 1, 1) self.dockWidget_4.setWidget(self.dockWidgetContents_5) MainWindow.addDockWidget(QtCore.Qt.DockWidgetArea(1), self.dockWidget_4) self.goalseekDockWidget = QtWidgets.QDockWidget(MainWindow) self.goalseekDockWidget.setFloating(True) self.goalseekDockWidget.setObjectName("goalseekDockWidget") self.dockWidgetContents_6 = QtWidgets.QWidget() self.dockWidgetContents_6.setObjectName("dockWidgetContents_6") self.gridLayout_3 = QtWidgets.QGridLayout(self.dockWidgetContents_6) self.gridLayout_3.setObjectName("gridLayout_3") self.label_9 = QtWidgets.QLabel(self.dockWidgetContents_6) self.label_9.setObjectName("label_9") self.gridLayout_3.addWidget(self.label_9, 1, 4, 1, 1) self.label_4 = QtWidgets.QLabel(self.dockWidgetContents_6) self.label_4.setObjectName("label_4") self.gridLayout_3.addWidget(self.label_4, 0, 0, 1, 2) self.label_5 = QtWidgets.QLabel(self.dockWidgetContents_6) self.label_5.setObjectName("label_5") self.gridLayout_3.addWidget(self.label_5, 1, 0, 1, 1) self.gsValue = QtWidgets.QLineEdit(self.dockWidgetContents_6) self.gsValue.setObjectName("gsValue") self.gridLayout_3.addWidget(self.gsValue, 1, 2, 1, 1) self.gsSetProp = QtWidgets.QLineEdit(self.dockWidgetContents_6) self.gsSetProp.setObjectName("gsSetProp") self.gridLayout_3.addWidget(self.gsSetProp, 0, 2, 1, 1) self.gsSetNode = QtWidgets.QLineEdit(self.dockWidgetContents_6) self.gsSetNode.setObjectName("gsSetNode") self.gridLayout_3.addWidget(self.gsSetNode, 0, 4, 1, 1) self.gsChangeProp = QtWidgets.QLineEdit(self.dockWidgetContents_6) self.gsChangeProp.setObjectName("gsChangeProp") self.gridLayout_3.addWidget(self.gsChangeProp, 2, 2, 1, 1) self.label_6 = QtWidgets.QLabel(self.dockWidgetContents_6) self.label_6.setObjectName("label_6") self.gridLayout_3.addWidget(self.label_6, 2, 0, 1, 1) self.gsChangeNode = QtWidgets.QLineEdit(self.dockWidgetContents_6) self.gsChangeNode.setObjectName("gsChangeNode") self.gridLayout_3.addWidget(self.gsChangeNode, 2, 4, 1, 1) self.label_7 = QtWidgets.QLabel(self.dockWidgetContents_6) self.label_7.setObjectName("label_7") self.gridLayout_3.addWidget(self.label_7, 0, 3, 1, 1) self.label_8 = QtWidgets.QLabel(self.dockWidgetContents_6) self.label_8.setObjectName("label_8") self.gridLayout_3.addWidget(self.label_8, 2, 3, 1, 1) self.btnGoalSeek = QtWidgets.QPushButton(self.dockWidgetContents_6) self.btnGoalSeek.setObjectName("btnGoalSeek") self.gridLayout_3.addWidget(self.btnGoalSeek, 3, 4, 1, 1) self.goalseekDockWidget.setWidget(self.dockWidgetContents_6) MainWindow.addDockWidget(QtCore.Qt.DockWidgetArea(1), self.goalseekDockWidget) self.stabilityDockWidget = QtWidgets.QDockWidget(MainWindow) self.stabilityDockWidget.setFloating(True) self.stabilityDockWidget.setObjectName("stabilityDockWidget") self.dockWidgetContents_7 = QtWidgets.QWidget() self.dockWidgetContents_7.setObjectName("dockWidgetContents_7") self.gridLayout_4 = QtWidgets.QGridLayout(self.dockWidgetContents_7) self.gridLayout_4.setObjectName("gridLayout_4") self.label_10 = QtWidgets.QLabel(self.dockWidgetContents_7) self.label_10.setObjectName("label_10") self.gridLayout_4.addWidget(self.label_10, 0, 4, 1, 1) self.stability_displacement = QtWidgets.QDoubleSpinBox(self.dockWidgetContents_7) self.stability_displacement.setMaximum(999999999999999.0) self.stability_displacement.setProperty("value", 1.0) self.stability_displacement.setObjectName("stability_displacement") self.gridLayout_4.addWidget(self.stability_displacement, 1, 1, 1, 3) self.stability_node_name = QtWidgets.QLineEdit(self.dockWidgetContents_7) self.stability_node_name.setObjectName("stability_node_name") self.gridLayout_4.addWidget(self.stability_node_name, 0, 1, 1, 3) self.label_17 = QtWidgets.QLabel(self.dockWidgetContents_7) self.label_17.setObjectName("label_17") self.gridLayout_4.addWidget(self.label_17, 1, 4, 1, 1) self.label_11 = QtWidgets.QLabel(self.dockWidgetContents_7) self.label_11.setObjectName("label_11") self.gridLayout_4.addWidget(self.label_11, 0, 0, 1, 1) self.label_12 = QtWidgets.QLabel(self.dockWidgetContents_7) self.label_12.setObjectName("label_12") self.gridLayout_4.addWidget(self.label_12, 2, 0, 1, 1) self.label_16 = QtWidgets.QLabel(self.dockWidgetContents_7) self.label_16.setObjectName("label_16") self.gridLayout_4.addWidget(self.label_16, 1, 0, 1, 1) self.label_13 = QtWidgets.QLabel(self.dockWidgetContents_7) self.label_13.setObjectName("label_13") self.gridLayout_4.addWidget(self.label_13, 8, 0, 1, 1) self.stability_heel_max = QtWidgets.QSpinBox(self.dockWidgetContents_7) self.stability_heel_max.setProperty("value", 60) self.stability_heel_max.setObjectName("stability_heel_max") self.gridLayout_4.addWidget(self.stability_heel_max, 2, 3, 1, 1) self.stability_n_steps = QtWidgets.QSpinBox(self.dockWidgetContents_7) self.stability_n_steps.setProperty("value", 60) self.stability_n_steps.setObjectName("stability_n_steps") self.gridLayout_4.addWidget(self.stability_n_steps, 3, 1, 1, 2) self.stability_heel_start = QtWidgets.QSpinBox(self.dockWidgetContents_7) self.stability_heel_start.setMinimum(-180) self.stability_heel_start.setMaximum(20) self.stability_heel_start.setObjectName("stability_heel_start") self.gridLayout_4.addWidget(self.stability_heel_start, 2, 1, 1, 1) self.stability_do_teardown = QtWidgets.QCheckBox(self.dockWidgetContents_7) self.stability_do_teardown.setChecked(True) self.stability_do_teardown.setObjectName("stability_do_teardown") self.gridLayout_4.addWidget(self.stability_do_teardown, 8, 1, 1, 2) self.stability_trim = QtWidgets.QCheckBox(self.dockWidgetContents_7) self.stability_trim.setChecked(True) self.stability_trim.setObjectName("stability_trim") self.gridLayout_4.addWidget(self.stability_trim, 7, 1, 1, 2) self.label_18 = QtWidgets.QLabel(self.dockWidgetContents_7) self.label_18.setObjectName("label_18") self.gridLayout_4.addWidget(self.label_18, 3, 0, 1, 1) self.label_14 = QtWidgets.QLabel(self.dockWidgetContents_7) self.label_14.setAlignment(QtCore.Qt.AlignCenter) self.label_14.setObjectName("label_14") self.gridLayout_4.addWidget(self.label_14, 2, 2, 1, 1) self.stability_sway = QtWidgets.QCheckBox(self.dockWidgetContents_7) self.stability_sway.setObjectName("stability_sway") self.gridLayout_4.addWidget(self.stability_sway, 5, 1, 1, 2) self.stability_yaw = QtWidgets.QCheckBox(self.dockWidgetContents_7) self.stability_yaw.setObjectName("stability_yaw") self.gridLayout_4.addWidget(self.stability_yaw, 6, 1, 1, 2) self.stability_surge = QtWidgets.QCheckBox(self.dockWidgetContents_7) self.stability_surge.setObjectName("stability_surge") self.gridLayout_4.addWidget(self.stability_surge, 4, 1, 1, 2) self.label_15 = QtWidgets.QLabel(self.dockWidgetContents_7) self.label_15.setObjectName("label_15") self.gridLayout_4.addWidget(self.label_15, 2, 4, 1, 1) self.stability_go = QtWidgets.QPushButton(self.dockWidgetContents_7) self.stability_go.setObjectName("stability_go") self.gridLayout_4.addWidget(self.stability_go, 9, 3, 1, 2) self.stabilityDockWidget.setWidget(self.dockWidgetContents_7) MainWindow.addDockWidget(QtCore.Qt.DockWidgetArea(1), self.stabilityDockWidget) self.actionSave_scene = QtWidgets.QAction(MainWindow) self.actionSave_scene.setObjectName("actionSave_scene") self.actionImport_sub_scene = QtWidgets.QAction(MainWindow) self.actionImport_sub_scene.setObjectName("actionImport_sub_scene") self.actionNew = QtWidgets.QAction(MainWindow) self.actionNew.setObjectName("actionNew") self.actionHorizontal_camera = QtWidgets.QAction(MainWindow) self.actionHorizontal_camera.setObjectName("actionHorizontal_camera") self.action = QtWidgets.QAction(MainWindow) self.action.setObjectName("action") self.action2D_mode = QtWidgets.QAction(MainWindow) self.action2D_mode.setCheckable(True) self.action2D_mode.setObjectName("action2D_mode") self.actionDark_mode = QtWidgets.QAction(MainWindow) self.actionDark_mode.setCheckable(False) self.actionDark_mode.setObjectName("actionDark_mode") self.actionShow_visuals = QtWidgets.QAction(MainWindow) self.actionShow_visuals.setCheckable(True) self.actionShow_visuals.setChecked(True) self.actionShow_visuals.setObjectName("actionShow_visuals") self.actionShow_Geometry_elements = QtWidgets.QAction(MainWindow) self.actionShow_Geometry_elements.setCheckable(True) self.actionShow_Geometry_elements.setChecked(True) self.actionShow_Geometry_elements.setObjectName("actionShow_Geometry_elements") self.actionShow_force_applyting_element = QtWidgets.QAction(MainWindow) self.actionShow_force_applyting_element.setCheckable(True) self.actionShow_force_applyting_element.setChecked(True) self.actionShow_force_applyting_element.setObjectName("actionShow_force_applyting_element") self.actionSet_all_visible = QtWidgets.QAction(MainWindow) self.actionSet_all_visible.setObjectName("actionSet_all_visible") self.actionSet_all_hidden = QtWidgets.QAction(MainWindow) self.actionSet_all_hidden.setObjectName("actionSet_all_hidden") self.actionFull_refresh = QtWidgets.QAction(MainWindow) self.actionFull_refresh.setObjectName("actionFull_refresh") self.actionShow_water_plane = QtWidgets.QAction(MainWindow) self.actionShow_water_plane.setCheckable(True) self.actionShow_water_plane.setChecked(False) self.actionShow_water_plane.setObjectName("actionShow_water_plane") self.actionAdd_light = QtWidgets.QAction(MainWindow) self.actionAdd_light.setObjectName("actionAdd_light") self.actionShow_all_forces_at_same_size = QtWidgets.QAction(MainWindow) self.actionShow_all_forces_at_same_size.setCheckable(True) self.actionShow_all_forces_at_same_size.setChecked(True) self.actionShow_all_forces_at_same_size.setObjectName("actionShow_all_forces_at_same_size") self.actionIncrease_force_size = QtWidgets.QAction(MainWindow) self.actionIncrease_force_size.setObjectName("actionIncrease_force_size") self.actionDecrease_force_size = QtWidgets.QAction(MainWindow) self.actionDecrease_force_size.setObjectName("actionDecrease_force_size") self.actionIncrease_Geometry_size = QtWidgets.QAction(MainWindow) self.actionIncrease_Geometry_size.setObjectName("actionIncrease_Geometry_size") self.actionDecrease_Geometry_size = QtWidgets.QAction(MainWindow) self.actionDecrease_Geometry_size.setObjectName("actionDecrease_Geometry_size") self.actionPython_console = QtWidgets.QAction(MainWindow) self.actionPython_console.setObjectName("actionPython_console") self.actionGoal_seek = QtWidgets.QAction(MainWindow) self.actionGoal_seek.setObjectName("actionGoal_seek") self.actionStability_curve = QtWidgets.QAction(MainWindow) self.actionStability_curve.setObjectName("actionStability_curve") self.actionOptimize = QtWidgets.QAction(MainWindow) self.actionOptimize.setObjectName("actionOptimize") self.actionOpen = QtWidgets.QAction(MainWindow) self.actionOpen.setObjectName("actionOpen") self.actionImport_browser = QtWidgets.QAction(MainWindow) self.actionImport_browser.setObjectName("actionImport_browser") self.actionRender_current_view = QtWidgets.QAction(MainWindow) self.actionRender_current_view.setObjectName("actionRender_current_view") self.actionModal_shapes = QtWidgets.QAction(MainWindow) self.actionModal_shapes.setObjectName("actionModal_shapes") self.actionInertia_properties = QtWidgets.QAction(MainWindow) self.actionInertia_properties.setObjectName("actionInertia_properties") self.menuSolve_Statics.addAction(self.actionNew) self.menuSolve_Statics.addSeparator() self.menuSolve_Statics.addAction(self.actionOpen) self.menuSolve_Statics.addAction(self.actionImport_sub_scene) self.menuSolve_Statics.addAction(self.actionImport_browser) self.menuSolve_Statics.addSeparator() self.menuSolve_Statics.addAction(self.actionSave_scene) self.menuView.addAction(self.actionHorizontal_camera) self.menuView.addSeparator() self.menuView.addAction(self.action2D_mode) self.menuView.addSeparator() self.menuView.addAction(self.actionAdd_light) self.menuView.addAction(self.actionDark_mode) self.menuView.addSeparator() self.menuView.addAction(self.actionShow_all_forces_at_same_size) self.menuView.addAction(self.actionIncrease_force_size) self.menuView.addAction(self.actionDecrease_force_size) self.menuView.addSeparator() self.menuView.addAction(self.actionIncrease_Geometry_size) self.menuView.addAction(self.actionDecrease_Geometry_size) self.menuView.addSeparator() self.menuView.addAction(self.actionShow_visuals) self.menuView.addAction(self.actionShow_Geometry_elements) self.menuView.addAction(self.actionShow_force_applyting_element) self.menuView.addAction(self.actionShow_water_plane) self.menuView.addSeparator() self.menuView.addAction(self.actionSet_all_visible) self.menuView.addAction(self.actionSet_all_hidden) self.menuView.addSeparator() self.menuView.addAction(self.actionFull_refresh) self.menuView_2.addAction(self.actionPython_console) self.menuWhat_if.addAction(self.actionGoal_seek) self.menuWhat_if.addAction(self.actionOptimize) self.menuMarine.addAction(self.actionStability_curve) self.menuRender.addAction(self.actionRender_current_view) self.menuDynamics.addAction(self.actionModal_shapes) self.menuDynamics.addAction(self.actionInertia_properties) self.menubar.addAction(self.menuSolve_Statics.menuAction()) self.menubar.addAction(self.menuView.menuAction()) self.menubar.addAction(self.menuView_2.menuAction()) self.menubar.addAction(self.menuWhat_if.menuAction()) self.menubar.addAction(self.menuMarine.menuAction()) self.menubar.addAction(self.menuRender.menuAction()) self.menubar.addAction(self.menuDynamics.menuAction()) self.toolBar.addSeparator() self.retranslateUi(MainWindow) QtCore.QMetaObject.connectSlotsByName(MainWindow) MainWindow.setTabOrder(self.pbCopyHistory, self.pbCopyFeedback) MainWindow.setTabOrder(self.pbCopyFeedback, self.teFeedback) MainWindow.setTabOrder(self.teFeedback, self.teHistory) MainWindow.setTabOrder(self.teHistory, self.gsSetProp) MainWindow.setTabOrder(self.gsSetProp, self.gsSetNode) MainWindow.setTabOrder(self.gsSetNode, self.gsValue) MainWindow.setTabOrder(self.gsValue, self.gsChangeProp) MainWindow.setTabOrder(self.gsChangeProp, self.gsChangeNode) MainWindow.setTabOrder(self.gsChangeNode, self.btnGoalSeek) MainWindow.setTabOrder(self.btnGoalSeek, self.pbRunCode) MainWindow.setTabOrder(self.pbRunCode, self.dispPropTree) MainWindow.setTabOrder(self.dispPropTree, self.cbAutoStatics) MainWindow.setTabOrder(self.cbAutoStatics, self.pbGenerateSceneCode) MainWindow.setTabOrder(self.pbGenerateSceneCode, self.pbStartOver) MainWindow.setTabOrder(self.pbStartOver, self.treeView) MainWindow.setTabOrder(self.treeView, self.teCode) MainWindow.setTabOrder(self.teCode, self.cbAutoExecute)
def testQMenuAddAction(self): fileMenu = QtWidgets.QMenu("&File") addNewAction = fileMenu.addAction("&Open...", self.openFile) addNewAction.trigger() self.assertEqual(self.arg, ())
def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(1349, 961) self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") self.frame_TaskPanel = QtWidgets.QFrame(self.centralwidget) self.frame_TaskPanel.setGeometry(QtCore.QRect(520, 10, 811, 901)) self.frame_TaskPanel.setFrameShape(QtWidgets.QFrame.StyledPanel) self.frame_TaskPanel.setFrameShadow(QtWidgets.QFrame.Raised) self.frame_TaskPanel.setObjectName("frame_TaskPanel") self.groupBox_DataTree = QtWidgets.QGroupBox(self.centralwidget) self.groupBox_DataTree.setGeometry(QtCore.QRect(10, 46, 501, 865)) font = QtGui.QFont() font.setFamily("Calibri") self.groupBox_DataTree.setFont(font) self.groupBox_DataTree.setObjectName("groupBox_DataTree") self.groupBox = QtWidgets.QGroupBox(self.centralwidget) self.groupBox.setGeometry(QtCore.QRect(10, 5, 501, 41)) self.groupBox.setObjectName("groupBox") self.horizontalLayoutWidget = QtWidgets.QWidget(self.groupBox) self.horizontalLayoutWidget.setGeometry(QtCore.QRect(10, 14, 491, 21)) self.horizontalLayoutWidget.setObjectName("horizontalLayoutWidget") self.horizontalLayout = QtWidgets.QHBoxLayout( self.horizontalLayoutWidget) self.horizontalLayout.setContentsMargins(0, 0, 0, 0) self.horizontalLayout.setObjectName("horizontalLayout") self.label = QtWidgets.QLabel(self.horizontalLayoutWidget) self.label.setObjectName("label") self.horizontalLayout.addWidget(self.label) self.label_resX = QtWidgets.QLabel(self.horizontalLayoutWidget) self.label_resX.setObjectName("label_resX") self.horizontalLayout.addWidget(self.label_resX) self.label_resY = QtWidgets.QLabel(self.horizontalLayoutWidget) self.label_resY.setObjectName("label_resY") self.horizontalLayout.addWidget(self.label_resY) self.label_4 = QtWidgets.QLabel(self.horizontalLayoutWidget) self.label_4.setObjectName("label_4") self.horizontalLayout.addWidget(self.label_4) self.label_fps = QtWidgets.QLabel(self.horizontalLayoutWidget) self.label_fps.setObjectName("label_fps") self.horizontalLayout.addWidget(self.label_fps) MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtWidgets.QMenuBar(MainWindow) self.menubar.setGeometry(QtCore.QRect(0, 0, 1349, 23)) self.menubar.setObjectName("menubar") self.menu = QtWidgets.QMenu(self.menubar) self.menu.setObjectName("menu") self.menu_2 = QtWidgets.QMenu(self.menubar) self.menu_2.setObjectName("menu_2") MainWindow.setMenuBar(self.menubar) self.statusbar = QtWidgets.QStatusBar(MainWindow) self.statusbar.setObjectName("statusbar") MainWindow.setStatusBar(self.statusbar) self.action_Open = QtWidgets.QAction(MainWindow) self.action_Open.setObjectName("action_Open") self.action_New = QtWidgets.QAction(MainWindow) self.action_New.setObjectName("action_New") self.action_Daily = QtWidgets.QAction(MainWindow) self.action_Daily.setObjectName("action_Daily") self.action_PackCache = QtWidgets.QAction(MainWindow) self.action_PackCache.setObjectName("action_PackCache") self.action_PackRenderSeq = QtWidgets.QAction(MainWindow) self.action_PackRenderSeq.setObjectName("action_PackRenderSeq") self.action_PackCompSeq = QtWidgets.QAction(MainWindow) self.action_PackCompSeq.setObjectName("action_PackCompSeq") self.action_Setting = QtWidgets.QAction(MainWindow) self.action_Setting.setObjectName("action_Setting") self.action_Fresh = QtWidgets.QAction(MainWindow) self.action_Fresh.setObjectName("action_Fresh") self.menu.addAction(self.action_Open) self.menu.addAction(self.action_New) self.menu.addSeparator() self.menu.addAction(self.action_Setting) self.menu.addAction(self.action_Fresh) self.menu_2.addAction(self.action_Daily) self.menu_2.addSeparator() self.menu_2.addAction(self.action_PackCache) self.menu_2.addAction(self.action_PackRenderSeq) self.menu_2.addAction(self.action_PackCompSeq) self.menubar.addAction(self.menu.menuAction()) self.menubar.addAction(self.menu_2.menuAction()) self.retranslateUi(MainWindow) QtCore.QMetaObject.connectSlotsByName(MainWindow)
def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(379, 422) self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") self.verticalLayout = QtWidgets.QVBoxLayout(self.centralwidget) self.verticalLayout.setContentsMargins(0, 0, 0, 0) self.verticalLayout.setObjectName("verticalLayout") self.tabWidget = QtWidgets.QTabWidget(self.centralwidget) self.tabWidget.setObjectName("tabWidget") self.tab = QtWidgets.QWidget() self.tab.setObjectName("tab") self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.tab) self.verticalLayout_2.setObjectName("verticalLayout_2") self.search_field = QtWidgets.QLineEdit(self.tab) self.search_field.setObjectName("search_field") self.verticalLayout_2.addWidget(self.search_field) self.module_list_view = QtWidgets.QTreeView(self.tab) self.module_list_view.setObjectName("module_list_view") self.verticalLayout_2.addWidget(self.module_list_view) self.tabWidget.addTab(self.tab, "") self.tab_3 = QtWidgets.QWidget() self.tab_3.setObjectName("tab_3") self.verticalLayout_4 = QtWidgets.QVBoxLayout(self.tab_3) self.verticalLayout_4.setObjectName("verticalLayout_4") self.editors_list_view = QtWidgets.QListView(self.tab_3) self.editors_list_view.setObjectName("editors_list_view") self.verticalLayout_4.addWidget(self.editors_list_view) self.tabWidget.addTab(self.tab_3, "") self.tab_2 = QtWidgets.QWidget() self.tab_2.setObjectName("tab_2") self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.tab_2) self.verticalLayout_3.setObjectName("verticalLayout_3") self.widget = QtWidgets.QWidget(self.tab_2) self.widget.setLayoutDirection(QtCore.Qt.RightToLeft) self.widget.setObjectName("widget") self.horizontalLayout = QtWidgets.QHBoxLayout(self.widget) self.horizontalLayout.setContentsMargins(0, 0, 0, 0) self.horizontalLayout.setObjectName("horizontalLayout") spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.horizontalLayout.addItem(spacerItem) self.close_button = QtWidgets.QPushButton(self.widget) self.close_button.setEnabled(False) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.close_button.sizePolicy().hasHeightForWidth()) self.close_button.setSizePolicy(sizePolicy) self.close_button.setMaximumSize(QtCore.QSize(16777215, 16777215)) self.close_button.setObjectName("close_button") self.horizontalLayout.addWidget(self.close_button) self.verticalLayout_3.addWidget(self.widget) self.file_list_view = QtWidgets.QListView(self.tab_2) self.file_list_view.setObjectName("file_list_view") self.verticalLayout_3.addWidget(self.file_list_view) self.tabWidget.addTab(self.tab_2, "") self.verticalLayout.addWidget(self.tabWidget) MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtWidgets.QMenuBar(MainWindow) self.menubar.setGeometry(QtCore.QRect(0, 0, 379, 26)) self.menubar.setObjectName("menubar") self.menuFile = QtWidgets.QMenu(self.menubar) self.menuFile.setObjectName("menuFile") self.menuOptions = QtWidgets.QMenu(self.menubar) self.menuOptions.setObjectName("menuOptions") MainWindow.setMenuBar(self.menubar) self.statusbar = QtWidgets.QStatusBar(MainWindow) self.statusbar.setObjectName("statusbar") MainWindow.setStatusBar(self.statusbar) self.action_save = QtWidgets.QAction(MainWindow) self.action_save.setObjectName("action_save") self.action_close = QtWidgets.QAction(MainWindow) self.action_close.setObjectName("action_close") self.action_quit = QtWidgets.QAction(MainWindow) self.action_quit.setObjectName("action_quit") self.action_reload = QtWidgets.QAction(MainWindow) self.action_reload.setObjectName("action_reload") self.theme_menu = QtWidgets.QAction(MainWindow) self.theme_menu.setObjectName("theme_menu") self.action_export = QtWidgets.QAction(MainWindow) self.action_export.setObjectName("action_export") self.action_import = QtWidgets.QAction(MainWindow) self.action_import.setObjectName("action_import") self.menuFile.addAction(self.action_save) self.menuFile.addSeparator() self.menuFile.addAction(self.action_export) self.menuFile.addAction(self.action_import) self.menuFile.addSeparator() self.menuFile.addAction(self.action_reload) self.menuFile.addAction(self.action_close) self.menuFile.addSeparator() self.menuFile.addAction(self.action_quit) self.menubar.addAction(self.menuFile.menuAction()) self.menubar.addAction(self.menuOptions.menuAction()) self.retranslateUi(MainWindow) self.tabWidget.setCurrentIndex(0) QtCore.QMetaObject.connectSlotsByName(MainWindow)
def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(1053, 792) self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") self.horizontalLayout = QtWidgets.QHBoxLayout(self.centralwidget) self.horizontalLayout.setObjectName("horizontalLayout") self.tabWidget = QtWidgets.QTabWidget(self.centralwidget) self.tabWidget.setObjectName("tabWidget") self.tab1 = QtWidgets.QWidget() self.tab1.setObjectName("tab1") self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.tab1) self.horizontalLayout_2.setObjectName("horizontalLayout_2") self.verticalLayout_3 = QtWidgets.QVBoxLayout() self.verticalLayout_3.setObjectName("verticalLayout_3") self.label_msg = QtWidgets.QLabel(self.tab1) self.label_msg.setObjectName("label_msg") self.verticalLayout_3.addWidget(self.label_msg) self.mplplot = MPLWidget(self.tab1) self.mplplot.setObjectName("mplplot") self.verticalLayout_3.addWidget(self.mplplot) self.horizontalLayout_2.addLayout(self.verticalLayout_3) self.verticalLayout_2 = QtWidgets.QVBoxLayout() self.verticalLayout_2.setObjectName("verticalLayout_2") self.btn_dec = QtWidgets.QPushButton(self.tab1) self.btn_dec.setObjectName("btn_dec") self.verticalLayout_2.addWidget(self.btn_dec) self.btn_inc = QtWidgets.QPushButton(self.tab1) self.btn_inc.setObjectName("btn_inc") self.verticalLayout_2.addWidget(self.btn_inc) self.horizontalLayout_2.addLayout(self.verticalLayout_2) self.tabWidget.addTab(self.tab1, "") self.tab2 = QtWidgets.QWidget() self.tab2.setObjectName("tab2") self.verticalLayout = QtWidgets.QVBoxLayout(self.tab2) self.verticalLayout.setObjectName("verticalLayout") self.label_count = QtWidgets.QLabel(self.tab2) self.label_count.setObjectName("label_count") self.verticalLayout.addWidget(self.label_count) self.btn_toggle = QtWidgets.QPushButton(self.tab2) self.btn_toggle.setObjectName("btn_toggle") self.verticalLayout.addWidget(self.btn_toggle) self.tabWidget.addTab(self.tab2, "") self.horizontalLayout.addWidget(self.tabWidget) MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtWidgets.QMenuBar(MainWindow) self.menubar.setGeometry(QtCore.QRect(0, 0, 1053, 22)) self.menubar.setObjectName("menubar") self.menuFile = QtWidgets.QMenu(self.menubar) self.menuFile.setObjectName("menuFile") self.menuEdit = QtWidgets.QMenu(self.menubar) self.menuEdit.setObjectName("menuEdit") self.menuPlot = QtWidgets.QMenu(self.menubar) self.menuPlot.setObjectName("menuPlot") MainWindow.setMenuBar(self.menubar) self.statusbar = QtWidgets.QStatusBar(MainWindow) self.statusbar.setObjectName("statusbar") MainWindow.setStatusBar(self.statusbar) self.actionOpen = QtWidgets.QAction(MainWindow) self.actionOpen.setObjectName("actionOpen") self.actionSave = QtWidgets.QAction(MainWindow) self.actionSave.setObjectName("actionSave") self.actionQuit = QtWidgets.QAction(MainWindow) self.actionQuit.setObjectName("actionQuit") self.menuFile.addAction(self.actionOpen) self.menuFile.addAction(self.actionSave) self.menuFile.addAction(self.actionQuit) self.menubar.addAction(self.menuFile.menuAction()) self.menubar.addAction(self.menuEdit.menuAction()) self.menubar.addAction(self.menuPlot.menuAction()) self.retranslateUi(MainWindow) self.tabWidget.setCurrentIndex(0) QtCore.QMetaObject.connectSlotsByName(MainWindow)
def __init__(self): super(SystrayLauncher, self).__init__() self.logWin = LogWindow() self.curDir = os.path.dirname(__file__) w = QtWidgets.QWidget( ) # just to get the style(), haven't seen other way # icon = w.style().standardIcon(QtWidgets.QStyle.SP_BrowserReload) icon = QtGui.QIcon( "/Users/Midstream/Documents/Art/MyIcons/quick_gray.png") self.tray = QtWidgets.QSystemTrayIcon() self.tray.setIcon(icon) self.tray.setVisible(True) self.tray.activated.connect(self.onActivated) # shortcut = QtWidgets.QShortcut(QtGui.QKeySequence(QtCore.Qt.Key_F1), self.tray) # shortcut.setContext(QtCore.Qt.ApplicationShortcut) # shortcut.activated.connect(self.handler) # I JUST WANT TO SEE THE MENU WHEN RIGHT CLICK... menu = QtWidgets.QMenu() ################################################## submenu = menu.addMenu("打开") self.act_open_Terminal = QtWidgets.QAction( "Terminal", None, triggered=self.open_Terminal) submenu.addAction(self.act_open_Terminal) self.act_open_Monitor = QtWidgets.QAction("Monitor", None, triggered=self.open_Monitor) submenu.addAction(self.act_open_Monitor) self.act_open_SysPref = QtWidgets.QAction("偏好设置", None, triggered=self.open_SysPref) submenu.addAction(self.act_open_SysPref) self.act_open_Mail = QtWidgets.QAction("邮件", None, triggered=self.open_Mail) submenu.addAction(self.act_open_Mail) submenu.addSeparator() self.act_open_Shadow = QtWidgets.QAction("ShadowRocket", None, triggered=self.open_Shadow) submenu.addAction(self.act_open_Shadow) self.act_open_Dict = QtWidgets.QAction("欧路词典", None, triggered=self.open_Dict) submenu.addAction(self.act_open_Dict) self.act_open_QQMusic = QtWidgets.QAction("QQ音乐", None, triggered=self.open_QQMusic) submenu.addAction(self.act_open_QQMusic) self.act_open_Note = QtWidgets.QAction("云笔记", None, triggered=self.open_Note) submenu.addAction(self.act_open_Note) ################################################## # self.psAction = QtWidgets.QAction("Ps", None, triggered=self.psUx) # menu.addAction(self.psAction) # # self.logAction = QtWidgets.QAction("Log", None, triggered=self.openLog) # menu.addAction(self.logAction) menu.addSeparator() self.watchAction1 = QtWidgets.QAction("WsFx -> Unity", None, triggered=self.watch1) menu.addAction(self.watchAction1) self.colorPickerAction = QtWidgets.QAction( "Color Picker", None, triggered=self.openColorPicker) menu.addAction(self.colorPickerAction) menu.addSeparator() self.openScriptsQuickSetAction = QtWidgets.QAction( "脚本 QuickSet", None, triggered=self.openScriptsQuickSet) menu.addAction(self.openScriptsQuickSetAction) self.openScriptsMayaAction = QtWidgets.QAction( "脚本 Maya", None, triggered=self.openScriptsMaya) menu.addAction(self.openScriptsMayaAction) self.openScripts3Action = QtWidgets.QAction( "脚本 3D-Coat", None, triggered=self.openScripts3) menu.addAction(self.openScripts3Action) self.openScripts4Action = QtWidgets.QAction( "Maya按键修改", None, triggered=self.openScripts4) menu.addAction(self.openScripts4Action) menu.addSeparator() self.openDirFxAction = QtWidgets.QAction("目录 特效", None, triggered=self.openDirFx) menu.addAction(self.openDirFxAction) menu.addSeparator() self.quitAction = QtWidgets.QAction( "Qui&t", None, triggered=QtWidgets.QApplication.instance().quit) menu.addAction(self.quitAction) # aQuit = menu.addAction("qqquit") # aQuit.triggered.connect(QtWidgets.QApplication.instance().quit) self.trayIconMenu = menu self.tray.setContextMenu(menu) self.log('start cur dir = ' + self.curDir)
def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.setWindowModality(QtCore.Qt.NonModal) MainWindow.resize(1034, 698) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( MainWindow.sizePolicy().hasHeightForWidth()) MainWindow.setSizePolicy(sizePolicy) MainWindow.setMinimumSize(QtCore.QSize(0, 0)) MainWindow.setSizeIncrement(QtCore.QSize(0, 0)) MainWindow.setBaseSize(QtCore.QSize(-1, 0)) MainWindow.setTabShape(QtWidgets.QTabWidget.Rounded) MainWindow.setDockNestingEnabled(False) self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget.setEnabled(True) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.centralwidget.sizePolicy().hasHeightForWidth()) self.centralwidget.setSizePolicy(sizePolicy) self.centralwidget.setMinimumSize(QtCore.QSize(0, 0)) self.centralwidget.setMouseTracking(False) self.centralwidget.setAutoFillBackground(False) self.centralwidget.setObjectName("centralwidget") self.gridLayout_5 = QtWidgets.QGridLayout(self.centralwidget) self.gridLayout_5.setObjectName("gridLayout_5") self.gridLayout_2 = QtWidgets.QGridLayout() self.gridLayout_2.setSizeConstraint( QtWidgets.QLayout.SetDefaultConstraint) self.gridLayout_2.setObjectName("gridLayout_2") self.frame = QtWidgets.QFrame(self.centralwidget) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.frame.sizePolicy().hasHeightForWidth()) self.frame.setSizePolicy(sizePolicy) self.frame.setMinimumSize(QtCore.QSize(0, 51)) self.frame.setMaximumSize(QtCore.QSize(16777215, 51)) self.frame.setFrameShape(QtWidgets.QFrame.StyledPanel) self.frame.setFrameShadow(QtWidgets.QFrame.Raised) self.frame.setLineWidth(1) self.frame.setObjectName("frame") self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.frame) self.horizontalLayout_2.setObjectName("horizontalLayout_2") self.SearchEventLayout = QtWidgets.QHBoxLayout() self.SearchEventLayout.setSpacing(2) self.SearchEventLayout.setObjectName("SearchEventLayout") self.SearchButton = QtWidgets.QPushButton(self.frame) self.SearchButton.setEnabled(True) self.SearchButton.setCursor(QtCore.Qt.ArrowCursor) self.SearchButton.setMouseTracking(False) self.SearchButton.setAutoFillBackground(False) self.SearchButton.setText("") icon = QtGui.QIcon() icon.addPixmap(QtGui.QPixmap(":/icons/search-icon.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.SearchButton.setIcon(icon) self.SearchButton.setIconSize(QtCore.QSize(16, 16)) self.SearchButton.setCheckable(False) self.SearchButton.setChecked(False) self.SearchButton.setAutoDefault(False) self.SearchButton.setDefault(False) self.SearchButton.setFlat(True) self.SearchButton.setObjectName("SearchButton") self.SearchEventLayout.addWidget(self.SearchButton) self.searchBar = QtWidgets.QLineEdit(self.frame) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.searchBar.sizePolicy().hasHeightForWidth()) self.searchBar.setSizePolicy(sizePolicy) self.searchBar.setMinimumSize(QtCore.QSize(50, 20)) self.searchBar.setMaximumSize(QtCore.QSize(300, 20)) self.searchBar.setAutoFillBackground(False) self.searchBar.setInputMask("") self.searchBar.setText("") self.searchBar.setFrame(True) self.searchBar.setEchoMode(QtWidgets.QLineEdit.Normal) self.searchBar.setDragEnabled(False) self.searchBar.setReadOnly(False) self.searchBar.setCursorMoveStyle(QtCore.Qt.VisualMoveStyle) self.searchBar.setClearButtonEnabled(True) self.searchBar.setObjectName("searchBar") self.SearchEventLayout.addWidget(self.searchBar) spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.SearchEventLayout.addItem(spacerItem) self.DarkModeButton = QtWidgets.QRadioButton(self.frame) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.DarkModeButton.sizePolicy().hasHeightForWidth()) self.DarkModeButton.setSizePolicy(sizePolicy) self.DarkModeButton.setObjectName("DarkModeButton") self.SearchEventLayout.addWidget(self.DarkModeButton) self.toolButton = QtWidgets.QToolButton(self.frame) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.toolButton.sizePolicy().hasHeightForWidth()) self.toolButton.setSizePolicy(sizePolicy) self.toolButton.setPopupMode(QtWidgets.QToolButton.MenuButtonPopup) self.toolButton.setToolButtonStyle(QtCore.Qt.ToolButtonIconOnly) self.toolButton.setAutoRaise(True) self.toolButton.setObjectName("toolButton") self.SearchEventLayout.addWidget(self.toolButton) self.horizontalLayout_2.addLayout(self.SearchEventLayout) self.gridLayout_2.addWidget(self.frame, 0, 1, 1, 1) self.frame_2 = QtWidgets.QFrame(self.centralwidget) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.frame_2.sizePolicy().hasHeightForWidth()) self.frame_2.setSizePolicy(sizePolicy) self.frame_2.setMinimumSize(QtCore.QSize(120, 0)) self.frame_2.setMaximumSize(QtCore.QSize(120, 16777215)) self.frame_2.setStyleSheet("background-color: rgb(7, 64, 128);x") self.frame_2.setFrameShape(QtWidgets.QFrame.StyledPanel) self.frame_2.setFrameShadow(QtWidgets.QFrame.Raised) self.frame_2.setObjectName("frame_2") self.gridLayout_2.addWidget(self.frame_2, 0, 0, 2, 1) self.HomeWidget = QtWidgets.QTabWidget(self.centralwidget) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.HomeWidget.sizePolicy().hasHeightForWidth()) self.HomeWidget.setSizePolicy(sizePolicy) self.HomeWidget.setMouseTracking(False) self.HomeWidget.setTabPosition(QtWidgets.QTabWidget.North) self.HomeWidget.setTabShape(QtWidgets.QTabWidget.Rounded) self.HomeWidget.setIconSize(QtCore.QSize(16, 16)) self.HomeWidget.setElideMode(QtCore.Qt.ElideRight) self.HomeWidget.setUsesScrollButtons(False) self.HomeWidget.setDocumentMode(False) self.HomeWidget.setTabsClosable(False) self.HomeWidget.setMovable(False) self.HomeWidget.setTabBarAutoHide(False) self.HomeWidget.setObjectName("HomeWidget") self.EventTab = QtWidgets.QWidget() sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.EventTab.sizePolicy().hasHeightForWidth()) self.EventTab.setSizePolicy(sizePolicy) self.EventTab.setObjectName("EventTab") self.gridLayout = QtWidgets.QGridLayout(self.EventTab) self.gridLayout.setObjectName("gridLayout") self.EventsWidget = QtWidgets.QTabWidget(self.EventTab) self.EventsWidget.setEnabled(True) self.EventsWidget.setCursor(QtCore.Qt.ArrowCursor) self.EventsWidget.setAutoFillBackground(False) self.EventsWidget.setTabPosition(QtWidgets.QTabWidget.North) self.EventsWidget.setUsesScrollButtons(True) self.EventsWidget.setObjectName("EventsWidget") self.AllEventsTab = QtWidgets.QWidget() sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.AllEventsTab.sizePolicy().hasHeightForWidth()) self.AllEventsTab.setSizePolicy(sizePolicy) self.AllEventsTab.setObjectName("AllEventsTab") self.gridLayout_4 = QtWidgets.QGridLayout(self.AllEventsTab) self.gridLayout_4.setSpacing(1) self.gridLayout_4.setContentsMargins(15, 15, 15, 15) self.gridLayout_4.setObjectName("gridLayout_4") self.scrollArea = QtWidgets.QScrollArea(self.AllEventsTab) self.scrollArea.setWidgetResizable(True) self.scrollArea.setObjectName("scrollArea") self.scrollAreaWidgetContents = QtWidgets.QWidget() self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 810, 466)) self.scrollAreaWidgetContents.setObjectName("scrollAreaWidgetContents") self.verticalLayout_2 = QtWidgets.QVBoxLayout( self.scrollAreaWidgetContents) self.verticalLayout_2.setObjectName("verticalLayout_2") #self.label = QtWidgets.QLabel(self.scrollAreaWidgetContents) #self.label.setObjectName("label") #self.verticalLayout_2.addWidget(self.label) self.scrollArea.setWidget(self.scrollAreaWidgetContents) self.gridLayout_4.addWidget(self.scrollArea, 0, 0, 1, 1) self.EventsWidget.addTab(self.AllEventsTab, "") self.FavoritesEventsTab = QtWidgets.QWidget() sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.FavoritesEventsTab.sizePolicy().hasHeightForWidth()) self.FavoritesEventsTab.setSizePolicy(sizePolicy) self.FavoritesEventsTab.setObjectName("FavoritesEventsTab") self.gridLayout_8 = QtWidgets.QGridLayout(self.FavoritesEventsTab) self.gridLayout_8.setObjectName("gridLayout_8") self.scrollArea_2 = QtWidgets.QScrollArea(self.FavoritesEventsTab) self.scrollArea_2.setWidgetResizable(True) self.scrollArea_2.setObjectName("scrollArea_2") self.scrollAreaWidgetContents_2 = QtWidgets.QWidget() self.scrollAreaWidgetContents_2.setGeometry( QtCore.QRect(0, 0, 809, 469)) self.scrollAreaWidgetContents_2.setObjectName( "scrollAreaWidgetContents_2") self.verticalLayout = QtWidgets.QVBoxLayout( self.scrollAreaWidgetContents_2) self.verticalLayout.setObjectName("verticalLayout") #self.label_2 = QtWidgets.QLabel(self.scrollAreaWidgetContents_2) #self.label_2.setObjectName("label_2") #self.verticalLayout.addWidget(self.label_2) self.scrollArea_2.setWidget(self.scrollAreaWidgetContents_2) self.gridLayout_8.addWidget(self.scrollArea_2, 0, 0, 1, 1) self.EventsWidget.addTab(self.FavoritesEventsTab, "") self.gridLayout.addWidget(self.EventsWidget, 0, 0, 1, 1) self.HomeWidget.addTab(self.EventTab, "") self.CalendarTab = QtWidgets.QWidget() self.CalendarTab.setEnabled(True) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.CalendarTab.sizePolicy().hasHeightForWidth()) self.CalendarTab.setSizePolicy(sizePolicy) self.CalendarTab.setObjectName("CalendarTab") self.gridLayout_7 = QtWidgets.QGridLayout(self.CalendarTab) self.gridLayout_7.setObjectName("gridLayout_7") self.gridLayout_6 = QtWidgets.QGridLayout() self.gridLayout_6.setObjectName("gridLayout_6") self.textBrowser_2 = QtWidgets.QTextBrowser(self.CalendarTab) self.textBrowser_2.setSizeAdjustPolicy( QtWidgets.QAbstractScrollArea.AdjustIgnored) self.textBrowser_2.setUndoRedoEnabled(True) self.textBrowser_2.setOverwriteMode(True) self.textBrowser_2.setObjectName("textBrowser_2") self.gridLayout_6.addWidget(self.textBrowser_2, 0, 0, 1, 1) self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") #self.AddEventsCalndar = QtWidgets.QPushButton(self.CalendarTab) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) #sizePolicy.setHeightForWidth(self.AddEventsCalndar.sizePolicy().hasHeightForWidth()) #self.AddEventsCalndar.setSizePolicy(sizePolicy) #self.AddEventsCalndar.setAutoDefault(False) #self.AddEventsCalndar.setDefault(False) # self.AddEventsCalndar.setObjectName("AddEventsCalndar") #self.horizontalLayout.addWidget(self.AddEventsCalndar) self.PrintEventsCalendar = QtWidgets.QPushButton(self.CalendarTab) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.PrintEventsCalendar.sizePolicy().hasHeightForWidth()) self.PrintEventsCalendar.setSizePolicy(sizePolicy) self.PrintEventsCalendar.setAutoDefault(False) self.PrintEventsCalendar.setObjectName("PrintEventsCalendar") self.horizontalLayout.addWidget(self.PrintEventsCalendar) self.gridLayout_6.addLayout(self.horizontalLayout, 1, 0, 1, 1) self.gridLayout_7.addLayout(self.gridLayout_6, 0, 0, 1, 1) self.HomeWidget.addTab(self.CalendarTab, "") self.gridLayout_2.addWidget(self.HomeWidget, 1, 1, 1, 1) self.gridLayout_5.addLayout(self.gridLayout_2, 0, 0, 1, 1) MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtWidgets.QMenuBar() self.menubar.setGeometry(QtCore.QRect(0, 0, 1034, 22)) self.menubar.setObjectName("menubar") self.menufile = QtWidgets.QMenu(self.menubar) self.menufile.setObjectName("menufile") self.menuEdit = QtWidgets.QMenu(self.menubar) self.menuEdit.setObjectName("menuEdit") MainWindow.setMenuBar(self.menubar) self.statusbar = QtWidgets.QStatusBar(MainWindow) self.statusbar.setWhatsThis("") self.statusbar.setObjectName("statusbar") MainWindow.setStatusBar(self.statusbar) self.menubar.addAction(self.menufile.menuAction()) self.menubar.addAction(self.menuEdit.menuAction()) self.retranslateUi(MainWindow) self.HomeWidget.setCurrentIndex(0) self.EventsWidget.setCurrentIndex(0) QtCore.QMetaObject.connectSlotsByName(MainWindow)
def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(782, 857) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( MainWindow.sizePolicy().hasHeightForWidth()) MainWindow.setSizePolicy(sizePolicy) self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") self.gridLayout = QtWidgets.QGridLayout(self.centralwidget) self.gridLayout.setObjectName("gridLayout") self.splitter = QtWidgets.QSplitter(self.centralwidget) self.splitter.setMinimumSize(QtCore.QSize(0, 0)) self.splitter.setOrientation(QtCore.Qt.Horizontal) self.splitter.setObjectName("splitter") self.layoutWidget = QtWidgets.QWidget(self.splitter) self.layoutWidget.setObjectName("layoutWidget") self.vLayoutLeft = QtWidgets.QVBoxLayout(self.layoutWidget) self.vLayoutLeft.setContentsMargins(0, 0, 0, 0) self.vLayoutLeft.setObjectName("vLayoutLeft") self.hLayoutNodeOp = QtWidgets.QHBoxLayout() self.hLayoutNodeOp.setObjectName("hLayoutNodeOp") self.btnAddNode = QtWidgets.QPushButton(self.layoutWidget) self.btnAddNode.setObjectName("btnAddNode") self.hLayoutNodeOp.addWidget(self.btnAddNode) self.btnRemoveNode = QtWidgets.QPushButton(self.layoutWidget) self.btnRemoveNode.setObjectName("btnRemoveNode") self.hLayoutNodeOp.addWidget(self.btnRemoveNode) self.btnClearNodeList = QtWidgets.QPushButton(self.layoutWidget) self.btnClearNodeList.setObjectName("btnClearNodeList") self.hLayoutNodeOp.addWidget(self.btnClearNodeList) self.vLayoutLeft.addLayout(self.hLayoutNodeOp) self.nodeList = QtWidgets.QListWidget(self.layoutWidget) self.nodeList.setObjectName("nodeList") self.vLayoutLeft.addWidget(self.nodeList) self.btnDoCheck = QtWidgets.QPushButton(self.layoutWidget) self.btnDoCheck.setObjectName("btnDoCheck") self.vLayoutLeft.addWidget(self.btnDoCheck) self.layoutWidget1 = QtWidgets.QWidget(self.splitter) self.layoutWidget1.setObjectName("layoutWidget1") self.vLayoutRight = QtWidgets.QVBoxLayout(self.layoutWidget1) self.vLayoutRight.setContentsMargins(0, 0, 0, 0) self.vLayoutRight.setObjectName("vLayoutRight") self.labelTitle = QtWidgets.QLabel(self.layoutWidget1) font = QtGui.QFont() font.setFamily("Microsoft YaHei") font.setPointSize(16) font.setWeight(50) font.setBold(False) self.labelTitle.setFont(font) self.labelTitle.setObjectName("labelTitle") self.vLayoutRight.addWidget(self.labelTitle) self.labelDesc = QtWidgets.QLabel(self.layoutWidget1) font = QtGui.QFont() font.setFamily("Microsoft YaHei") font.setPointSize(10) self.labelDesc.setFont(font) self.labelDesc.setTextFormat(QtCore.Qt.RichText) self.labelDesc.setWordWrap(True) self.labelDesc.setObjectName("labelDesc") self.vLayoutRight.addWidget(self.labelDesc) self.objectList = QtWidgets.QListWidget(self.layoutWidget1) self.objectList.setObjectName("objectList") self.vLayoutRight.addWidget(self.objectList) self.hLayoutFixOp = QtWidgets.QHBoxLayout() self.hLayoutFixOp.setObjectName("hLayoutFixOp") self.btnFixSelect = QtWidgets.QPushButton(self.layoutWidget1) self.btnFixSelect.setObjectName("btnFixSelect") self.hLayoutFixOp.addWidget(self.btnFixSelect) self.btnFixAll = QtWidgets.QPushButton(self.layoutWidget1) self.btnFixAll.setObjectName("btnFixAll") self.hLayoutFixOp.addWidget(self.btnFixAll) self.vLayoutRight.addLayout(self.hLayoutFixOp) self.gridLayout.addWidget(self.splitter, 0, 0, 1, 1) self.progressBar = QtWidgets.QProgressBar(self.centralwidget) self.progressBar.setMinimumSize(QtCore.QSize(0, 0)) self.progressBar.setMaximumSize(QtCore.QSize(16777215, 2)) self.progressBar.setBaseSize(QtCore.QSize(0, 0)) self.progressBar.setProperty("value", 0) self.progressBar.setTextVisible(False) self.progressBar.setObjectName("progressBar") self.gridLayout.addWidget(self.progressBar, 1, 0, 1, 1) MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtWidgets.QMenuBar(MainWindow) self.menubar.setGeometry(QtCore.QRect(0, 0, 782, 26)) self.menubar.setObjectName("menubar") self.menuCreatePrj = QtWidgets.QMenu(self.menubar) self.menuCreatePrj.setObjectName("menuCreatePrj") self.menuHelp = QtWidgets.QMenu(self.menubar) self.menuHelp.setObjectName("menuHelp") MainWindow.setMenuBar(self.menubar) self.actionNew = QtWidgets.QAction(MainWindow) self.actionNew.setObjectName("actionNew") self.actionLoad = QtWidgets.QAction(MainWindow) self.actionLoad.setObjectName("actionLoad") self.actionSave = QtWidgets.QAction(MainWindow) self.actionSave.setObjectName("actionSave") self.actionDelete = QtWidgets.QAction(MainWindow) self.actionDelete.setObjectName("actionDelete") self.actionExit = QtWidgets.QAction(MainWindow) self.actionExit.setObjectName("actionExit") self.actionSaveAs = QtWidgets.QAction(MainWindow) self.actionSaveAs.setObjectName("actionSaveAs") self.actionUsage = QtWidgets.QAction(MainWindow) self.actionUsage.setObjectName("actionUsage") self.actionAbout = QtWidgets.QAction(MainWindow) self.actionAbout.setObjectName("actionAbout") self.menuCreatePrj.addAction(self.actionNew) self.menuCreatePrj.addAction(self.actionLoad) self.menuCreatePrj.addSeparator() self.menuCreatePrj.addAction(self.actionSave) self.menuCreatePrj.addAction(self.actionSaveAs) self.menuCreatePrj.addSeparator() self.menuCreatePrj.addAction(self.actionDelete) self.menuCreatePrj.addAction(self.actionExit) self.menuHelp.addAction(self.actionUsage) self.menuHelp.addAction(self.actionAbout) self.menubar.addAction(self.menuCreatePrj.menuAction()) self.menubar.addAction(self.menuHelp.menuAction()) self.retranslateUi(MainWindow) QtCore.QMetaObject.connectSlotsByName(MainWindow)
def setupUi(self, HomeWindow): HomeWindow.setObjectName("HomeWindow") HomeWindow.resize(1300, 820) HomeWindow.setMinimumSize(QtCore.QSize(1300, 820)) HomeWindow.setMaximumSize(QtCore.QSize(1300, 820)) self.centralwidget = QtWidgets.QWidget(HomeWindow) self.centralwidget.setObjectName("centralwidget") self.gridLayout_3 = QtWidgets.QGridLayout(self.centralwidget) self.gridLayout_3.setObjectName("gridLayout_3") self.frame_2 = QtWidgets.QFrame(self.centralwidget) self.frame_2.setMinimumSize(QtCore.QSize(1050, 650)) self.frame_2.setFrameShape(QtWidgets.QFrame.StyledPanel) self.frame_2.setFrameShadow(QtWidgets.QFrame.Raised) self.frame_2.setObjectName("frame_2") self.gridLayout_5 = QtWidgets.QGridLayout(self.frame_2) self.gridLayout_5.setObjectName("gridLayout_5") self.frame = QtWidgets.QFrame(self.frame_2) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.frame.sizePolicy().hasHeightForWidth()) self.frame.setSizePolicy(sizePolicy) self.frame.setMinimumSize(QtCore.QSize(256, 300)) self.frame.setFrameShape(QtWidgets.QFrame.Box) self.frame.setObjectName("frame") self.gridLayout_4 = QtWidgets.QGridLayout(self.frame) self.gridLayout_4.setObjectName("gridLayout_4") self.saveButton = QtWidgets.QPushButton(self.frame) self.saveButton.setObjectName("saveButton") self.gridLayout_4.addWidget(self.saveButton, 4, 0, 1, 1) self.verticalLayout_5 = QtWidgets.QVBoxLayout() self.verticalLayout_5.setObjectName("verticalLayout_5") self.verticalLayout_6 = QtWidgets.QVBoxLayout() self.verticalLayout_6.setObjectName("verticalLayout_6") self.origImageLabel = QtWidgets.QLabel(self.frame) self.origImageLabel.setObjectName("origImageLabel") self.verticalLayout_6.addWidget(self.origImageLabel) self.horizontalLayout_6 = QtWidgets.QHBoxLayout() self.horizontalLayout_6.setObjectName("horizontalLayout_6") self.origImagePathLine = QtWidgets.QLineEdit(self.frame) self.origImagePathLine.setObjectName("origImagePathLine") self.horizontalLayout_6.addWidget(self.origImagePathLine) self.origImageButton = QtWidgets.QToolButton(self.frame) self.origImageButton.setObjectName("origImageButton") self.horizontalLayout_6.addWidget(self.origImageButton) self.verticalLayout_6.addLayout(self.horizontalLayout_6) self.verticalLayout_5.addLayout(self.verticalLayout_6) self.gridLayout_4.addLayout(self.verticalLayout_5, 2, 0, 1, 1) self.recoveredImageLabel = QtWidgets.QLabel(self.frame) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.recoveredImageLabel.sizePolicy().hasHeightForWidth()) self.recoveredImageLabel.setSizePolicy(sizePolicy) self.recoveredImageLabel.setMinimumSize(QtCore.QSize(256, 256)) self.recoveredImageLabel.setText("") self.recoveredImageLabel.setAlignment(QtCore.Qt.AlignCenter) self.recoveredImageLabel.setObjectName("recoveredImageLabel") self.gridLayout_4.addWidget(self.recoveredImageLabel, 1, 0, 1, 1) self.reconstructedImageLabel = QtWidgets.QLabel(self.frame) self.reconstructedImageLabel.setObjectName("reconstructedImageLabel") self.gridLayout_4.addWidget(self.reconstructedImageLabel, 0, 0, 1, 1) self.verticalLayout_7 = QtWidgets.QVBoxLayout() self.verticalLayout_7.setObjectName("verticalLayout_7") self.snrLabel = QtWidgets.QLabel(self.frame) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.snrLabel.sizePolicy().hasHeightForWidth()) self.snrLabel.setSizePolicy(sizePolicy) self.snrLabel.setMinimumSize(QtCore.QSize(256, 0)) font = QtGui.QFont() font.setStrikeOut(False) self.snrLabel.setFont(font) self.snrLabel.setFrameShape(QtWidgets.QFrame.Box) self.snrLabel.setLineWidth(0) self.snrLabel.setAlignment(QtCore.Qt.AlignBottom|QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft) self.snrLabel.setObjectName("snrLabel") self.verticalLayout_7.addWidget(self.snrLabel) self.horizontalLayout_8 = QtWidgets.QHBoxLayout() self.horizontalLayout_8.setObjectName("horizontalLayout_8") self.snrButton = QtWidgets.QPushButton(self.frame) self.snrButton.setObjectName("snrButton") self.horizontalLayout_8.addWidget(self.snrButton) self.snrLCDNumber = QtWidgets.QLCDNumber(self.frame) self.snrLCDNumber.setSmallDecimalPoint(True) self.snrLCDNumber.setDigitCount(8) self.snrLCDNumber.setProperty("value", 0.0) self.snrLCDNumber.setObjectName("snrLCDNumber") self.horizontalLayout_8.addWidget(self.snrLCDNumber) self.verticalLayout_7.addLayout(self.horizontalLayout_8) self.gridLayout_4.addLayout(self.verticalLayout_7, 3, 0, 1, 1) self.gridLayout_5.addWidget(self.frame, 0, 1, 1, 1) self.frame_3 = QtWidgets.QFrame(self.frame_2) self.frame_3.setMinimumSize(QtCore.QSize(0, 191)) self.frame_3.setStyleSheet("border-color: rgb(0, 0, 0);") self.frame_3.setFrameShape(QtWidgets.QFrame.Box) self.frame_3.setObjectName("frame_3") self.gridLayout_2 = QtWidgets.QGridLayout(self.frame_3) self.gridLayout_2.setObjectName("gridLayout_2") self.reconstructButton = QtWidgets.QPushButton(self.frame_3) self.reconstructButton.setObjectName("reconstructButton") self.gridLayout_2.addWidget(self.reconstructButton, 2, 0, 1, 1) self.verticalLayout_4 = QtWidgets.QVBoxLayout() self.verticalLayout_4.setSizeConstraint(QtWidgets.QLayout.SetMinimumSize) self.verticalLayout_4.setObjectName("verticalLayout_4") self.gridLayout = QtWidgets.QGridLayout() self.gridLayout.setObjectName("gridLayout") self.verticalLayout = QtWidgets.QVBoxLayout() self.verticalLayout.setObjectName("verticalLayout") self.csMeasurementsLabel = QtWidgets.QLabel(self.frame_3) self.csMeasurementsLabel.setObjectName("csMeasurementsLabel") self.verticalLayout.addWidget(self.csMeasurementsLabel) self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") self.csMeasurementsPathLine = QtWidgets.QLineEdit(self.frame_3) self.csMeasurementsPathLine.setMinimumSize(QtCore.QSize(0, 30)) self.csMeasurementsPathLine.setObjectName("csMeasurementsPathLine") self.horizontalLayout.addWidget(self.csMeasurementsPathLine) self.csMeasurementsButton = QtWidgets.QToolButton(self.frame_3) self.csMeasurementsButton.setObjectName("csMeasurementsButton") self.horizontalLayout.addWidget(self.csMeasurementsButton) self.verticalLayout.addLayout(self.horizontalLayout) self.gridLayout.addLayout(self.verticalLayout, 0, 0, 1, 1) self.verticalLayout_2 = QtWidgets.QVBoxLayout() self.verticalLayout_2.setObjectName("verticalLayout_2") self.samplingMatrixLabel = QtWidgets.QLabel(self.frame_3) self.samplingMatrixLabel.setObjectName("samplingMatrixLabel") self.verticalLayout_2.addWidget(self.samplingMatrixLabel) self.horizontalLayout_2 = QtWidgets.QHBoxLayout() self.horizontalLayout_2.setObjectName("horizontalLayout_2") self.samplingMatrixPathLine = QtWidgets.QLineEdit(self.frame_3) self.samplingMatrixPathLine.setMinimumSize(QtCore.QSize(0, 30)) self.samplingMatrixPathLine.setObjectName("samplingMatrixPathLine") self.horizontalLayout_2.addWidget(self.samplingMatrixPathLine) self.samplingMatrixButton = QtWidgets.QToolButton(self.frame_3) self.samplingMatrixButton.setObjectName("samplingMatrixButton") self.horizontalLayout_2.addWidget(self.samplingMatrixButton) self.verticalLayout_2.addLayout(self.horizontalLayout_2) self.gridLayout.addLayout(self.verticalLayout_2, 1, 0, 1, 1) self.verticalLayout_3 = QtWidgets.QVBoxLayout() self.verticalLayout_3.setObjectName("verticalLayout_3") self.initializationMatrixLabel = QtWidgets.QLabel(self.frame_3) self.initializationMatrixLabel.setObjectName("initializationMatrixLabel") self.verticalLayout_3.addWidget(self.initializationMatrixLabel) self.horizontalLayout_3 = QtWidgets.QHBoxLayout() self.horizontalLayout_3.setObjectName("horizontalLayout_3") self.initializationMatrixPathLine = QtWidgets.QLineEdit(self.frame_3) self.initializationMatrixPathLine.setMinimumSize(QtCore.QSize(0, 30)) self.initializationMatrixPathLine.setObjectName("initializationMatrixPathLine") self.horizontalLayout_3.addWidget(self.initializationMatrixPathLine) self.initializationMatrixButton = QtWidgets.QToolButton(self.frame_3) self.initializationMatrixButton.setObjectName("initializationMatrixButton") self.horizontalLayout_3.addWidget(self.initializationMatrixButton) self.verticalLayout_3.addLayout(self.horizontalLayout_3) self.gridLayout.addLayout(self.verticalLayout_3, 2, 0, 1, 1) self.verticalLayout_4.addLayout(self.gridLayout) self.horizontalLayout_4 = QtWidgets.QHBoxLayout() self.horizontalLayout_4.setObjectName("horizontalLayout_4") self.csRatioLabel = QtWidgets.QLabel(self.frame_3) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Minimum) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.csRatioLabel.sizePolicy().hasHeightForWidth()) self.csRatioLabel.setSizePolicy(sizePolicy) self.csRatioLabel.setMinimumSize(QtCore.QSize(0, 34)) self.csRatioLabel.setObjectName("csRatioLabel") self.horizontalLayout_4.addWidget(self.csRatioLabel) self.csRatiosComboBox = QtWidgets.QComboBox(self.frame_3) self.csRatiosComboBox.setEditable(False) self.csRatiosComboBox.setMaxVisibleItems(10) self.csRatiosComboBox.setObjectName("csRatiosComboBox") self.csRatiosComboBox.addItem("") self.csRatiosComboBox.addItem("") self.csRatiosComboBox.addItem("") self.horizontalLayout_4.addWidget(self.csRatiosComboBox) self.verticalLayout_4.addLayout(self.horizontalLayout_4) self.horizontalLayout_5 = QtWidgets.QHBoxLayout() self.horizontalLayout_5.setSizeConstraint(QtWidgets.QLayout.SetMinimumSize) self.horizontalLayout_5.setObjectName("horizontalLayout_5") self.widthLabel = QtWidgets.QLabel(self.frame_3) self.widthLabel.setObjectName("widthLabel") self.horizontalLayout_5.addWidget(self.widthLabel) self.widthLineEdit = QtWidgets.QLineEdit(self.frame_3) self.widthLineEdit.setObjectName("widthLineEdit") self.horizontalLayout_5.addWidget(self.widthLineEdit) self.heightLabel = QtWidgets.QLabel(self.frame_3) self.heightLabel.setObjectName("heightLabel") self.horizontalLayout_5.addWidget(self.heightLabel) self.heightLineEdit = QtWidgets.QLineEdit(self.frame_3) self.heightLineEdit.setObjectName("heightLineEdit") self.horizontalLayout_5.addWidget(self.heightLineEdit) self.verticalLayout_4.addLayout(self.horizontalLayout_5) self.gridLayout_2.addLayout(self.verticalLayout_4, 0, 0, 1, 1) self.gridLayout_5.addWidget(self.frame_3, 0, 0, 1, 1) self.gridLayout_3.addWidget(self.frame_2, 1, 0, 1, 1) HomeWindow.setCentralWidget(self.centralwidget) self.menubar = QtWidgets.QMenuBar(HomeWindow) self.menubar.setGeometry(QtCore.QRect(0, 0, 1300, 39)) self.menubar.setObjectName("menubar") self.menuMenu = QtWidgets.QMenu(self.menubar) self.menuMenu.setObjectName("menuMenu") HomeWindow.setMenuBar(self.menubar) self.statusbar = QtWidgets.QStatusBar(HomeWindow) self.statusbar.setObjectName("statusbar") HomeWindow.setStatusBar(self.statusbar) self.actionHome = QtWidgets.QAction(HomeWindow) self.actionHome.setObjectName("actionHome") self.actionHome_2 = QtWidgets.QAction(HomeWindow) self.actionHome_2.setObjectName("actionHome_2") self.actionIntructions = QtWidgets.QAction(HomeWindow) self.actionIntructions.setObjectName("actionIntructions") self.actionSettings = QtWidgets.QAction(HomeWindow) self.actionSettings.setObjectName("actionSettings") self.actionInstructions = QtWidgets.QAction(HomeWindow) self.actionInstructions.setObjectName("actionInstructions") self.menuMenu.addAction(self.actionSettings) self.menuMenu.addAction(self.actionInstructions) self.menubar.addAction(self.menuMenu.menuAction()) self.retranslateUi(HomeWindow) QtCore.QMetaObject.connectSlotsByName(HomeWindow)
def setupUi(self, MainWindow): self.w = MainWindow MainWindow.setObjectName("MainWindow") MainWindow.resize(1137, 922) self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") self.pushButton = QtWidgets.QPushButton(self.centralwidget) self.pushButton.setGeometry(QtCore.QRect(860, 800, 141, 41)) self.pushButton.setObjectName("pushButton") self.label_3 = QtWidgets.QLabel(self.centralwidget) self.label_3.setGeometry(QtCore.QRect(130, 780, 221, 71)) self.label_3.setObjectName("label_3") self.label_4 = QtWidgets.QLabel(self.centralwidget) self.label_4.setGeometry(QtCore.QRect(10, 0, 401, 61)) self.label_4.setObjectName("label_4") self.label_5 = QtWidgets.QLabel(self.centralwidget) self.label_5.setGeometry(QtCore.QRect(1000, 10, 111, 51)) self.label_5.setStyleSheet("image: url(samPicture.jpg);") self.label_5.setText("") self.label_5.setTextFormat(QtCore.Qt.PlainText) self.label_5.setPixmap(QtGui.QPixmap("samPicture.jpg")) self.label_5.setScaledContents(True) self.label_5.setObjectName("label_5") self.label_6 = QtWidgets.QLabel(self.centralwidget) self.label_6.setGeometry(QtCore.QRect(200, 780, 601, 71)) self.label_6.setObjectName("label_6") MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtWidgets.QMenuBar(MainWindow) self.menubar.setGeometry(QtCore.QRect(0, 0, 1137, 21)) self.menubar.setObjectName("menubar") self.menuExit = QtWidgets.QMenu(self.menubar) self.menuExit.setObjectName("menuExit") MainWindow.setMenuBar(self.menubar) self.statusbar = QtWidgets.QStatusBar(MainWindow) self.statusbar.setObjectName("statusbar") MainWindow.setStatusBar(self.statusbar) self.menubar.addAction(self.menuExit.menuAction()) self.pushButton.clicked.connect(self.goToManual) self.vid = MyVideoCapture(video_source=0) #for live video feed self.label_7 = QtWidgets.QLabel(self.centralwidget) self.label_7.setGeometry(QtCore.QRect(130, 120, 871, 641)) self.label_7.setObjectName("label_7") self.flag = False self.timer = QtCore.QTimer(self.centralwidget) self.timer.setSingleShot(False) self.timer.setInterval(1) # in milliseconds, so 5000 = 5 seconds self.retranslateUi(MainWindow) QtCore.QMetaObject.connectSlotsByName(MainWindow) self.speech_recognizer = speechsdk.SpeechRecognizer( speech_config=speech_config) self.timer2 = QtCore.QTimer(self.centralwidget) self.timer2.setSingleShot(False) self.timer2.setInterval(1) self.timer2.start() self.timer.start() self.timer.timeout.connect(self.wakeUp)