def __init__(self, *args, **kwargs): QMdiArea.__init__(self) ControlBase.__init__(self, *args, **kwargs) self._showCloseButton = True self._openWindows = [] self.logger = logging.getLogger(__name__)
def __init__(self, *args, **kwargs): QWidget.__init__(self) self._height = kwargs.get('height', None) self._plusFunction = kwargs.get('add_function', None) self._minusFunction = kwargs.get('remove_function', None) ControlBase.__init__(self, *args, **kwargs) self.autoscroll = kwargs.get('autoscroll', True) self.resizecolumns = kwargs.get('resizecolumns', True) self.select_entire_row = kwargs.get('select_entire_row', False) self.horizontal_headers = kwargs.get('horizontal_headers', None) self.item_selection_changed_event = kwargs.get( 'item_selection_changed_event', self.item_selection_changed_event) self.data_changed_event = kwargs.get('data_changed_event', self.data_changed_event) self.item_selection_changed_event = kwargs.get( 'item_selection_changed_event', self.item_selection_changed_event) self.current_cell_changed_event = kwargs.get( 'current_cell_changed_event', self.current_cell_changed_event) self.current_item_changed_event = kwargs.get( 'current_item_changed_event', self.current_item_changed_event) self.cell_double_clicked_event = kwargs.get( 'cell_double_clicked_event', self.cell_double_clicked_event)
def __init__(self, *args, **kwargs): QTreeView.__init__(self) ControlBase.__init__(self, *args, **kwargs) self.item_selection_changed_event = kwargs.get( 'item_selection_changed_event', self.item_selection_changed_event) self.item_double_clicked_event = kwargs.get( 'item_double_clicked_event', self.item_double_clicked_event)
def init_form(self): """ Load Control and initiate the events """ ControlBase.init_form(self) if self._value: QWebView.load(self, QUrl(self._value)) if self.help: self.form.setToolTip(self.help) self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
def __init__(self, *args, **kwargs): self._updateSlider = True self._min = kwargs.get('minimum', 0) self._max = kwargs.get('maximum', 100) if 'default' not in kwargs: kwargs['default'] = 0 ControlBase.__init__(self, *args, **kwargs) self._form.value.setText(str(kwargs['default'])) self._form.horizontalSlider.valueChanged.connect(self.valueChanged)
def __init__(self, *args, **kwargs): QFrame.__init__(self) ControlBase.__init__(self, *args, **kwargs) self.process_frame_event = kwargs.get('process_frame_event', self.process_frame_event) self._speed = 1 self.logger = logging.getLogger('pyforms') self._updateVideoFrame = True
def __init__(self, *args, **kwargs): QWidget.__init__(self) self._plusFunction = kwargs.get('add_function', None) self._minusFunction = kwargs.get('remove_function', None) ControlBase.__init__(self, *args, **kwargs) self.autoscroll = kwargs.get('autoscroll', True) self.resizecolumns = kwargs.get('resizecolumns', True) self.select_entire_row = kwargs.get('select_entire_row', False) self.horizontal_headers = kwargs.get('horizontal_headers', None)
def __init__(self, label="", default=0, min=0, max=100, **kwargs): """ :param label: :param default: :param min: :param max: :param kwargs: """ QWidget.__init__(self) ControlBase.__init__(self, label, default, **kwargs) self.add_popup_menu_option('Export to CSV', self.__export)
def __init__(self, *args, **kwargs): QWidget.__init__(self) layout = QVBoxLayout() if _api.USED_API == _api.QT_API_PYQT5: layout.setContentsMargins(0, 0, 0, 0) elif _api.USED_API == _api.QT_API_PYQT4: layout.setMargin(0) self.form.setLayout(layout) ControlBase.__init__(self, *args, **kwargs) self.value = kwargs.get('default', None)
def __init__(self, *args, **kwargs): """ :param int minimum: Minimum value. :param int maximum: Maximum value. :param float default: Set the value. Default = 0. :param int decimals: Decimals precision. :param float step: Step jump value. """ self._min = kwargs.get('minimum', 0) self._max = kwargs.get('maximum', 100) if 'default' not in kwargs: kwargs['default'] = 0 ControlBase.__init__(self, *args, **kwargs) self.decimals = kwargs.get('decimals', 0) self.step = kwargs.get('step', 1)
def __init__(self, *args, **kwargs): self._video_widget = None # GL widget QFrame.__init__(self) ControlBase.__init__(self, *args, **kwargs) self._multiple_files = kwargs.get('multiple_files', False) self._current_frame = None # current frame image self._current_frame_index = None # current frame index self.process_frame_event = kwargs.get('process_frame_event', self.process_frame_event) self._speed = 1 self.logger = logging.getLogger('pyforms') self._update_video_frame = True # if true update the spinbox with the current frame self._update_video_slider = True # if true update the slider with the current frame
def __init__(self, *args, **kwargs): """ :param tupple default: The default value is a list containing in the first element the lower value and in the second element the upper value. Default = [20,40]. :param bool horizontal: Flag indicating if the Bounding slider should be draw horizontally or vertically. Default = True. :param bool show_spinboxes: Show or hide the spinboxes. Default = True :param float minimum: Defines the minimum value that can be selected. :param float maximum: Defines the maximum value that can be selected. :param bool convert_2_int: Flag to define if the control should return floats or integers. """ self._horizontal = kwargs.get('horizontal', True) self._show_spinboxes = kwargs.get('show_spinboxes', True) ControlBase.__init__(self, *args, **kwargs) self.min = kwargs.get('min', kwargs.get('minimum', 0)) self.max = kwargs.get('max', kwargs.get('maximum', 100)) self.value = kwargs.get('default', [10,20]) self.convert_2_int = kwargs.get('convert_2_int', False) self.__update()
def __init__(self, *args, **kwargs): QTreeWidget.__init__(self) ControlBase.__init__(self, *args, **kwargs)
def __init__(self, *args, **kwargs): QWidget.__init__(self) ControlBase.__init__(self, *args, **kwargs) for item in kwargs.get('items', []): self.add_item(*item)
def __init__(self, label="", default=0, max=100): QWidget.__init__(self) ControlBase.__init__(self, label, default) self._max = 100 self._graphs_prop_win = GraphsProperties(self._time, self) self._graphsgenerator_win = GraphsEventsGenerator(self._time) self._graph2event_win = Graph2Event(self._time) # Popup menus that only show when clicking on a TIMELINEDELTA object self._deltaLockAction = self.add_popup_menu_option("Lock", self.__lockSelected, key='L') self._deltaColorAction = self.add_popup_menu_option( "Pick a color", self.__pickColor) self._deltaRemoveAction = self.add_popup_menu_option( "Remove", self.__removeSelected, key='Delete') self._deltaActions = [ self._deltaLockAction, self._deltaColorAction, self._deltaRemoveAction ] for action in self._deltaActions: action.setVisible(False) self.add_popup_menu_option("-") self.add_popup_menu_option("Graphs", self.show_graphs_properties, icon=conf.PYFORMS_ICON_EVENTTIMELINE_GRAPH) self.add_popup_menu_option("Apply a function to the graphs", self.__generate_graphs_events, icon=conf.PYFORMS_ICON_EVENTTIMELINE_GRAPH) self.add_popup_menu_option("Convert graph to events", self.__graph2event_event, icon=conf.PYFORMS_ICON_EVENTTIMELINE_GRAPH) self.add_popup_menu_option("-") # General righ click popup menus self.add_popup_menu_option("Row properties", self.__setLinePropertiesEvent, icon=conf.PYFORMS_ICON_EVENTTIMELINE_REMOVE) self.add_popup_menu_option("-") self.add_popup_menu_option("-") self.add_popup_menu_option( "Auto adjust rows", self.__auto_adjust_tracks_evt, icon=conf.PYFORMS_ICON_EVENTTIMELINE_REFRESH) self.add_popup_menu_option("Add a row", self.__add_track_2_bottom_evt, icon=conf.PYFORMS_ICON_EVENTTIMELINE_ADD) self.add_popup_menu_option("-") clean_menu = self.add_popup_submenu('Clean') self.add_popup_menu_option('The current row', function_action=self.__cleanLine, menu=clean_menu) self.add_popup_menu_option('-') self.add_popup_menu_option('All graphs', function_action=self.__cleanCharts, menu=clean_menu) self.add_popup_menu_option('-') self.add_popup_menu_option('Everything', function_action=self.clean, menu=clean_menu)
def __init__(self, *args, **kwargs): self._updateSlider = True self._min = kwargs.get('minimum', 0) self._max = kwargs.get('maximum', 100) if 'default' not in kwargs: kwargs['default'] = 0 ControlBase.__init__(self, *args, **kwargs)
def __init__(self, *args, **kwargs): QWidget.__init__(self) ControlBase.__init__(self, *args, **kwargs) self.on_draw = kwargs.get('on_draw', self.on_draw)
def __init__(self, *args, **kwargs): ControlBase.__init__(self, *args, **kwargs) self.autoscroll = kwargs.get('autoscroll', False)
def __init__(self, *args, **kwargs): QWebView.__init__(self) if 'load_finished_event' in kwargs: self.load_finished_event = kwargs['load_finished_event'] self.loadFinished.connect(self.__load_finished_evt) ControlBase.__init__(self, *args, **kwargs)
def __init__(self, label="", default=0, max=100): QWidget.__init__(self) ControlBase.__init__(self, label, default) self._max = 100 self._graphs_prop_win = GraphsProperties(self._time, self) self._graphsgenerator_win = GraphsEventsGenerator(self._time) self._graph2event_win = Graph2Event(self._time) ############################################################################################### ######## EVENTS ACTIONS ####################################################################### ############################################################################################### # Popup menus that only show when clicking on a TIMELINEDELTA object event_remove_action = self.add_popup_menu_option( "Remove event", self.__removeSelected, key='Delete', icon=conf.ANNOTATOR_ICON_DELETE) separator_action = self.add_popup_menu_option("-") self._events_actions = [event_remove_action, separator_action] for action in self._events_actions: action.setVisible(False) ############################################################################################### ######## TRACKS ACTIONS ####################################################################### ############################################################################################### # General right click popup menus track_properties_action = self.add_popup_menu_option( "Row properties", self.__open_track_properties_evt, icon=conf.ANNOTATOR_ICON_INFO) track_insert_action = self.add_popup_menu_option( "Insert row", self.__add_track_evt, icon=conf.ANNOTATOR_ICON_ADD) track_remove_action = self.add_popup_menu_option( "Remove row", self.__remove_current_track_evt, icon=conf.ANNOTATOR_ICON_DELETE) track_moveup_action = self.add_popup_menu_option( "Move up", self.__move_track_up_evt, icon=conf.PYFORMS_ICON_EVENTTIMELINE_IMPORT) track_movedown_action = self.add_popup_menu_option( "Move down", self.__move_track_down_evt, icon=conf.PYFORMS_ICON_EVENTTIMELINE_EXPORT) separator_action = self.add_popup_menu_option("-") self._tracks_actions = [ track_properties_action, track_insert_action, track_remove_action, track_moveup_action, track_movedown_action, separator_action ] for action in self._tracks_actions: action.setVisible(False) ############################################################################################### ######## GRAPHS ACTIONS ####################################################################### ############################################################################################### self.add_popup_menu_option("Graphs", self.open_graphs_properties, icon=conf.PYFORMS_ICON_EVENTTIMELINE_GRAPH) self.add_popup_menu_option("Apply a function to the graphs", self.__generate_graphs_events, icon=conf.PYFORMS_ICON_EVENTTIMELINE_GRAPH) self.add_popup_menu_option("Convert graph to events", self.__graph2event_event, icon=conf.PYFORMS_ICON_EVENTTIMELINE_GRAPH) self.add_popup_menu_option("-") self.add_popup_menu_option( "Auto adjust rows", self.__auto_adjust_tracks_evt, icon=conf.PYFORMS_ICON_EVENTTIMELINE_REFRESH) self.add_popup_menu_option("Remove everything", self.clean, icon=conf.ANNOTATOR_ICON_DELETE) self._importwin = None # import window.
def __init__(self, *args, **kwargs): QTableView.__init__(self) ControlBase.__init__(self, *args, **kwargs) if kwargs.get('select_entire_row', False): self.setSelectionBehavior(QAbstractItemView.SelectRows)