예제 #1
0
 def __init__(self, widget, parent=None):
     QStandardItemModel.__init__(self, parent)
     self.setHorizontalHeaderLabels(self.labels)
     items = [(name, getattr(widget, name)) for name in dir(widget)
              if not name.startswith('_')]
     for name, value in sorted(items):
         self.appendRow(self.makeRowItems(name, value))
예제 #2
0
 def __init__(self, widget, parent=None):
     QStandardItemModel.__init__(self, parent)
     self.setHorizontalHeaderLabels(self.labels)
     items = [(name, getattr(widget, name)) for name in dir(widget)
              if not name.startswith('_')]
     for name, value in sorted(items):
         self.appendRow(self.makeRowItems(name, value))
예제 #3
0
 def __init__(self):
     QStandardItemModel.__init__(self)
     self.layout_changed_sig.connect(self.layout_changed)
     self.layout_change_to_conn_sig.connect(self.layout_change_to_conn)
     self.layout_change_to_rule_sig.connect(self.layout_change_to_rule)
     self.setHorizontalHeaderLabels(("Family","Type","Local address&port","Remote address&port",
                                           "Status","Pid","Name"))
예제 #4
0
파일: regtree.py 프로젝트: udgover/modules
 def __init__(self, __parent = None):
   QStandardItemModel.__init__(self, __parent)
   self.__parent = __parent
   self.regmap = {}
   self.indexmap = {}
   if self.createRegMap():
     self.createRootItems()
예제 #5
0
파일: vfsitemmodel.py 프로젝트: halbbob/dff
  def __init__(self, __parent = None, event=False, fm = False):
    """
    Model constructor. Create the default QStandardItem's for the default nodes.
    """
    QStandardItemModel.__init__(self, __parent)
    EventHandler.__init__(self)
    self.__parent = __parent
    self.VFS = VFS.Get()
    self.ch = False

    # init translation
    self.translation()

    # creating qstandarditem for the default nodes (the four displayed nodes when dff is launched)
    self.root_item = self.invisibleRootItem()
    tmp = self.VFS.GetNode("/").children()
    item_list = []
    for i in tmp:
      node_item = QStandardItem(i.name())
      node_item.setData(QVariant(long(i.this)), Qt.UserRole + 1)
      node_item.setData(QVariant(False), Qt.UserRole + 2)
      item_list.append(node_item)
    if len(item_list):
      self.root_item.appendRows(item_list)

    if event:
      self.VFS.connection(self)
예제 #6
0
    def __init__(self, parent=None, items=None):
        QStandardItemModel.__init__(self, parent)

        if items is not None:
            self.insertColumn(0, items)

        self.__timer = QTimer(self)
예제 #7
0
    def __init__(self, parent=None, items=None):
        QStandardItemModel.__init__(self, parent)

        if items is not None:
            self.insertColumn(0, items)

        self.__timer = QTimer(self)
예제 #8
0
 def __init__(self, velat, sections, parent=None, change_balance=True):
     QStandardItemModel.__init__(self, parent)
     self._velat = velat
     self._sections = sections
     self._new_item_name = "this new item"
     self._new_item_title = "New item"
     self._change_balance = change_balance
예제 #9
0
 def __init__(self):
     QStandardItemModel.__init__(self)
     self.layout_changed_sig.connect(self.layout_changed)
     self.layout_change_to_conn_sig.connect(self.layout_change_to_conn)
     self.layout_change_to_rule_sig.connect(self.layout_change_to_rule)
     self.setHorizontalHeaderLabels((u"协议簇",u"类型",u"本地地址", u"本地端口",u"远程地址", u"远程端口",
                                           u"状态",u"进程ID",u"进程名"))
예제 #10
0
파일: regtree.py 프로젝트: kzwkt/dff
 def __init__(self, __parent=None):
     QStandardItemModel.__init__(self, __parent)
     self.__parent = __parent
     self.regmap = {}
     self.indexmap = {}
     if self.createRegMap():
         self.createRootItems()
예제 #11
0
 def __init__(self):
     QStandardItemModel.__init__(self)
     self.layout_changed_sig.connect(self.layout_changed)
     self.layout_change_to_conn_sig.connect(self.layout_change_to_conn)
     self.layout_change_to_rule_sig.connect(self.layout_change_to_rule)
     self.setHorizontalHeaderLabels(
         ("Family", "Type", "Local address&port", "Remote address&port",
          "Status", "Pid", "Name"))
예제 #12
0
 def __init__(self, name, layer_type, neurons_count, inputs, minWeight, maxWeight, *__args):
     QStandardItemModel.__init__(self, *__args)
     self.setHorizontalHeaderLabels(LayerModel.DEFAULT_HEADER)
     self.name = name
     self.type = layer_type
     self.minWeight = minWeight
     self.maxWeight = maxWeight
     self.set_neurons(neurons_count)
     self.set_input_neurons(inputs)
예제 #13
0
	def __init__(self):
		QStandardItemModel.__init__(self)
		role_names = {
			self.foo: "",
			self.nama: "nama",
			self.userPicture: "userpicture",
			self.address: "address",
			self.realname: "realname",
			self.locked: "locked"
		}
		self.setRoleNames(role_names)
예제 #14
0
 def __init__(self):
     """ Constructor. """
     
     QStandardItemModel.__init__(self)
     
     self._rowItemMap = dict()
     self._itemRowMap = dict()
     self.setColumnCount(4) # principal, content, properties, administration
     self._headers = [self.tr(constants.PRINCIPAL_COLUMN_NAME),
                      self.tr(constants.CONTENT_PRIVILEGE_COLUMN_NAME),
                      self.tr(constants.PROPERTY_PRIVILEGE_COLUMN_NAME),
                      self.tr(constants.ADMINISTRATION_PRIVILEGE_COLUMN_NAME)]
예제 #15
0
 def __init__(self):
     QStandardItemModel.__init__(self)
     self.rootItem = self.invisibleRootItem()
     self.setHorizontalHeaderLabels(['Element'])
     self.files = {}
     import Icons
     self.icons = {
         'file' : QIcon(QPixmap(Icons.ncFile)),
         'variable' : QIcon(QPixmap(Icons.ncVar)),
         'dimension' : QIcon(QPixmap(Icons.ncDim)),
         'attribute' : QIcon(QPixmap(Icons.ncAtt))
     }
예제 #16
0
 def __init__(self, model):
     """ Constructor. 
     
     @param model: The repository model.
     @type model: L{<RepositoryModel>datafinder.gui.user.models.repository.repository.RepositoryModel} 
     """
     
     QStandardItemModel.__init__(self)
     
     self._model = model
     self._currentResult = SPECIAL_PRINCIPALS
     self.enableCurrentResult()
예제 #17
0
    def __init__(self, displayItems=None, parent=None):
        """ Construtor.

        @param displayItems mapping of display (key, currency) keys to items
        @param parent ancestor object
        """
        QStandardItemModel.__init__(self, parent)
        self.displayItems = displayItems if displayItems is not None else {}
        self.valueCache = {}
        self.setHorizontalHeaderLabels(['Item', 'Currency', 'Value'])
        if parent:
            self.connect(parent.window(), Signals.session.created,
                         self.setSession)
예제 #18
0
 def __init__(self):
     QStandardItemModel.__init__(self)
     self.rootItem = self.invisibleRootItem()
     self.setHorizontalHeaderLabels(['Element'])
     self.databases = {}
     import Icons
     self.icons = {
         'database'    : QIcon(QPixmap(Icons.database)),
         'project'     : QIcon(QPixmap(Icons.project)),
         'sensorgroup' : QIcon(QPixmap(Icons.sensorgroup)),
         'sensor'      : QIcon(QPixmap(Icons.sensor)),
         'graph'       : QIcon(QPixmap(Icons.graph))
     }
예제 #19
0
    def __init__(self):
        QStandardItemModel.__init__(self)
        self.rootItem = self.invisibleRootItem()
        self.setHorizontalHeaderLabels(["Element"])
        self.databases = {}
        import Icons

        self.icons = {
            "database": QIcon(QPixmap(Icons.database)),
            "project": QIcon(QPixmap(Icons.project)),
            "sensorgroup": QIcon(QPixmap(Icons.sensorgroup)),
            "sensor": QIcon(QPixmap(Icons.sensor)),
            "graph": QIcon(QPixmap(Icons.graph)),
        }
예제 #20
0
    def __init__(self, parent=None):
        """ Constructor.

        @param parent ancestor object
        """
        QStandardItemModel.__init__(self)
        root = self.invisibleRootItem()
        session = {'foo': [1, 2, 3], 'bar': [2, 4, 6]}
        for key, values in session.items():
            item = NetworkTreeItem(key)
            root.appendRow(item)
            for value in values:
                subitem = NetworkTreeItem(str(value))
                item.appendRow(subitem)
예제 #21
0
    def __init__(self, parent=None):
        """ Constructor.

        @param parent ancestor object
        """
        QStandardItemModel.__init__(self)
        root = self.invisibleRootItem()
        session = {'foo':[1, 2, 3], 'bar':[2, 4, 6]}
        for key, values in session.items():
            item = NetworkTreeItem(key)
            root.appendRow(item)
            for value in values:
                subitem = NetworkTreeItem(str(value))
                item.appendRow(subitem)
예제 #22
0
    def __init__(self, session, parent=None):
        """ Initializer.

        @param session Session instance
        @param parent ancestor object
        """
        QStandardItemModel.__init__(self, parent)
        self.setHorizontalHeaderLabels(self.columnTitles)
        self.items = {}
        self.session = session
        fillSlot = self.on_session_UpdateAccountValue
        for mrec in session.iterMessageTypes('UpdateAccountValue'):
            fillSlot(mrec[1])
        session.registerMeta(self)
    def __init__(self):
        """
        StandarItemModel for fluid structure interaction tableView
        """
        QStandardItemModel.__init__(self)

        # Define header
        self.headers = [self.tr("Structure number"),
                        self.tr("Label"),
                        self.tr("Location")]
        self.setColumnCount(len(self.headers))

        # Set attributes
        self.__data    = []
예제 #24
0
파일: tree.py 프로젝트: kzwkt/dff
 def __init__(self, __parent = None, selection=None):
   QStandardItemModel.__init__(self, __parent)
   EventHandler.__init__(self)
   self.__parent = __parent
   self.VFS = VFS.Get()
   # init translation
   self.translation()
   self.indexmap = {}
   self.createRootItems()
   self.currentIndex = self.root_item
   self.ch = True
   self.selection = selection
   self.VFS.connection(self)
   # keep track of index - node pointers
   self.connect(self, SIGNAL("refreshModel"), self.refreshModel)
예제 #25
0
 def __init__(self, parent = None):
     QStandardItemModel.__init__(self, parent)
     self._settings = QSettings()
     for pluginobject in PluginLoader("ALL").plugins:
         # Changed the plugin viewable name to the UserString value
         # as it looks better for the user.
         #item = QStandardItem(pluginobject.pluginName)
         item = QStandardItem(pluginobject.pluginUserString)
         check = Qt.Unchecked
         valueString = "plugins/" + pluginobject.pluginName + "/load"
         if self._settings.value(valueString).toString() == "True":
             check = Qt.Checked
         item.setCheckState(check)
         item.setCheckable(True)
         item.setEditable(False)
         item.plugin = pluginobject
         self.appendRow(item)
예제 #26
0
 def __init__(self, parent=None):
     QStandardItemModel.__init__(self, parent)
     self._settings = QSettings()
     for pluginobject in PluginLoader("ALL").plugins:
         # Changed the plugin viewable name to the UserString value
         # as it looks better for the user.
         #item = QStandardItem(pluginobject.pluginName)
         item = QStandardItem(pluginobject.pluginUserString)
         check = Qt.Unchecked
         valueString = "plugins/" + pluginobject.pluginName + "/load"
         if self._settings.value(valueString).toString() == "True":
             check = Qt.Checked
         item.setCheckState(check)
         item.setCheckable(True)
         item.setEditable(False)
         item.plugin = pluginobject
         self.appendRow(item)
예제 #27
0
    def __init__(self, parent=None):
        QStandardItemModel.__init__(self, parent)
        self._settings = QSettings()
        self._settings.beginGroup("plugins")
        self.pluginloader = PluginLoader()
        self.pluginloader.pluginsToLoad = self.__checkToLoad()

        for plugin in self.pluginloader.plugins:
            if plugin.load == True:
                item = QStandardItem(plugin.pluginUserString)
                if plugin.icon:
                    item.setIcon(plugin.icon)
                font = item.font()
                font.setPointSize(font.pointSize() + 4)
                item.setFont(font)
                item.setEditable(False)
                item.plugin = plugin
                self.appendRow(item)
예제 #28
0
    def __init__(self, parent = None):
        QStandardItemModel.__init__(self, parent)
        self._settings = QSettings()
        self._settings.beginGroup("plugins")
        self.pluginloader = PluginLoader()
        self.pluginloader.pluginsToLoad = self.__checkToLoad()

        for plugin in self.pluginloader.plugins:
            if plugin.load == True:
                item = QStandardItem(plugin.pluginUserString)
                if plugin.icon:
                    item.setIcon(plugin.icon)
                font = item.font()
                font.setPointSize(font.pointSize() + 4)
                item.setFont(font)
                item.setEditable(False)
                item.plugin = plugin
                self.appendRow(item)
예제 #29
0
    def __init__(self, session, parent=None):
        """ Constructor.

        @param session Session instance
        @param parent ancestor object
        """
        QStandardItemModel.__init__(self)
        self.session = session
        root = self.invisibleRootItem()
        clsmap = dict.fromkeys([k for k in displayClasses], {})
        items = sorted(clsmap.items())
        importRole = DataRoles.displayImportName
        for key, values in items:
            item = SessionTreeItem(key)
            item.setData(QVariant(displayClasses[key]), importRole)
            root.appendRow(item)
        connect = self.connect
        connect(session, Signals.createdTicker, self.on_session_createdTicker)
        connect(session.strategy,  Signals.createdTicker, self.on_strategy_createdTicker)
예제 #30
0
파일: test.py 프로젝트: zeyre14/profitpy
    def __init__(self, session, parent=None):
        """ Constructor.

        @param session Session instance
        @param parent ancestor object
        """
        QStandardItemModel.__init__(self)
        self.session = session
        root = self.invisibleRootItem()
        for key, values in session.items():
            item = SessionTreeItem(key)
            root.appendRow(item)
            for value in values:
                if key == 'tickers':
                    subitem = SessionTreeTickerItem(value)
                    subitem.setTickerId(values[value])
                else:
                    subitem = SessionTreeItem(value)
                item.appendRow(subitem)
예제 #31
0
    def __init__(self, session, parent=None):
        """ Constructor.

        @param session Session instance
        @param parent ancestor object
        """
        QStandardItemModel.__init__(self)
        self.session = session
        root = self.invisibleRootItem()
        clsmap = dict.fromkeys([k for k in displayClasses], {})
        items = sorted(clsmap.items())
        importRole = DataRoles.displayImportName
        for key, values in items:
            item = SessionTreeItem(key)
            item.setData(QVariant(displayClasses[key]), importRole)
            root.appendRow(item)
        connect = self.connect
        connect(session, Signals.createdTicker, self.on_session_createdTicker)
        connect(session.strategy, Signals.createdTicker,
                self.on_strategy_createdTicker)
예제 #32
0
파일: tree.py 프로젝트: vertrex/DFF
 def __init__(self, __parent=None, selection=None, root=None):
     QStandardItemModel.__init__(self, __parent)
     EventHandler.__init__(self)
     self.__parent = __parent
     self.VFS = VFS.Get()
     # init translation
     self.root_node = root
     self.__root_uids = []
     self.translation()
     self.itemmap = {}
     self.createRootItems()
     self.currentIndex = self.root_item
     self.ch = True
     self.displayCount = True
     self.selection = selection
     if self.selection != None:
         self.connect(self.selection, SIGNAL("selectionChanged"),
                      self.updateSelected)
     self.VFS.connection(self)
     # keep track of index - node pointers
     self.connect(self, SIGNAL("refreshModel"), self.refreshModel)
예제 #33
0
    def __init__(self, availableItems):
        """ Initializes the model with the given items. """

        QStandardItemModel.__init__(self)

        self.activeIndex = QModelIndex()

        # Determine all nested items
        self._parentChildMap = dict()
        self._allItems = dict()
        root = None
        for item in availableItems:
            self._parentChildMap[item.path] = list()
            currentItem = item
            while not currentItem is None:
                self._parentChildMap[item.path].append(currentItem)
                if currentItem.parent is None:
                    root = currentItem
                    self._parentChildMap[item.path].reverse()
                currentItem = currentItem.parent
        self._parentChildMap[root.path] = [root]

        # Initializing the model
        sRoot = self.invisibleRootItem()
        sRoot.item = root
        root.sItem = sRoot
        self._allItems[root.path] = root
        for items in self._parentChildMap.values():
            parent = sRoot
            for item in items:
                if root != item:
                    sItem = QStandardItem(item.name)
                    sItem.item = item
                    item.sItem = sItem
                    self._allItems[item.path] = item
                    parent.appendRow(sItem)
                    parent = sItem
예제 #34
0
파일: mocks.py 프로젝트: DLR-SC/DataFinder
 def __init__(self, availableItems):
     """ Initializes the model with the given items. """
     
     QStandardItemModel.__init__(self)
     
     self.activeIndex = QModelIndex()
     
     # Determine all nested items
     self._parentChildMap = dict()
     self._allItems = dict()
     root = None
     for item in availableItems:
         self._parentChildMap[item.path] = list()
         currentItem = item
         while not currentItem is None:
             self._parentChildMap[item.path].append(currentItem)
             if currentItem.parent is None:
                 root = currentItem
                 self._parentChildMap[item.path].reverse()
             currentItem = currentItem.parent
     self._parentChildMap[root.path] = [root]
     
     # Initializing the model
     sRoot = self.invisibleRootItem()
     sRoot.item = root
     root.sItem = sRoot
     self._allItems[root.path] = root
     for items in self._parentChildMap.values():
         parent = sRoot
         for item in items:
             if root != item:
                 sItem = QStandardItem(item.name)
                 sItem.item = item
                 item.sItem = sItem
                 self._allItems[item.path] = item
                 parent.appendRow(sItem)
                 parent = sItem
    def __init__(self=None, data0=None, hLabelArray=None):
        QStandardItemModel.__init__(self)
        self.dataSource = None
        self.hLabelList = []

        if hLabelArray != None:
            for name in hLabelArray:
                self.hLabelList.append(name)
            self.hLabelList.append("rowID")
            self.setHorizontalHeaderLabels(self.hLabelList)
        self.dataType = None
        if data0 != None:
            if isinstance(data0[0], dict):
                for name in data0[0]:
                    self.hLabelList.append(name)
                self.hLabelList.append("rowID")
                self.setHorizontalHeaderLabels(self.hLabelList)
                self.dataType = "dict"
            elif isinstance(data0[0], list):
                self.dataType = "list"
            self.DataSource = data0
            self.dataSource = data0

        self.readOnly = True
예제 #36
0
 def __init__(self, parent=None):
     QStandardItemModel.__init__(self, parent)
     for row in [SysPathItem(p, p) for p in sys.path if isSourceDir(p)]:
         self.appendRow(row)
예제 #37
0
 def __init__(self, parent=None, dict={}):
     QStandardItemModel.__init__(self, parent)
     self.setHorizontalHeaderLabels(["Key", "Value"])
     self.set_dict(dict)
예제 #38
0
 def __init__(self, parent=None, connections=None):
     QStandardItemModel.__init__(self, parent)
     self.setColumnCount(2)
     self.setHorizontalHeaderLabels(["Connections", "Dimension"])
     self.setConnections(connections)
 def __init__(self, base_maps_list, parent=None):
     QStandardItemModel.__init__(self, parent)
     self._base_map_list = None
     self.set_maps_list(base_maps_list)
예제 #40
0
 def __init__(self, parent=None):
     QStandardItemModel.__init__(self, parent)
     for row in [SysPathItem(p, p) for p in sys.path if isSourceDir(p)]:
         self.appendRow(row)
예제 #41
0
 def __init__(self, parent=None):
     QStandardItemModel.__init__(self, parent)
     self.setHorizontalHeaderLabels(['Display', 'Item', 'Currency'])
예제 #42
0
 def __init__(self):
     QStandardItemModel.__init__(self)
     self.layout_changed_sig.connect(self.layout_changed)
     self.setHorizontalHeaderLabels(
         ("Name", "Process ID", "Permission", "Full path", "Allowed in",
          "Allowed out", "Denied in", "Denied out"))
예제 #43
0
파일: data_model.py 프로젝트: wsyscu/QGIS
 def __init__(self, header, editable=False, parent=None):
     self.header = header
     self.editable = editable
     QStandardItemModel.__init__(self, 0, len(self.header), parent)
 def __init__(self=None):
     QStandardItemModel.__init__(self)
     self.selectedIndex = None
예제 #45
0
 def __init__(self, parent=None, dict={}):
     QStandardItemModel.__init__(self, parent)
     self.setHorizontalHeaderLabels(["Key", "Value"])
     self.set_dict(dict)
예제 #46
0
 def __init__(self, parent=None):
     QStandardItemModel.__init__(self, parent=parent)
예제 #47
0
파일: gui.py 프로젝트: jianlins/lpfw
 def __init__(self):
     QStandardItemModel.__init__(self)
     self.layout_changed_sig.connect(self.layout_changed)
     self.setHorizontalHeaderLabels(("Name","Process ID","Permission",
                                           "Full path","Allowed in","Allowed out",
                                           "Denied in","Denied out"))
예제 #48
0
파일: data_model.py 프로젝트: Ariki/QGIS
 def __init__(self, header, editable=False, parent=None):
         self.header = header
         self.editable = editable
         QStandardItemModel.__init__(self, 0, len(self.header), parent)