Exemplo n.º 1
0
    def __init__(self, color_maps=None, parent=None):
        QComboBox.__init__(self, parent)
        self.setMaxVisibleItems(10)
        self.setStyleSheet("QComboBox { combobox-popup: 0; }")

        if color_maps is None:
            color_maps = self._type_sorted_color_maps()

        self.setMinimumWidth(170)
        self.setMaximumWidth(170)
        self.setMinimumHeight(30)

        self.setIconSize(QSize(128, 16))

        icon_width = 256
        icon_height = 16
        values = np.linspace(0, 1, icon_width)
        color_indexes = np.linspace(0, 255, icon_width, dtype=np.uint8)
        color_indexes = np.tile(color_indexes, icon_height)
        image = QImage(color_indexes.data, icon_width, icon_height,
                       QImage.Format_Indexed8)

        for index, item in enumerate(color_maps):
            self.addItem(item)
            pix_map = self._create_icon(item, image, values)
            self.setItemData(index, "", Qt.DisplayRole)
            self.setItemData(index, item, Qt.ToolTipRole)
            self.setItemData(index, pix_map, Qt.DecorationRole)
Exemplo n.º 2
0
    def __init__(self, fileBrowser):
        QComboBox.__init__(self, fileBrowser)

        self._fileBrowser = fileBrowser

        self.setAttribute( Qt.WA_MacShowFocusRect, False )
        self.setAttribute( Qt.WA_MacSmallSize )
        self.setEditable(True)
        self.setMinimumContentsLength(1)
        self.setSizeAdjustPolicy(QComboBox.AdjustToMinimumContentsLengthWithIcon)
        self.lineEdit().setReadOnly( False )
        self._completionModel = QDirModel(self.lineEdit())
        self._completionModel.setFilter( QDir.AllDirs | QDir.NoDotAndDotDot )
        self.lineEdit().setCompleter(QCompleter(self._completionModel,
                                               self.lineEdit()))
        #TODO QDirModel is deprecated but QCompleter does not yet handle
        #QFileSystemModel - please update when possible.
        self._count = 0

        # Show popup action
        self._showPopupAction = QAction(QIcon(':enkiicons/filtered.png'), "File browser history", self)
        self._showPopupAction.setShortcut('Ctrl+H')
        core.actionManager().addAction("mNavigation/mFileBrowser/aMenuShow", self._showPopupAction)
        self._showPopupAction.triggered.connect(self._onShowPopup)

        # reconnected in self.updateComboItems()
        self.currentIndexChanged[int].connect(self._onItemSelected)
Exemplo n.º 3
0
 def __init__(self, parent=None):
     QComboBox.__init__(self, parent)
     self.__delegate = ComboItemDelegate(self)
     self.setItemDelegate(self.__delegate)
     self._items = []
     # Avoid XXL line edit size
     self.setMinimumContentsLength(20)
Exemplo n.º 4
0
    def __init__(self, fileBrowser):
        QComboBox.__init__(self, fileBrowser)

        self._fileBrowser = fileBrowser

        self.setAttribute(Qt.WA_MacShowFocusRect, False)
        self.setAttribute(Qt.WA_MacSmallSize)
        self.setEditable(True)
        self.setMinimumContentsLength(1)
        self.setSizeAdjustPolicy(
            QComboBox.AdjustToMinimumContentsLengthWithIcon)
        self.lineEdit().setReadOnly(False)
        self._completionModel = QDirModel(self.lineEdit())
        self._completionModel.setFilter(QDir.AllDirs | QDir.NoDotAndDotDot)
        self.lineEdit().setCompleter(
            QCompleter(self._completionModel, self.lineEdit()))
        #TODO QDirModel is deprecated but QCompleter does not yet handle
        #QFileSystemModel - please update when possible.
        self._count = 0

        # Show popup action
        self._showPopupAction = QAction(QIcon(':enkiicons/filtered.png'),
                                        "File browser history", self)
        self._showPopupAction.setShortcut('Ctrl+H')
        core.actionManager().addAction("mNavigation/mFileBrowser/aMenuShow",
                                       self._showPopupAction)
        self._showPopupAction.triggered.connect(self._onShowPopup)

        # reconnected in self.updateComboItems()
        self.currentIndexChanged[int].connect(self._onItemSelected)
Exemplo n.º 5
0
 def __init__(self, value):
     QComboBox.__init__(self)
     self._value = value
     for k, l in value.choices.iteritems():
         self.addItem(l, QVariant(k))
         if value.default == k:
             self.setCurrentIndex(self.count()-1)
Exemplo n.º 6
0
 def __init__(self, value):
     QComboBox.__init__(self)
     self._value = value
     for k, l in value.choices.iteritems():
         self.addItem(l, QVariant(k))
         if value.default == k:
             self.setCurrentIndex(self.count()-1)
Exemplo n.º 7
0
    def __init__( self, parent = None ):
        QComboBox.__init__( self, parent )

        self.custom = QColor( Qt.black )
        self.populateList()

        self.connect( self, SIGNAL( 'activated(int)' ), self.onActivated )
Exemplo n.º 8
0
    def __init__(self, client, arg, value, compatibility=None):

        ArgFilterBase.__init__(self, client, arg, value, compatibility)
        QComboBox.__init__(self)
        assert compatibility is not None

        self.setEditable(True)
        self.users = []
        self.setDuplicatesEnabled(False)

        # This attribut is used to prevent an infinite loop
        # when we change text or list values as we are in the
        # editTextChanged callback.
        self.lock = False

#        if value and (isinstance(value, (int,long)) or isinstance(value, (str, unicode)) and value.isdigit()):
        if value:
            if self.compatibility.user_id:
                userlist = self.client.call('ufwi_log', 'table', 'UserIDTable', {'user_id': value})
            else:
                userlist = self.client.call('ufwi_log', 'table', 'UserIDTable', {'username': value})

            if userlist:
                if self.compatibility.user_id:
                    self.textChanged(userlist[0][0])
                else:
                    self.textChanged(userlist[0])
            else:
                self.textChanged('') # to initialize state to NOLIST
        else:
            self.textChanged('') # to initialize state to NOLIST

        self.connect(self, SIGNAL('currentIndexChanged(int)'), self.indexChanged)
        self.connect(self, SIGNAL('editTextChanged(const QString &)'), self.textChanged)
Exemplo n.º 9
0
    def __init__(self, parent=None):
        QComboBox.__init__(self, parent)

        self.custom = QColor(Qt.black)
        self.populateList()

        self.connect(self, SIGNAL('activated(int)'), self.onActivated)
Exemplo n.º 10
0
    def __init__(self, tree, dataset, master, parent=None):
        QComboBox.__init__(self, parent)
        Control.__init__(self, tree, dataset, master)

        self.setSelectionMode(QListView.ExtendedSelection)
        model = QStringListModel(self)
        self.setModel(model)
        self.setOptions(tree.subelements_top("Option"))
Exemplo n.º 11
0
    def __init__(self, parent=None):
        QComboBox.__init__(self, parent)
        self.addItems(["ipv4", "ipv6"])
        self.setToolTip("Choose IP version")

        self.ip_version = 4

        self.connect(self, SIGNAL('currentIndexChanged(QString)'), self.change)
Exemplo n.º 12
0
 def __init__( self, insertOnEnter = True, parent = None ):
     QComboBox.__init__( self, parent )
     self.setEditable( True )
     self.setAutoCompletion( False )
     self.setDuplicatesEnabled( False )
     self.setInsertPolicy( QComboBox.NoInsert )
     self.insert = insertOnEnter
     return
Exemplo n.º 13
0
    def __init__(self, tree, dataset, master, parent=None):
        QComboBox.__init__(self, parent)
        Control.__init__(self, tree, dataset, master)

        self.setSelectionMode(QListView.ExtendedSelection)
        model = QStringListModel(self)
        self.setModel(model)
        self.setOptions(tree.subelements_top("Option"))
Exemplo n.º 14
0
    def __init__(self, modelname=MODEL_NETWORKS_EXCL_HA, parent=None):
        QComboBox.__init__(self, parent)
        self.qnetobject = QNetObject.getInstance()
        self.__modelname = modelname

        self.setModel(
            self.qnetobject.models[self.__modelname]
        )
Exemplo n.º 15
0
    def __init__(self, name, data, scheme, parent=None):
        QComboBox.__init__(self, parent)
        NodeWidget.__init__(self, name, data, scheme)

        self._load_options()
        for i, option in enumerate(self.options):
            self.addItem(unicode(option), i)
        self.load()
        self.currentIndexChanged.connect(lambda index: self.dump())
Exemplo n.º 16
0
 def __init__(self, parent, items=None, tip=None, adjust_to_minimum=True):
     QComboBox.__init__(self, parent)
     if adjust_to_minimum:
         self.setSizeAdjustPolicy(QComboBox.AdjustToMinimumContentsLength)
     self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
     self.setEditable(True)
     if items is not None:
         self.addItems(items)
     if tip is not None:
         self.setToolTip(tip)
Exemplo n.º 17
0
    def __init__(self, ifaces, parent=None):
        QComboBox.__init__(self, parent)
        self.setEditable(False)
        self.setToolTip("Select a network interface")

        self.labels2ifaces = {}
        for iface in ifaces:
            self.labels2ifaces[iface.user_label] = iface

        self.addItems(self.labels2ifaces.keys())
Exemplo n.º 18
0
    def __init__(self, chooseInterface, parent):
        QComboBox.__init__(self, parent)
        selectable = list()
        for interface in QNetObject.getInstance().netcfg.iterInterfaces():
            if not callable(chooseInterface) or chooseInterface(interface):
                selectable.append(("%s" % interface.fullName(), QVariant(interface.unique_id)))

        selectable.sort()
        for item in selectable:
            self.addItem(*item)
Exemplo n.º 19
0
    def __init__(self, finders, iface, parent=None):
        self.iface = iface
        self.mapCanvas = iface.mapCanvas()
        self.rubber = QgsRubberBand(self.mapCanvas)
        self.rubber.setColor(QColor(255, 255, 50, 200))
        self.rubber.setIcon(self.rubber.ICON_CIRCLE)
        self.rubber.setIconSize(15)
        self.rubber.setWidth(4)
        self.rubber.setBrushStyle(Qt.NoBrush)

        QComboBox.__init__(self, parent)
        self.setEditable(True)
        self.setInsertPolicy(QComboBox.InsertAtTop)
        self.setMinimumHeight(27)
        self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)

        self.insertSeparator(0)
        self.lineEdit().returnPressed.connect(self.search)

        self.resultView = QTreeView()
        self.resultView.setHeaderHidden(True)
        self.resultView.setMinimumHeight(300)
        self.resultView.activated.connect(self.itemActivated)
        self.resultView.pressed.connect(self.itemPressed)
        self.setView(self.resultView)

        self.resultModel = ResultModel(self)
        self.setModel(self.resultModel)

        self.finders = finders
        for finder in self.finders.values():
            finder.resultFound.connect(self.resultFound)
            finder.limitReached.connect(self.limitReached)
            finder.finished.connect(self.finished)

        self.clearButton = QPushButton(self)
        self.clearButton.setIcon(
            QIcon(":/plugins/quickfinder/icons/draft.svg"))
        self.clearButton.setText('')
        self.clearButton.setFlat(True)
        self.clearButton.setCursor(QCursor(Qt.ArrowCursor))
        self.clearButton.setStyleSheet('border: 0px; padding: 0px;')
        self.clearButton.clicked.connect(self.clear)

        layout = QHBoxLayout(self)
        self.setLayout(layout)
        layout.addStretch()
        layout.addWidget(self.clearButton)
        layout.addSpacing(20)

        buttonSize = self.clearButton.sizeHint()
        # frameWidth = self.lineEdit().style().pixelMetric(QtGui.QStyle.PM_DefaultFrameWidth)
        padding = buttonSize.width()  # + frameWidth + 1
        self.lineEdit().setStyleSheet('QLineEdit {padding-right: %dpx; }' %
                                      padding)
Exemplo n.º 20
0
 def __init__(self, parent, items=None, tip=None,
              adjust_to_minimum=True):
     QComboBox.__init__(self, parent)
     if adjust_to_minimum:
         self.setSizeAdjustPolicy(QComboBox.AdjustToMinimumContentsLength)
     self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
     self.setEditable(True)
     if items is not None:
         self.addItems(items)
     if tip is not None:
         self.setToolTip(tip)
Exemplo n.º 21
0
 def __init__(self, name, value, values, categoryName=None):
     """ Constructor.
     """
     Property.__init__(self, name, categoryName)
     QComboBox.__init__(self)
     self._values=values
     for v in values:
         self.addItem(str(v))
     if value in values:
         self.setCurrentIndex(values.index(value))
     self.connect(self, SIGNAL('currentIndexChanged(int)'), self.valueChanged)
Exemplo n.º 22
0
 def __init__(self, name, value, values, categoryName=None):
     """ Constructor.
     """
     Property.__init__(self, name, categoryName)
     QComboBox.__init__(self)
     self._values=values
     for v in values:
         self.addItem(str(v))
     if value in values:
         self.setCurrentIndex(values.index(value))
     self.connect(self, SIGNAL('currentIndexChanged(int)'), self.valueChanged)
Exemplo n.º 23
0
    def __init__(self, finders, iface, parent=None):
        self.iface = iface
        self.mapCanvas = iface.mapCanvas()
        self.rubber = QgsRubberBand(self.mapCanvas)
        self.rubber.setColor(QColor(255, 255, 50, 200))
        self.rubber.setIcon(self.rubber.ICON_CIRCLE)
        self.rubber.setIconSize(15)
        self.rubber.setWidth(4)
        self.rubber.setBrushStyle(Qt.NoBrush)

        QComboBox.__init__(self, parent)
        self.setEditable(True)
        self.setInsertPolicy(QComboBox.InsertAtTop)
        self.setMinimumHeight(27)
        self.setSizePolicy(QSizePolicy.Expanding,
                           QSizePolicy.Fixed)

        self.insertSeparator(0)
        self.lineEdit().returnPressed.connect(self.search)

        self.resultView = QTreeView()
        self.resultView.setHeaderHidden(True)
        self.resultView.setMinimumHeight(300)
        self.resultView.activated.connect(self.itemActivated)
        self.resultView.pressed.connect(self.itemPressed)
        self.setView(self.resultView)

        self.resultModel = ResultModel(self)
        self.setModel(self.resultModel)

        self.finders = finders
        for finder in self.finders.values():
            finder.resultFound.connect(self.resultFound)
            finder.limitReached.connect(self.limitReached)
            finder.finished.connect(self.finished)

        self.clearButton = QPushButton(self)
        self.clearButton.setIcon(QIcon(":/plugins/quickfinder/icons/draft.svg"))
        self.clearButton.setText('')
        self.clearButton.setFlat(True)
        self.clearButton.setCursor(QCursor(Qt.ArrowCursor))
        self.clearButton.setStyleSheet('border: 0px; padding: 0px;')
        self.clearButton.clicked.connect(self.clear)

        layout = QHBoxLayout(self)
        self.setLayout(layout)
        layout.addStretch()
        layout.addWidget(self.clearButton)
        layout.addSpacing(20)

        buttonSize = self.clearButton.sizeHint()
        # frameWidth = self.lineEdit().style().pixelMetric(QtGui.QStyle.PM_DefaultFrameWidth)
        padding = buttonSize.width()  # + frameWidth + 1
        self.lineEdit().setStyleSheet('QLineEdit {padding-right: %dpx; }' % padding)
Exemplo n.º 24
0
    def __init__(self, lst, current, callback):
        QComboBox.__init__(self)
        Cell.__init__(self)
        self.clear()

        for tmpl in lst:
            self.addItem(tmpl)
        self.setCurrentIndex(0)
        if current < len(lst):
            self.setCurrentIndex(current)

        self.connect(self, SIGNAL("currentIndexChanged ( int )"), callback)
Exemplo n.º 25
0
    def __init__( self, parent = None ):
        QComboBox.__init__( self, parent )
        self.setSizeAdjustPolicy( QComboBox.AdjustToMinimumContentsLength )
        sizePolicy = QSizePolicy( QSizePolicy.Expanding, QSizePolicy.Fixed )
        sizePolicy.setHeightForWidth(
                self.sizePolicy().hasHeightForWidth() )
        self.setSizePolicy( sizePolicy )
        self.activated.connect( self.onActivated )

        self.view().installEventFilter( self )

        self.pathIndex = None
        return
Exemplo n.º 26
0
    def __init__(self, client, arg, value, compatibility=None):

        ArgFilterBase.__init__(self, client, arg, value, compatibility=compatibility)
        QComboBox.__init__(self)

        self.addItem(tr('TCP'), QVariant('tcp'))
        self.addItem(tr('UDP'), QVariant('udp'))
        self.addItem(tr('ICMP'), QVariant('icmp'))
        self.addItem(tr('IGMP'), QVariant('igmp'))

        index = self.findData(QVariant(value))
        if index >= 0:
            self.setCurrentIndex(index)
Exemplo n.º 27
0
 def __init__(self, *args):
     QComboBox.__init__(self, *args)
     self.__skip_next_hide = False
     tree_view = QTreeView(self)
     tree_view.setHeaderHidden(True)
     #tree_view.setFrameShape(QFrame.NoFrame)
     #tree_view.setEditTriggers(tree_view.NoEditTriggers)
     tree_view.setAlternatingRowColors(True)
     tree_view.setSelectionBehavior(tree_view.SelectRows)
     tree_view.setWordWrap(True)
     #tree_view.setAllColumnsShowFocus(True)
     self.setView(tree_view)
     self.view().viewport().installEventFilter(self)
Exemplo n.º 28
0
    def __init__(self, tree, dataset, master, parent=None):
        QComboBox.__init__(self, parent)
        Control.__init__(self, tree, dataset, master)

        self.options = []
        self.selectedIndex = 0

        if getattr(tree, "graph", "0") == "1":
            self.setOptions(tree.subelements("Option"))
        else:
            self.setOptions(tree.subelements_top("Option"))

        self.currentIndexChanged[int].connect(self.onIndexChange)
Exemplo n.º 29
0
 def __init__(self, parent=None, name=None, editable=False):
     QComboBox.__init__(self, parent)
     self.setMaxVisibleItems(20)
     self.setEditable(editable)
     self.maxWidth = 0
     if name is not None:
         self.setObjectName(name)
     # save the model, use our view, create a new selection model
     model = self.model()
     oldview = self.view()
     self.setView(ComboListView(self, self))
     self.view().setModel(model)
     self.view().setSelectionModel(QItemSelectionModel(model,self.view()))
Exemplo n.º 30
0
    def __init__(self, tree, dataset, master, parent=None):
        QComboBox.__init__(self, parent)
        Control.__init__(self, tree, dataset, master)

        self.options = []
        self.selectedIndex = 0

        if getattr(tree, "graph", "0") == "1":
            self.setOptions(tree.subelements("Option"))
        else:
            self.setOptions(tree.subelements_top("Option"))

        self.currentIndexChanged[int].connect(self.onIndexChange)
Exemplo n.º 31
0
 def __init__(self, parent=None, name=None, editable=False):
     QComboBox.__init__(self, parent)
     self.setMaxVisibleItems(20)
     self.setEditable(editable)
     self.maxWidth = 0
     if name is not None:
         self.setObjectName(name)
     # save the model, use our view, create a new selection model
     model = self.model()
     oldview = self.view()
     self.setView(ComboListView(self, self))
     self.view().setModel(model)
     self.view().setSelectionModel(QItemSelectionModel(model, self.view()))
Exemplo n.º 32
0
    def __init__(self, client, arg, value, compatibility=None):

        ArgFilterBase.__init__(self, client, arg, value, compatibility=compatibility)
        QComboBox.__init__(self)

        self.addItem(tr('Dropped'), QVariant('dropped'))
        self.addItem(tr('Accepted'), QVariant('accepted'))

        try:
            index = self.findData(QVariant(value))
            if index >= 0:
                self.setCurrentIndex(index)
        except (TypeError, ValueError):
            return
Exemplo n.º 33
0
    def __init__(self, netcfg, vlan=None, parent=None):
        QComboBox.__init__(self, parent)
        vlanables = list(netcfg.iterVlanables())
        vlanables.sort()
        self.index2raw_device = {}
        self.raw_device2index = {}
        for index, item in enumerate(vlanables):
            self.addItem(item.fullName())
            sys_name = item.system_name
            self.index2raw_device[index] = sys_name
            self.raw_device2index[sys_name] = index

        if vlan is not None:
                self.setSelection(vlan.raw_device)
Exemplo n.º 34
0
    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)
Exemplo n.º 35
0
    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)
Exemplo n.º 36
0
    def __init__(self, client, arg, value, compatibility=None):

        ArgFilterBase.__init__(self, client, arg, value, compatibility=compatibility)
        QComboBox.__init__(self)

        if self.client.call('CORE', 'hasComponent', 'multisite_master'):
            firewalls = self.client.call('multisite_master', 'listFirewalls')
            firewalls.sort()
            for fw, state, error, last_seen, ip in firewalls:
                self.addItem(fw, QVariant(fw))
            index = self.findData(QVariant(value))
            if index >= 0:
                self.setCurrentIndex(index)
            else:
                self.insertItem(0, value, QVariant(value))
                self.setCurrentIndex(0)
        else:
            self.addItem(self.tr('This'), QVariant(''))
Exemplo n.º 37
0
    def __init__(self, finders, iface, parent=None):
        self.iface = iface
        self.mapCanvas = iface.mapCanvas()
        self.rubber = QgsRubberBand(self.mapCanvas)
        self.rubber.setColor(QColor(255, 255, 50, 200))
        self.rubber.setIcon(self.rubber.ICON_CIRCLE)
        self.rubber.setIconSize(15)
        self.rubber.setWidth(4)
        self.rubber.setBrushStyle(Qt.NoBrush)

        QComboBox.__init__(self, parent)
        self.setEditable(True)
        self.setInsertPolicy(QComboBox.InsertAtTop)
        self.setMinimumHeight(27)
        self.setSizePolicy(QSizePolicy.Expanding,
                           QSizePolicy.Fixed)

        self.insertSeparator(0)
        self.lineEdit().returnPressed.connect(self.search)

        self.resultView = QTreeView()
        self.resultView.setHeaderHidden(True)
        self.resultView.setMinimumHeight(300)
        self.resultView.activated.connect(self.itemActivated)
        self.resultView.pressed.connect(self.itemPressed)
        self.setView(self.resultView)

        self.resultModel = ResultModel(self)
        self.setModel(self.resultModel)

        self.finders = finders
        for finder in self.finders.values():
            finder.resultFound.connect(self.resultFound)
            finder.limitReached.connect(self.limitReached)
            finder.finished.connect(self.finished)
            finder.message.connect(self.message)
Exemplo n.º 38
0
 def __init__(self, parent):
     QComboBox.__init__(self, parent)
     self.addItem("True")
     self.addItem("False")
Exemplo n.º 39
0
 def __init__(self,row):         
     QComboBox.__init__(self) 
     self.row=row
 
             
     
Exemplo n.º 40
0
 def __init__(self, *args, **kwargs):
     OrigQComboBox.__init__(self, *args, **kwargs)
     self.currentIndexChanged.connect(self._emit_currentTextChanged)
Exemplo n.º 41
0
 def __init__(self, parent, attrmode=False):
     QComboBox.__init__(self, parent)
     if attrmode:
         self.addItem(QString("matches"))
     for op in OPERATORS:
         self.addItem(QString(op))
Exemplo n.º 42
0
 def __init__(self, parent):
     QComboBox.__init__(self,  parent)
     self.dictNode = {}
     self.dictIndex = {}
Exemplo n.º 43
0
 def __init__(self, parent, attrmode=False):
   QComboBox.__init__(self, parent)
   if attrmode:
     self.addItem(QString("matches"))
   for op in OPERATORS:
     self.addItem(QString(op))
Exemplo n.º 44
0
 def __init__(self, items=None, parent=None):
     QComboBox.__init__(self, parent)
     self.items = items
Exemplo n.º 45
0
 def __init__(self, parent=None):
     QComboBox.__init__(self, parent)
     self.setSizeAdjustPolicy(QComboBox.AdjustToMinimumContentsLength)
     return
Exemplo n.º 46
0
 def __init__( self, parent = None ):
     QComboBox.__init__( self, parent )
     return
Exemplo n.º 47
0
 def __init__(self, *args, **kwargs):
     OrigQComboBox.__init__(self, *args, **kwargs)
     self.currentIndexChanged.connect(self._emit_currentTextChanged)
Exemplo n.º 48
0
 def __init__(self, parent):
     QComboBox.__init__(self, parent)
     self.dictNode = {}
     self.dictIndex = {}
Exemplo n.º 49
0
 def __init__(self, parent):
     QComboBox.__init__(self, parent)
     self.setEditable(True)
     self.setCompleter(QCompleter(self))
Exemplo n.º 50
0
 def __init__(self, parent):
     QComboBox.__init__(self, parent)
Exemplo n.º 51
0
 def __init__(self, parent):
     """
     Construstor
     """
     QComboBox.__init__(self, parent)
Exemplo n.º 52
0
 def __init__(self, parent=None):
     QComboBox.__init__(self, parent)
     self.setContextMenuPolicy(Qt.CustomContextMenu)
     self.customContextMenuRequested.connect(self.contextMenu)
     self.populate()
Exemplo n.º 53
0
 def __init__(self, parent):
     QComboBox.__init__(self, parent)
     self.setEditable(True)
     self.setCompleter(QCompleter(self))
Exemplo n.º 54
0
 def __init__( self, parent = None ):
     QComboBox.__init__( self, parent )
Exemplo n.º 55
0
    def __init__(self, parent=None):
        QComboBox.__init__(self, parent)

        layouts = [
            # {
            #     "icon": "layouts_four_grid.png",
            #     "spec": {
            #         "dims": (2, 2),
            #         "grid": [(0, 0), (0, 1), (1, 0), (1, 1)]
            #     }
            # },
            {
                "icon": "layouts_three_bottom_grid.png",
                "spec": {
                    "dims": (2, 2),
                    "grid": [(0, 0), (0, 1), (1, slice(0, 2))]
                }
            },
            {
                "icon": "layouts_three_top_grid.png",
                "spec": {
                    "dims": (2, 2),
                    "grid": [(0, slice(0, 2)), (1, 0), (1, 1)]
                }
            },
            {
                "icon": "layouts_three_left_grid.png",
                "spec": {
                    "dims": (2, 2),
                    "grid": [(slice(0, 2), 0), (0, 1), (1, 1)]
                }
            },
            {
                "icon": "layouts_three_right_grid.png",
                "spec": {
                    "dims": (2, 2),
                    "grid": [(0, 0), (1, 0), (slice(0, 2), 1)]
                }
            },
            {
                "icon": "layouts_two_horizontal_grid.png",
                "spec": {
                    "dims": (2, 1),
                    "grid": [(0, 0), (1, 0)]
                }
            },
            {
                "icon": "layouts_two_vertical_grid.png",
                "spec": {
                    "dims": (1, 2),
                    "grid": [(0, 0), (0, 1)]
                }
            },
            {
                "icon": "layouts_three_horizontal_grid.png",
                "spec": {
                    "dims": (3, 1),
                    "grid": [(0, 0), (1, 0), (2, 0)]
                }
            },
            {
                "icon": "layouts_three_vertical_grid.png",
                "spec": {
                    "dims": (1, 3),
                    "grid": [(0, 0), (0, 1), (0, 2)]
                }
            },
            {
                "icon": "layouts_single.png",
                "spec": {
                    "dims": (1, 1),
                    "grid": [(0, 0)]
                }
            }
        ]

        for layout in layouts:
            self.add_layout_item(layout)

        height = 30
        self.setMinimumHeight(height)
        self.setMaximumHeight(height)
        self.setMinimumWidth(60)
        self.setMaximumWidth(60)

        self.currentIndexChanged.connect(self._layout_changed)