Example #1
0
 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)
Example #2
0
    def __init__(self, *args):
        QFrame.__init__(self)
        ControlBase.__init__(self, *args)

        self._speed = 1
        self.logger = logging.getLogger('pyforms')

        self._updateVideoFrame = True
Example #3
0
    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)
Example #4
0
	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)
Example #5
0
    def __init__(self, *args, **kwargs):
        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.__update()
Example #6
0
    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 = False

        self.select_entire_row = kwargs.get('select_entire_row', False)
Example #7
0
    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)
Example #8
0
	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)
Example #9
0
    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)
Example #10
0
 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)
Example #11
0
 def __init__(self, *args, **kwargs):
     ControlBase.__init__(self, *args, **kwargs)
     self.autoscroll = False
Example #12
0
 def __init__(self, *args, **kwargs):
     QWidget.__init__(self)
     ControlBase.__init__(self, *args, **kwargs)
Example #13
0
 def __init__(self, *args, **kwargs):
     ControlBase.__init__(self, *args, **kwargs)
     self.autoscroll = kwargs.get('autoscroll', False)
Example #14
0
 def __init__(self, *args, **kwargs):
     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)
Example #15
0
    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("Rows",
                                   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,
                                   submenu=clean_menu)
        self.add_popup_menu_option('-')
        self.add_popup_menu_option('All graphs',
                                   function_action=self.__cleanCharts,
                                   submenu=clean_menu)
        self.add_popup_menu_option('-')
        self.add_popup_menu_option('Everything',
                                   function_action=self.clean,
                                   submenu=clean_menu)
Example #16
0
 def __init__(self, *args, **kwargs):
     QWebView.__init__(self)
     if 'load_finnished_event' in kwargs:
         self.load_finnished_event = kwargs['load_finnished_event']
     self.loadFinished.connect(self.__load_finnished_evt)
     ControlBase.__init__(self, *args, **kwargs)
 def __init__(self, *args, **kwargs):
     self._value = kwargs.get('value')
     QWidget.__init__(self)
     ControlBase.__init__(self, *args, **kwargs)
Example #18
0
    def __init__(self, *args, **kwargs):
        QTableView.__init__(self)
        ControlBase.__init__(self, *args, **kwargs)

        if kwargs.get('select_entire_row', False):
            self.setSelectionBehavior(QAbstractItemView.SelectRows)
Example #19
0
 def __init__(self, *args, **kwargs):
     QTreeView.__init__(self)
     ControlBase.__init__(self, *args, **kwargs)