コード例 #1
0
    def __init__(self, parent):
        QComboBox.__init__(self, parent=parent)

        # modellist is a list of dicts that contains basic model attributes.
        # The first element represents the current model,
        # and it can be None if no current model is set.
        self.modellist = []
コード例 #2
0
ファイル: caseselector.py プロジェクト: oyvindeide/ert
    def __init__(
        self,
        facade: LibresFacade,
        notifier: ErtNotifier,
        update_ert: bool = True,
        show_only_initialized: bool = False,
        ignore_current: bool = False,
        help_link: str = "init/current_case_selection",
    ):
        self.facade = facade
        QComboBox.__init__(self)
        self._update_ert = update_ert  # If true current case of ert will be change
        self._show_only_initialized = (
            show_only_initialized  # only show initialized cases
        )
        self._ignore_current = (
            ignore_current  # ignore the currently selected case if it changes
        )

        addHelpToWidget(self, help_link)
        self.setSizeAdjustPolicy(QComboBox.AdjustToContents)

        self.populate()

        self.currentIndexChanged[int].connect(self.selectionChanged)
        notifier.ertChanged.connect(self.populate)
コード例 #3
0
 def __init__(self, parent=None, init_channel=None):
     QComboBox.__init__(self, parent)
     PyDMWritableWidget.__init__(self, init_channel=init_channel)
     self._has_enums = False
     self.activated[int].connect(self.internal_combo_box_activated_int)
     self.setContextMenuPolicy(Qt.DefaultContextMenu)
     self.contextMenuEvent = self.open_context_menu
コード例 #4
0
 def __init__(self, arg):
     QComboBox.__init__(self, arg)
     self.actorlist = QListWidget()
     self.setModel(self.actorlist.model())
     self.setView(self.actorlist)
     self.view().installEventFilter(self)
     self.parent = None
コード例 #5
0
    def __init__(self, params):
        MWB.__init__(self, params)
        QComboBox.__init__(self)

        self.addItems(self.node.targets)

        self.currentTextChanged.connect(self.text_changed)
        self.set_target(self.node.target)
コード例 #6
0
 def __init__(self, parent=None, init_channel=None, items=None):
     """Init."""
     QComboBox.__init__(self, parent)
     PyDMWritableWidget.__init__(self, init_channel=init_channel)
     self._has_items = False
     self.set_items(items)
     self.currentTextChanged.connect(self._send_value)
     self.setContextMenuPolicy(Qt.DefaultContextMenu)
     self.contextMenuEvent = self.open_context_menu
コード例 #7
0
    def __init__(self, parent=None, init_channel=None):
        QComboBox.__init__(self, parent)
        PyDMWritableWidget.__init__(self, init_channel=init_channel)
        self._has_enums = False
        self.activated[int].connect(self.internal_combo_box_activated_int)
        self.setContextMenuPolicy(Qt.DefaultContextMenu)
        self.contextMenuEvent = self.open_context_menu

        # Because of the way PyQt5 UI parser enumerates combobox items (first adding an item with an empty title
        # and then resetting that title to the actual text), we can't distinguish it from the regular title change.
        # This flag helps tracking title change followed immediately after adding a new item.
        self._new_item_added = False
コード例 #8
0
    def __init__(self, parent):
        QComboBox.__init__(self, parent=parent)

        # modellist is a list of dicts that contains basic model attributes.
        # The first element represents the current model,
        # and it can be None if no current model is set.
        self.modellist = []

        self.activated.connect(self.on_activated)
        self.currentIndexChanged.connect(self.on_currentIndexChanged)
        self.editTextChanged.connect(self.on_editTextChanged)
        self.highlighted.connect(self.on_highlighted)
コード例 #9
0
ファイル: caseselector.py プロジェクト: tayloris/ert
    def __init__(self, update_ert=True, show_only_initialized=False, ignore_current=False, help_link="init/current_case_selection"):
        QComboBox.__init__(self)
        self._update_ert = update_ert # If true current case of ert will be change
        self._show_only_initialized = show_only_initialized # only show initialized cases
        self._ignore_current = ignore_current # ignore the currently selected case if it changes


        addHelpToWidget(self, help_link)
        self.setSizeAdjustPolicy(QComboBox.AdjustToContents)

        self.populate()

        self.currentIndexChanged[int].connect(self.selectionChanged)
        ERT.ertChanged.connect(self.populate)
コード例 #10
0
    def __init__(self, parent, ctrls, setpoint=None, readback=None, acc='SI'):
        """."""
        QComboBox.__init__(self, parent)
        PyDMPrimitiveWidget.__init__(self)
        self.setpoint = setpoint or dict()
        self.readback = readback or dict()
        self.ctrls = ctrls
        self._csorb = SOFBFactory.create(acc)
        self._config_type = acc.lower() + '_orbit'
        self._client = ConfigDBClient(config_type=self._config_type)
        self.orbits = {
            'x': _np.zeros(self._csorb.nr_bpms, dtype=float),
            'y': _np.zeros(self._csorb.nr_bpms, dtype=float)
        }
        self.signals_to_watch = dict()
        self.slots = {
            'x': _part(self._watch_if_changed, 'x'),
            'y': _part(self._watch_if_changed, 'y')
        }

        self.setup_ui()
        self.connect_signals()
コード例 #11
0
 def __init__(self, parent):
     QComboBox.__init__(self, parent)
     self.setEditable(True)
     self.setCompleter(QCompleter(self))
     self.numpress = 0
     self.selected_text = self.currentText()
コード例 #12
0
ファイル: comboboxes.py プロジェクト: rlaverde/spyder
 def __init__(self, parent):
     QComboBox.__init__(self, parent)
     self.setEditable(True)
     self.setCompleter(QCompleter(self))
     self.numpress = 0
     self.selected_text = self.currentText()