def init_form(self): # Get the current path of the file rootPath = os.path.dirname(__file__) # Load the UI for the self instance uic.loadUi(os.path.join(rootPath, "video.ui"), self) # Define the icon for the Play button self.videoPlay.setIcon(conf.PYFORMS_ICON_VIDEOPLAYER_PAUSE_PLAY) self._videoWidget = VideoGLWidget() self._videoWidget._control = self self.videoLayout.addWidget(self._videoWidget) self.videoPlay.clicked.connect(self.videoPlay_clicked) self.videoFrames.valueChanged.connect(self.videoFrames_valueChanged) self.videoProgress.valueChanged.connect( self.videoProgress_valueChanged) self.videoProgress.sliderReleased.connect( self.videoProgress_sliderReleased) self._timer = QtCore.QTimer(self) self._timer.timeout.connect(self.update_frame) self.form.horizontalSlider.valueChanged.connect(self.__rotateZ) self.form.verticalSlider.valueChanged.connect(self.__rotateX) self._currentFrame = None self.view_in_3D = False
def init_form(self): plusFunction = self._plusFunction minusFunction = self._minusFunction # Get the current path of the file rootPath = os.path.dirname(__file__) # Load the UI for the self instance uic.loadUi(os.path.join(rootPath, "list.ui"), self) self.label = self._label self.tableWidget.currentCellChanged.connect(self.tableWidgetCellChanged) self.tableWidget.currentItemChanged.connect(self.tableWidgetItemChanged) self.tableWidget.itemSelectionChanged.connect(self.tableWidgetItemSelectionChanged) self.tableWidget.cellDoubleClicked.connect(self.tableWidgetCellDoubleClicked) self.tableWidget.model().dataChanged.connect(self._dataChangedEvent) self.tableWidget.horizontalHeader().setVisible(False) if plusFunction is None and minusFunction is None: self.plusButton.hide() self.minusButton.hide() elif plusFunction is None: self.plusButton.hide() self.minusButton.pressed.connect(minusFunction) elif minusFunction is None: self.minusButton.hide() self.plusButton.pressed.connect(plusFunction) else: self.plusButton.pressed.connect(plusFunction) self.minusButton.pressed.connect(minusFunction)
def __init__(self, task_parameters): super().__init__() uic.loadUi(self._file, self) self._buttonBox_accepted = False self._task_parameters = task_parameters self.actionReload_defaults.triggered.connect( self._load_task_parameters) self.buttonBox.accepted.connect(self._button_accepted_callback) self.buttonBox.rejected.connect(self.close) self._load_task_parameters() self.show()
def __init__(self, parent, track_id): """ :param parent: :param track_id: """ super(TimelinePopupWindow, self).__init__(parent=parent) self._parent = parent control_path = tools.getFileInSameDirectory(__file__, "TimelinePopupWindow.ui") self._ui = uic.loadUi(control_path) self._ui.setWindowTitle("Row {:d} properties".format(track_id + 1)) # Dialog variables self.behaviors = [] self.behavior = None self.color = self._parent.color self.current_track = track_id self._default_comboBox_text = "Add a new label" self.__get_existing_tracklabels() # Set default color display self.__preview_color() # SIGNALS self._ui.comboBox.currentIndexChanged.connect( self.__on_comboBox_change) self._ui.pushButton_add.clicked.connect(self.__add_behavior) self._ui.pushButton_remove.clicked.connect(self.__remove_behavior) self._ui.pushButton_color.clicked.connect(self.__pick_color)
def init_form(self): control_path = tools.getFileInSameDirectory(__file__, "fileInput.ui") self._form = uic.loadUi(control_path) self._form.label.setText(self._label) self._form.pushButton.clicked.connect(self.click) self.form.lineEdit.editingFinished.connect(self.finishEditing) self._form.pushButton.setIcon(conf.PYFORMS_ICON_FILE_OPEN)
def init_form(self): module_path = os.path.abspath(os.path.dirname(__file__)) control_path = os.path.join(module_path, "progressInput.ui") self._form = uic.loadUi(control_path) self._form.horizontalSlider.setMinimum(self._min) self._form.horizontalSlider.setMaximum(self._max) self._form.horizontalSlider.setValue(self._value) self._form.horizontalSlider.setFormat(self._label)
def init_form(self): control_path = tools.getFileInSameDirectory(__file__, "sliderInput.ui") self._form = uic.loadUi(control_path) self._form.label.setText(self._label) self.form.label.setAccessibleName('ControlSlider-label') self._form.horizontalSlider.setMinimum(self._min) self._form.horizontalSlider.setMaximum(self._max) self._form.horizontalSlider.setValue(self._value)
def init_form(self): control_path = tools.getFileInSameDirectory(__file__, "number.ui") self._form = uic.loadUi(control_path) self.min = self._min self.max = self._max self.label = self._label self.value = self._value self.form.label.setAccessibleName('ControlNumber-label') self.form.spinBox.valueChanged.connect(self.update_event)
def init_form(self): control_path = tools.getFileInSameDirectory(__file__, "tree.ui") self._form = uic.loadUi(control_path) self._form.label.setText(self._label) self._form.listWidget.itemChanged.connect(self.item_changed) self._form.listWidget.itemSelectionChanged.connect(self.__itemSelectionChanged) if self.help: self.form.setToolTip(self.help)
def init_form(self): control_path = tools.getFileInSameDirectory(__file__, "textArea.ui") self._form = uic.loadUi(control_path) self._form.label.setText(self._label) if self._value: self._form.plainTextEdit.setPlainText(str(self._value)) if not self._label or len(self._label) == 0: self.form.label.hide() super(ControlTextArea, self).init_form() self.form.plainTextEdit.textChanged.connect(self.finishEditing)
def init_form(self): control_path = tools.getFileInSameDirectory(__file__, "checkbox.ui") self._form = uic.loadUi(control_path) self._form.checkBox.setText(self._label) self._form.checkBox.stateChanged.connect(self.__checkedToggle) if self._value and self._value != '': self._form.checkBox.setCheckState(QtCore.Qt.Checked) else: self._form.checkBox.setCheckState(QtCore.Qt.Unchecked) if self.help: self.form.setToolTip(self.help)
def init_form(self): control_path = tools.getFileInSameDirectory(__file__, "textInput.ui") self._form = uic.loadUi(control_path) self.form.label.setText(self._label) if self._value is not None: self.form.lineEdit.setText(self._value) self.form.setToolTip(self.help) super(ControlText, self).init_form() self.form.label.setAccessibleName('ControlText-label') self.form.lineEdit.editingFinished.connect(self.finishEditing) self.form.lineEdit.keyPressEvent = self.__key_pressed
def init_form(self): control_path = tools.getFileInSameDirectory(__file__, "comboInput.ui") self._form = uic.loadUi(control_path) self._form.comboLabel.setAccessibleName('ControlCombo-label') self._form.comboBox.currentIndexChanged.connect( self._currentIndexChanged) self._form.comboBox.activated.connect(self._activated) self._form.comboBox.highlighted.connect(self._highlighted) self._form.comboBox.editTextChanged.connect(self._editTextChanged) self._items = {} self._addingItem = False self.label = self._label
def init_form(self): """ """ control_path = tools.getFileInSameDirectory(__file__, "code_editor.ui") self._form = uic.loadUi(control_path) self._code_editor = self._form.code_editor self._save_button = self._form.save_button self._discart_button = self._form.discart_button self._save_button.clicked[bool].connect(self.on_save_changes) self._discart_button.clicked[bool].connect(self.on_discart_changes) if self._read_only: self._code_editor.setReadOnly(True) self._save_button.setVisible(False) self._discart_button.setVisible(False) self.form.font_size.addItem('9') self.form.font_size.addItem('10') self.form.font_size.addItem('11') self.form.font_size.addItem('12') self.form.font_size.addItem('14') self.form.font_size.addItem('18') self.form.font_size.addItem('24') # Set the default font size index = self.form.font_size.findText( conf.PYFORMS_CONTROL_CODE_EDITOR_DEFAULT_FONT_SIZE) self.form.font_size.setCurrentIndex(index) self.form.font_size.currentIndexChanged.connect( self.__font_size_index_changed) self.form.save_button.setIcon(QIcon(conf.PYFORMS_ICON_CODEEDITOR_SAVE)) self.form.discart_button.setIcon( QIcon(conf.PYFORMS_ICON_CODEEDITOR_DISCART)) self.lexer = QsciLexerPython self._code_editor.keyPressEvent = self._key_pressed self._changed_func = None self.value = self._value super(ControlCodeEditor, self).init_form()
def init_form(self): control_path = tools.getFileInSameDirectory(__file__, "image.ui") self._form = uic.loadUi(control_path) self._imageWidget = VideoGLWidget() self._form.imageLayout.addWidget(self._imageWidget) super(ControlImage, self).init_form()
def init_form(self): control_path = tools.getFileInSameDirectory(__file__, "fileInput.ui") self._form = uic.loadUi(control_path) self._form.label.setText(self._label) self._form.lineEdit.setText(self._value)
def init_form(self): control_path = tools.getFileInSameDirectory(__file__, "label.ui") self._form = uic.loadUi(control_path) self._form.label.setText(self._label) super(ControlLabel, self).init_form()