Esempio n. 1
0
    def __init__(self, view):
        QAbstractItemModel.__init__(self)

        self.root = Entry("root", None)
        self.view = view
        self.view.setModel(self)
        self.esdcToEntry = {}
Esempio n. 2
0
 def __init__(self, ert):
     """
     @type ert: ert.enkf.EnKFMain
     """
     QAbstractItemModel.__init__(self)
     self.__ert = ert
     self.__icon = util.resourceIcon("ide/small/bullet_star")
Esempio n. 3
0
    def __init__(self, parent=None):
        QAbstractItemModel.__init__(self, parent)

        self.rootItem = FileItemRoot(["File name", "Full path"])
        self.count = 0
        self.__populateModel()
        return
Esempio n. 4
0
    def __init__(self, parent ):
        """Constructor of SearchResultsModel class
        """
        QAbstractItemModel.__init__(self, parent )
        self._replaceMode = False

        self.fileResults = []  # list of FileResults
Esempio n. 5
0
    def __init__( self, parent = None ):
        QAbstractItemModel.__init__( self, parent )

        self.rootItem = FileItemRoot( [ "File name", "Full path" ] )
        self.count = 0
        self.__populateModel()
        return
Esempio n. 6
0
  def __init__(self, __parent = None):
    """
    Constructor.
    """
    QAbstractItemModel.__init__(self, __parent)

    # init root + some values
    self.rootItem = None
    self.__parent = __parent
    self.connect(self.__parent, SIGNAL("NewSearch"), self.clean)
    self.VFS = VFS.Get()
    self.map = {}
    self.imagesthumbnails = None
    self.connect(self, SIGNAL("dataImage"), self.setDataImage)
    self.translation()

    self.fetchedItems = 0
    self.thumbQueued = {}
    self.checkedNodes = set()

    # those list contains nodes' children of the currently selcted node.
    self.node_list = []

    # list of headers the user choosed to display.
    self.header_list = []
    self.type_list = []
    self.disp_module = 0
    self.del_sort = 0

    self.cacheAttr = (None, None)
Esempio n. 7
0
	def __init__(self,
				parent=None,
				rootNode=None,
				horizontalHeaders=None,
				verticalHeaders=None,
				defaultNode=None):
		"""
		Initializes the class.

		:param parent: Object parent.
		:type parent: QObject
		:param rootNode: Root node.
		:type rootNode: AbstractCompositeNode or GraphModelNode
		:param horizontalHeaders: Headers.
		:type horizontalHeaders: OrderedDict
		:param verticalHeaders: Headers.
		:type verticalHeaders: OrderedDict
		:param defaultNode: Default node.
		:type defaultNode: AbstractCompositeNode or GraphModelNode
		"""

		LOGGER.debug("> Initializing '{0}()' class.".format(self.__class__.__name__))

		QAbstractItemModel.__init__(self, parent)

		# --- Setting class attributes. ---
		self.__rootNode = None
		self.rootNode = rootNode or umbra.ui.nodes.DefaultNode(name="InvisibleRootNode")
		self.__horizontalHeaders = None
		self.horizontalHeaders = horizontalHeaders or OrderedDict([("Graph Model", "graphModel")])
		self.__verticalHeaders = None
		self.verticalHeaders = verticalHeaders or OrderedDict()
		self.__defaultNode = None
		self.defaultNode = defaultNode or umbra.ui.nodes.GraphModelNode
Esempio n. 8
0
 def __init__(self, ert):
     """
     @type ert: res.enkf.EnKFMain
     """
     QAbstractItemModel.__init__(self)
     self.__ert = ert
     self.__icon = resourceIcon("ide/small/bullet_star")
Esempio n. 9
0
 def __init__(self, parentObject):
     QAbstractItemModel.__init__(self, parentObject )
     self._sortMode = core.config()["Workspace"]["FileSortMode"]
     self._workspace = parentObject.parent()
     self._workspace.documentOpened.connect(self._onDocumentOpened)
     self._workspace.documentClosed.connect(self._onDocumentClosed)
     self._workspace.modificationChanged.connect(self._onDocumentDataChanged)
Esempio n. 10
0
    def __init__(self, parent):
        """Constructor of SearchResultsModel class
        """
        QAbstractItemModel.__init__(self, parent)
        self._replaceMode = False

        self.fileResults = []  # list of FileResults
Esempio n. 11
0
    def __init__(self, tree_instance):
        """ Inititalizes tree model and super class.
        """
        QAbstractItemModel.__init__(self)
        self._treeRoot = tree_instance

        self._treeRoot.signal_tree_data_changed.connect(self.fire_model_changed)
Esempio n. 12
0
 def __init__(self, controller, distributed_objects, parent = None):
     """ Constructor <br>
         Create a VariableModel derived from an QAbstractItemModel to display the <br>
         GDB variables in a treeview.<br>
         Listens to the following Signals: SignalProxy::inferiorHasStopped(PyQt_PyObject) <br>
                                           SignalProxy::inferiorHasExited(PyQt_PyObject) and <br>
                                           SignalProxy::executableOpened()
     @param controller            controllers.WatchController, Reference to the WatchController
     @param distributedObjects    distributedobjects.DistributedObjects, the DistributedObjects-Instance
     @param parent                parent for the QAbstractItemModel-Constructor, can be None
     """
     
     QAbstractItemModel.__init__(self, parent)
     
     self.distributedObjects = distributed_objects    
     self.controller = controller
     
     ## @var root
     #  RootVarWrapper, root item of tree 
     self.root = RootVarWrapper()
     
     ## images: 
     self.imgStruct = QPixmap(":/icons/images/struct.png")
     self.imgFake = QPixmap(":/icons/images/fake_entry.png")
     self.imgVariable = QPixmap(":/icons/images/var.png")
     self.imgEdit = QPixmap(":/icons/images/edit.png")
     self.imgOutOfScope = QPixmap(":/icons/images/outofscope.png")
     #connects
     
     QObject.connect(self.distributedObjects.signal_proxy, SIGNAL('inferiorHasStopped(PyQt_PyObject)'), self.update)
     QObject.connect(self.distributedObjects.signal_proxy, SIGNAL('inferiorHasExited(PyQt_PyObject)'), self.clear)
     QObject.connect(self.distributedObjects.signal_proxy, SIGNAL('executableOpened()'), self.clear)  
Esempio n. 13
0
 def __init__(self, library):
     QAbstractItemModel.__init__(self)
     self.file_icon = QIcon(auxilia.PIcon('audio-x-generic'))
     self.dir_icon = QIcon(auxilia.PIcon('folder-sound'))
     self.cache = {}
     self.library = library
     self.root = mpdlibrary.Dir('', self.library)
Esempio n. 14
0
 def __init__(self, parentObject):
     QAbstractItemModel.__init__(self, parentObject)
     self._sortMode = core.config()["Workspace"]["FileSortMode"]
     self._workspace = parentObject.parent()
     self._workspace.documentOpened.connect(self._onDocumentOpened)
     self._workspace.documentClosed.connect(self._onDocumentClosed)
     self._workspace.modificationChanged.connect(
         self._onDocumentDataChanged)
Esempio n. 15
0
 def __init__(self, parentObject):
     QAbstractItemModel.__init__(self, parentObject)
     self._manuallySorted = False
     self._workspace = parentObject.parent()
     self._workspace.documentOpened.connect(self._onDocumentOpened)
     self._workspace.documentClosed.connect(self._onDocumentClosed)
     self._workspace.modificationChanged.connect(
         self._onDocumentDataChanged)
Esempio n. 16
0
    def __init__( self, headerData, parent = None ):
        QAbstractItemModel.__init__( self, parent )

        self.rootItem = TreeViewItem( None, headerData )
        self.globalData = GlobalData()
        self.projectTopLevelDirs = []
        self.showTooltips = True
        return
Esempio n. 17
0
    def __init__(self, headerData, parent=None):
        QAbstractItemModel.__init__(self, parent)

        self.rootItem = TreeViewItem(None, headerData)
        self.globalData = GlobalData()
        self.projectTopLevelDirs = []
        self.showTooltips = True
        return
Esempio n. 18
0
	def __init__(self, data, parent = None):
		QAbstractItemModel.__init__(self, parent)
		self._data = data
		self._table = []
		self._tableR = {}
		self._headers = ['file','confidence']
		self._headersR = { v:i for i,v in enumerate(self._headers) }
		self._update(self._data)
Esempio n. 19
0
    def __init__( self, parent = None ):
        QAbstractItemModel.__init__( self, parent )

        self.rootItem = NameItem( None, None, "Name", "", "", "" )
        self.count = 0
        self.showTooltips = Settings().findNameTooltips
        self.__populateModel()
        return
Esempio n. 20
0
 def __init__(self, mpdclient, library):
     QAbstractItemModel.__init__(self)
     self.mpdclient = mpdclient
     self.library = library
     self._playlists = {}
     self._names = []
     self._dates = {}
     self.connect(self, SIGNAL("loadPlaylist"), self._loadPlaylist)
     self.connect(self, SIGNAL("updatePlaylist"), self._updatePlaylist)
Esempio n. 21
0
    def __init__(self, parent = None, *args):
        QAbstractItemModel.__init__(self, parent, *args)

        self._query  = "SELECT changesets.date, changesets.time, changesets.name, releases.module, releases.file, releases.comment FROM ((activities JOIN activity_changesets ON activities.id=activity_changesets.activity_id) JOIN changesets ON activity_changesets.changeset_id=changesets.id) JOIN releases ON releases.changeset_id=changesets.id  WHERE activities.id IS '{}'"
        self._act_id = None
        self._model  = QSqlQueryModel()
        self._data   = self.csItem()

        self.header = ("Date", "Time", "Name", "Module", "File", "Comment")
Esempio n. 22
0
 def __init__(self, data, header, parent):
     QAbstractItemModel.__init__(self, parent)
     self._data = data
     self._dataDict = {}
     self._header = header
     self._roleData = {Qt.DisplayRole: self._data}
     self._roleData = partial(
         defaultdict,
         partial(defaultdict,
                 partial(defaultdict, lambda: None)))(self._roleData)
Esempio n. 23
0
	def __init__(self, data, filename=None, parent = None ):
		QAbstractItemModel.__init__(self, parent)
		self._data = data
		self._file = filename
		self._hheaders = ['original', 'converted', 'encoder', 'decoder', 'chardet']
		self._hheadersR = { v:i for i,v in enumerate(self._hheaders) }
		self._table = []
		self._tableR = {}
		if filename:
			self._update()
Esempio n. 24
0
 def __init__(self, data, header, parent):
     QAbstractItemModel.__init__(self, parent)
     self._data = data
     self._dataDict = {}
     self._header = header
     self._roleData = {Qt.DisplayRole: self._data}
     self._roleData = partial(
         defaultdict,
         partial(defaultdict,
                 partial(defaultdict, lambda: None)))(self._roleData)
Esempio n. 25
0
 def __init__(self, annotations, parent=None):
     QAbstractItemModel.__init__(self, parent)
     start = time.time()
     self._annotations = annotations
     self._dirty = False
     self._root = RootModelItem(self, annotations)
     diff = time.time() - start
     LOG.info("Created AnnotationModel in %.2fs" % (diff, ))
     self.dataChanged.connect(self.onDataChanged)
     self.rowsInserted.connect(self.onDataChanged)
     self.rowsRemoved.connect(self.onDataChanged)
Esempio n. 26
0
 def __init__(self, annotations, parent=None):
     QAbstractItemModel.__init__(self, parent)
     start = time.time()
     self._annotations = annotations
     self._dirty = False
     self._root = RootModelItem(self, annotations)
     diff = time.time() - start
     LOG.info("Created AnnotationModel in %.2fs" % (diff,))
     self.dataChanged.connect(self.onDataChanged)
     self.rowsInserted.connect(self.onDataChanged)
     self.rowsRemoved.connect(self.onDataChanged)
Esempio n. 27
0
    def __init__(self, parent):
        QAbstractItemModel.__init__(self, parent)

        self.__ngw_connection_settings = None
        self._ngw_connection = None

        self.jobs = []
        self.root_item = QNGWConnectionItem()

        self.__indexes_blocked_by_jobs = {}
        self.__indexes_blocked_by_job_errors = {}
Esempio n. 28
0
    def __init__(self, parent, topLevelOperator, roleIndex):
        """
        :param topLevelOperator: An instance of OpMultiLaneDataSelectionGroup
        """
        # super does not work here in Python 2.x, decorated class confuses it
        QAbstractItemModel.__init__(self, parent)
        self._op = topLevelOperator
        self._roleIndex = roleIndex

        def handleNewLane(multislot, laneIndex):
            assert multislot is self._op.DatasetGroup
            self.beginInsertRows(QModelIndex(), laneIndex, laneIndex)
            self.endInsertRows()

            def handleDatasetInfoChanged(slot):
                # Get the row of this slot
                laneSlot = slot.operator
                if laneSlot is None or laneSlot.operator is None:  # This can happen during disconnect
                    return
                try:
                    laneIndex = laneSlot.operator.index(laneSlot)
                except ValueError:
                    # If the slot doesn't exist in the lane,
                    #  then this dataset is in the process of being removed.
                    return
                firstIndex = self.createIndex(laneIndex, 0)
                lastIndex = self.createIndex(laneIndex, self.columnCount() - 1)
                self.dataChanged.emit(firstIndex, lastIndex)

            def handleNewDatasetInserted(slot, index):
                if index == self._roleIndex:
                    datasetMultiSlot[self._roleIndex].notifyDirty(
                        bind(handleDatasetInfoChanged))
                    datasetMultiSlot[self._roleIndex].notifyDisconnect(
                        bind(handleDatasetInfoChanged))

            for laneIndex, datasetMultiSlot in enumerate(
                    self._op.DatasetGroup):
                datasetMultiSlot.notifyInserted(bind(handleNewDatasetInserted))
                if self._roleIndex < len(datasetMultiSlot):
                    handleNewDatasetInserted(datasetMultiSlot, self._roleIndex)

        self._op.DatasetGroup.notifyInserted(bind(handleNewLane))

        def handleLaneRemoved(multislot, laneIndex):
            assert multislot is self._op.DatasetGroup
            self.beginRemoveRows(QModelIndex(), laneIndex, laneIndex)
            self.endRemoveRows()

        self._op.DatasetGroup.notifyRemoved(bind(handleLaneRemoved))

        # Any lanes that already exist must be added now.
        for laneIndex, slot in enumerate(self._op.DatasetGroup):
            handleNewLane(self._op.DatasetGroup, laneIndex)
Esempio n. 29
0
    def __init__(self, parent=None):
        QAbstractItemModel.__init__(self, parent)
        self.treeView = parent
        self.header = [self.tr('Databases')]

        self.isImportVectorAvail = hasattr(qgis.core, 'QgsVectorLayerImport')
        if self.isImportVectorAvail:
            self.connect(self, SIGNAL("importVector"), self.importVector)

        self.rootItem = TreeItem(None, None)
        for dbtype in supportedDbTypes():
            dbpluginclass = createDbPlugin(dbtype)
            PluginItem(dbpluginclass, self.rootItem)
Esempio n. 30
0
    def __init__(self, parent=None):
        QAbstractItemModel.__init__(self, parent)
        self.treeView = parent
        self.header = [self.tr('Databases')]

        self.isImportVectorAvail = hasattr(qgis.core, 'QgsVectorLayerImport')
        if self.isImportVectorAvail:
            self.connect(self, SIGNAL("importVector"), self.importVector)

        self.rootItem = TreeItem(None, None)
        for dbtype in supportedDbTypes():
            dbpluginclass = createDbPlugin(dbtype)
            PluginItem(dbpluginclass, self.rootItem)
    def __init__(self, parent, topLevelOperator, roleIndex):
        """
        :param topLevelOperator: An instance of OpMultiLaneDataSelectionGroup
        """
        # super does not work here in Python 2.x, decorated class confuses it
        QAbstractItemModel.__init__(self, parent)
        self._op = topLevelOperator
        self._roleIndex = roleIndex

        def handleNewLane( multislot, laneIndex):
            assert multislot is self._op.DatasetGroup
            self.beginInsertRows( QModelIndex(), laneIndex, laneIndex )
            self.endInsertRows()

            def handleDatasetInfoChanged(slot):
                # Get the row of this slot
                laneSlot = slot.operator
                if laneSlot is None or laneSlot.operator is None: # This can happen during disconnect
                    return
                try:
                    laneIndex = laneSlot.operator.index( laneSlot )
                except ValueError:
                    # If the slot doesn't exist in the lane, 
                    #  then this dataset is in the process of being removed.
                    return
                firstIndex = self.createIndex(laneIndex, 0)
                lastIndex = self.createIndex(laneIndex, self.columnCount()-1)
                self.dataChanged.emit(firstIndex, lastIndex)
            
            def handleNewDatasetInserted(slot, index):
                if index == self._roleIndex:
                    datasetMultiSlot[self._roleIndex].notifyDirty( bind(handleDatasetInfoChanged) )
                    datasetMultiSlot[self._roleIndex].notifyDisconnect( bind(handleDatasetInfoChanged) )

            for laneIndex, datasetMultiSlot in enumerate( self._op.DatasetGroup ):
                datasetMultiSlot.notifyInserted( bind(handleNewDatasetInserted) )
                if self._roleIndex < len(datasetMultiSlot):
                    handleNewDatasetInserted(datasetMultiSlot, self._roleIndex)

        self._op.DatasetGroup.notifyInserted( bind(handleNewLane) )

        def handleLaneRemoved( multislot, laneIndex ):
            assert multislot is self._op.DatasetGroup
            self.beginRemoveRows( QModelIndex(), laneIndex, laneIndex )
            self.endRemoveRows()
        self._op.DatasetGroup.notifyRemoved( bind(handleLaneRemoved) )

        # Any lanes that already exist must be added now.        
        for laneIndex, slot in enumerate(self._op.DatasetGroup):
            handleNewLane( self._op.DatasetGroup, laneIndex )
Esempio n. 32
0
    def __init__(self, header, header_types=None, key_column=None, parent=None):
        QAbstractItemModel.__init__(self, parent)

        self.header = header
        self.header_types = header_types
        self.key_column = key_column

        if not self.key_column:
            self.key_column = self.header[0]

        if not self.header_types:
            self.header_types = {}
            for column in self.header:
                self.header_types[column] = 'string'
Esempio n. 33
0
 def __init__(self, selection):
   QAbstractItemModel.__init__(self)
   self.__list = []
   self.__rows = []
   self.__current_row = 0
   self.__row_selected = 0
   self.__thumb = True
   self.__visible_rows = 0
   self.__visible_cols = 0
   self.selection = selection
   self.setDefaultAttributes()
   self.connectSignals()
   self.thumbnailer = Thumbnailer()
   self.connect(self.thumbnailer, SIGNAL("ThumbnailUpdate"), self.thumbnailUpdate)
   self.headerorder = {0:0}
Esempio n. 34
0
    def __init__(self, debugger, connector, parent=None):
        """ The constructor.
        @param debugger The debug controller.
        @param connector The GDB connector.
        @param parent The parent item.
        """

        QAbstractItemModel.__init__(self, parent)
        self.connector = connector
        self.debugController = debugger
        self.root = FileListItem(["Name", "Path"], None)
        self.sources = FileListItem(["Sources", ""], Icons.folder, self.root)
        self.headers = FileListItem(["Headers", ""], Icons.folder, self.root)
        self.others = FileListItem(["Others", ""], Icons.folder, self.root)

        self.debugController.executableOpened.connect(self.update)
Esempio n. 35
0
 def __init__(self, selection):
     QAbstractItemModel.__init__(self)
     self.__list = []
     self.__rows = []
     self.__current_row = 0
     self.__row_selected = 0
     self.__thumb = True
     self.__visible_rows = 0
     self.__visible_cols = 0
     self.selection = selection
     self.setDefaultAttributes()
     self.connectSignals()
     self.thumbnailer = Thumbnailer()
     self.connect(self.thumbnailer, SIGNAL("ThumbnailUpdate"),
                  self.thumbnailUpdate)
     self.headerorder = {0: 0}
Esempio n. 36
0
    def __init__(self, debugger, connector, parent=None):
        """ The constructor.
        @param debugger The debug controller.
        @param connector The GDB connector.
        @param parent The parent item.
        """

        QAbstractItemModel.__init__(self, parent)
        self.connector = connector
        self.debugController = debugger
        self.root = FileListItem(["Name", "Path"], None)
        self.sources = FileListItem(["Sources", ""], Icons.folder, self.root)
        self.headers = FileListItem(["Headers", ""], Icons.folder, self.root)
        self.others = FileListItem(["Others", ""], Icons.folder, self.root)

        self.debugController.executableOpened.connect(self.update)
Esempio n. 37
0
    def __init__(self, debugger, connector, parent = None):
        """ The constructor.
        @param debugger The debug controller.
        @param connector The GDB connector.
        @param parent The parent item.
        """
 
        QAbstractItemModel.__init__(self, parent)
        self.connector = connector
        self.debug_controller = debugger
        self.imgs = [QPixmap(":/icons/images/folder.png"), QPixmap(":/icons/images/file.png")]
        self.root = FileListItem(["Name", "Path"], 0)
        self.sources = FileListItem(["Sources", ""], 0, self.root)
        self.headers = FileListItem(["Headers", ""], 0, self.root)
        self.others = FileListItem(["Others", ""], 0, self.root)
        
        QObject.connect(self.debug_controller, SIGNAL('executableOpened'), self.update)
Esempio n. 38
0
    def __init__(self, framework, item_definition, parent = None):
        QAbstractItemModel.__init__(self, parent)
        self.framework = framework
        self.item_definition = item_definition

        self.rows = deque()
        self._sort_keys = None
        self._sort_column = 0
        self._sort_order = Qt.AscendingOrder

        self.column_offset = []
        self.db_offset = {}
        self.column_count = 0
        for item in self.item_definition:
            self.column_offset.append(item[1])
            self.db_offset[item[1]] = self.column_count
            self.column_count += 1
Esempio n. 39
0
    def __init__(self, framework, item_definition, parent=None):
        QAbstractItemModel.__init__(self, parent)
        self.framework = framework
        self.item_definition = item_definition

        self.rows = deque()
        self._sort_keys = None
        self._sort_column = 0
        self._sort_order = Qt.AscendingOrder

        self.column_offset = []
        self.db_offset = {}
        self.column_count = 0
        for item in self.item_definition:
            self.column_offset.append(item[1])
            self.db_offset[item[1]] = self.column_count
            self.column_count += 1
Esempio n. 40
0
    def __init__(self, *args):
        QAbstractItemModel.__init__(self, *args)
        self._tags = []

        self._currentTagIndex = QModelIndex()

        defBaseColor = QApplication.instance().palette().base().color()
        # yellow or maroon
        brightBg = QColor('#ffff80') if defBaseColor.lightnessF(
        ) > 0.5 else QColor('#800000')
        self._currentTagBrush = QBrush(brightBg)

        core.workspace().cursorPositionChanged.connect(
            self._onCursorPositionChanged)
        self._updateCurrentTagTimer = QTimer()
        self._updateCurrentTagTimer.setInterval(300)
        self._updateCurrentTagTimer.timeout.connect(
            self._updateCurrentTagAndEmitSignal)
Esempio n. 41
0
    def __init__(self,
                 header,
                 header_types=None,
                 key_column=None,
                 parent=None):
        QAbstractItemModel.__init__(self, parent)

        self.header = header
        self.header_types = header_types
        self.key_column = key_column

        if not self.key_column:
            self.key_column = self.header[0]

        if not self.header_types:
            self.header_types = {}
            for column in self.header:
                self.header_types[column] = 'string'
Esempio n. 42
0
    def __init__(self, parent, topLevelOperator):
        """
        :param topLevelOperator: An instance of OpMultiLaneDataSelectionGroup
        """
        # super does not work here in Python 2.x, decorated class confuses it
        QAbstractItemModel.__init__(self, parent)
        self._op = topLevelOperator

        def handleNewLane(multislot, laneIndex):
            assert multislot is self._op.DatasetGroup
            self.beginInsertRows(QModelIndex(), laneIndex, laneIndex)
            self.endInsertRows()

            def handleDatasetInfoChanged(slot):
                # Get the row of this slot
                laneSlot = slot.operator
                laneIndex = laneSlot.operator.index(laneSlot)
                # FIXME: For now, we update the whole row.
                #        Later, update only the columns that correspond to this dataset.
                firstIndex = self.createIndex(laneIndex, 0)
                lastIndex = self.createIndex(laneIndex, self.columnCount() - 1)
                self.dataChanged.emit(firstIndex, lastIndex)

            def handleNewDatasetInserted(mslot, index):
                mslot[index].notifyDirty(bind(handleDatasetInfoChanged))

            for laneIndex, datasetMultiSlot in enumerate(
                    self._op.DatasetGroup):
                datasetMultiSlot.notifyInserted(bind(handleNewDatasetInserted))
                for roleIndex, datasetSlot in enumerate(datasetMultiSlot):
                    handleNewDatasetInserted(datasetMultiSlot, roleIndex)

        self._op.DatasetGroup.notifyInserted(bind(handleNewLane))

        def handleLaneRemoved(multislot, laneIndex):
            assert multislot is self._op.DatasetGroup
            self.beginRemoveRows(QModelIndex(), laneIndex, laneIndex)
            self.endRemoveRows()

        self._op.DatasetGroup.notifyRemoved(bind(handleLaneRemoved))

        # Any lanes that already exist must be added now.
        for laneIndex, slot in enumerate(self._op.DatasetGroup):
            handleNewLane(self._op.DatasetGroup, laneIndex)
Esempio n. 43
0
 def __init__(self, selection):
   QAbstractItemModel.__init__(self)
   self._list = []
   self._rows = []
   self._current_row = 0
   self._row_selected = 0
   self._thumb = True
   self._visible_rows = 0
   self._visible_cols = 0
   self._recursive = False
   self._root = None
   self.selection = selection
   if self.selection != None:
     self.connect(self.selection, SIGNAL("selectionChanged"), self.updateSelected)
   self.setDefaultAttributes()
   self.connectSignals()
   self.thumbnailer = Thumbnailer()
   self.connect(self.thumbnailer, SIGNAL("ThumbnailUpdate"), self.thumbnailUpdate)
   self.headerorder = {0:0}
Esempio n. 44
0
    def __init__(self, parent=None):
        QAbstractItemModel.__init__(self, parent)

        self.watchpoints = []
        self.header = [
            QVariant('Condition'),
            QVariant('Special'),
            QVariant('Temporary'),
            QVariant('Enabled'),
            QVariant('Ignore Count'),
        ]
        self.alignments = [
            QVariant(Qt.Alignment(Qt.AlignLeft)),
            QVariant(Qt.Alignment(Qt.AlignLeft)),
            QVariant(Qt.Alignment(Qt.AlignHCenter)),
            QVariant(Qt.Alignment(Qt.AlignHCenter)),
            QVariant(Qt.Alignment(Qt.AlignRight)),
        ]
        return
Esempio n. 45
0
    def __init__( self, parent = None ):
        QAbstractItemModel.__init__( self, parent )

        self.watchpoints = []
        self.header = [
            QVariant( 'Condition' ),
            QVariant( 'Special' ),
            QVariant( 'Temporary' ),
            QVariant( 'Enabled' ),
            QVariant( 'Ignore Count' ),
                      ]
        self.alignments = [
            QVariant( Qt.Alignment( Qt.AlignLeft ) ),
            QVariant( Qt.Alignment( Qt.AlignLeft ) ),
            QVariant( Qt.Alignment( Qt.AlignHCenter ) ),
            QVariant( Qt.Alignment( Qt.AlignHCenter ) ),
            QVariant( Qt.Alignment( Qt.AlignRight ) ),
                          ]
        return
    def __init__(self, parent, topLevelOperator):
        """
        :param topLevelOperator: An instance of OpMultiLaneDataSelectionGroup
        """
        # super does not work here in Python 2.x, decorated class confuses it
        QAbstractItemModel.__init__(self, parent)
        self._op = topLevelOperator

        def handleNewLane( multislot, laneIndex):
            assert multislot is self._op.DatasetGroup
            self.beginInsertRows( QModelIndex(), laneIndex, laneIndex )
            self.endInsertRows()

            def handleDatasetInfoChanged(slot):
                # Get the row of this slot
                laneSlot = slot.operator
                laneIndex = laneSlot.operator.index( laneSlot )
                # FIXME: For now, we update the whole row.
                #        Later, update only the columns that correspond to this dataset.
                firstIndex = self.createIndex(laneIndex, 0)
                lastIndex = self.createIndex(laneIndex, self.columnCount()-1)
                self.dataChanged.emit(firstIndex, lastIndex)

            def handleNewDatasetInserted(mslot, index):
                mslot[index].notifyDirty( bind(handleDatasetInfoChanged) )
            
            for laneIndex, datasetMultiSlot in enumerate(self._op.DatasetGroup):
                datasetMultiSlot.notifyInserted( bind(handleNewDatasetInserted) )
                for roleIndex, datasetSlot in enumerate(datasetMultiSlot):
                    handleNewDatasetInserted( datasetMultiSlot, roleIndex )

        self._op.DatasetGroup.notifyInserted( bind(handleNewLane) )

        def handleLaneRemoved( multislot, laneIndex ):
            assert multislot is self._op.DatasetGroup
            self.beginRemoveRows( QModelIndex(), laneIndex, laneIndex )
            self.endRemoveRows()
        self._op.DatasetGroup.notifyRemoved( bind(handleLaneRemoved) )

        # Any lanes that already exist must be added now.        
        for laneIndex, slot in enumerate(self._op.DatasetGroup):
            handleNewLane( self._op.DatasetGroup, laneIndex )
Esempio n. 47
0
    def __init__(self, parent = None):
        QAbstractItemModel.__init__( self, parent )

        self.breakpoints = []
        self.header = [
            QVariant( 'File:line' ),
            QVariant( 'Condition' ),
            QVariant( 'Temporary' ),
            QVariant( 'Enabled' ),
            QVariant( 'Ignore Count' ),
                      ]
        self.alignments = [
            QVariant( Qt.Alignment( Qt.AlignLeft ) ),
            QVariant( Qt.Alignment( Qt.AlignLeft ) ),
            QVariant( Qt.Alignment( Qt.AlignHCenter ) ),
            QVariant( Qt.Alignment( Qt.AlignHCenter ) ),
            QVariant( Qt.Alignment( Qt.AlignRight ) ),
                          ]
        self.__columnCount = len( self.header )
        return
Esempio n. 48
0
    def __init__(self, parent=None):
        QAbstractItemModel.__init__(self, parent)

        self.breakpoints = []
        self.header = [
            QVariant('File:line'),
            QVariant('Condition'),
            QVariant('Temporary'),
            QVariant('Enabled'),
            QVariant('Ignore Count'),
        ]
        self.alignments = [
            QVariant(Qt.Alignment(Qt.AlignLeft)),
            QVariant(Qt.Alignment(Qt.AlignLeft)),
            QVariant(Qt.Alignment(Qt.AlignHCenter)),
            QVariant(Qt.Alignment(Qt.AlignHCenter)),
            QVariant(Qt.Alignment(Qt.AlignRight)),
        ]
        self.__columnCount = len(self.header)
        return
Esempio n. 49
0
    def __init__(self, parent, topLevelOperator, roleIndex):
        """
        :param topLevelOperator: An instance of OpMultiLaneDataSelectionGroup
        """
        # super does not work here in Python 2.x, decorated class confuses it
        QAbstractItemModel.__init__(self, parent)
        self.threadRouter = ThreadRouter(self)

        self._op = topLevelOperator
        self._roleIndex = roleIndex
        self._currently_inserting = False
        self._currently_removing = False

        self._op.DatasetGroup.notifyInsert(self.prepareForNewLane)  # pre
        self._op.DatasetGroup.notifyInserted(self.handleNewLane)  # post

        self._op.DatasetGroup.notifyRemove(self.handleLaneRemove)  # pre
        self._op.DatasetGroup.notifyRemoved(self.handleLaneRemoved)  # post

        # Any lanes that already exist must be added now.
        for laneIndex, slot in enumerate(self._op.DatasetGroup):
            self.handleNewLane(self._op.DatasetGroup, laneIndex)
Esempio n. 50
0
  def __init__(self, __parent = None, event=False, fm = False):
    """
    Constructor.
    """
    QAbstractItemModel.__init__(self, __parent)
    EventHandler.__init__(self)

    self.searching = False

    # init root + some values
    self.rootItem = None
    self.__parent = __parent
    self.VFS = VFS.Get()
    self.map = {}
    self.imagesthumbnails = None
    self.connect(self, SIGNAL("dataImage"), self.setDataImage)
    self.translation()

    self.fetchedItems = 0
    self.thumbQueued = {}
    self.fm = fm
    self.fm = False
    self.checkedNodes = set()

    # those list contains nodes' children of the currently selcted node.
    self.node_list = []

    # list of headers the user choosed to display.
    self.header_list = []
    self.type_list = []
    self.disp_module = 0
    self.del_sort = 0

    self.cacheAttr = (None, None)

    # connect the mode to the VFS to receive its events
    if event:
      self.VFS.connection(self)
    def __init__(self, parent, topLevelOperator, roleIndex):
        """
        :param topLevelOperator: An instance of OpMultiLaneDataSelectionGroup
        """
        # super does not work here in Python 2.x, decorated class confuses it
        QAbstractItemModel.__init__(self, parent)
        self.threadRouter = ThreadRouter(self)
        
        self._op = topLevelOperator
        self._roleIndex = roleIndex
        self._currently_inserting = False
        self._currently_removing = False

        self._op.DatasetGroup.notifyInsert( self.prepareForNewLane )  # pre
        self._op.DatasetGroup.notifyInserted( self.handleNewLane )    # post

        self._op.DatasetGroup.notifyRemove( self.handleLaneRemove )   # pre
        self._op.DatasetGroup.notifyRemoved( self.handleLaneRemoved ) # post

        # Any lanes that already exist must be added now.        
        for laneIndex, slot in enumerate(self._op.DatasetGroup):
            self.prepareForNewLane( self._op.DatasetGroup, laneIndex )
            self.handleNewLane( self._op.DatasetGroup, laneIndex )
Esempio n. 52
0
    def __init__(self, model_root_node, project=None, parent_widget=None):
        '''
        @param model_root_node (ElementTree.Element): Root node for this model
        @param project (OpusProject): Loaded project file
        @param parent_widget (QObject): Parent object for this ItemModel
        '''
        QAbstractItemModel.__init__(self, parent_widget)

        # Root element
        self._root_node = model_root_node

        # Root for the subtree of visible items
        self._root_item = XmlItem(self._root_node, None)

        # Rebuild the (whole) tree of visible items
        self.rebuild_tree()

        # Optional reference to loaded project for inheritance handling.
        self.project = project

        # NOTE: when setting the dirty flag, make sure to use self.dirty rather than
        # self.__dirty.
        self.__dirty = False

        # Column headers
        self._headers = ['Name', 'Value']

        # Index of the last inserted item
        self.last_inserted_index = None

        # use platform specific folder and file icons
        self.folderIcon = QIcon()
        self.fileIcon = QIcon()
        std_icon = qApp.style().standardPixmap
        self.fileIcon.addPixmap(std_icon(QStyle.SP_FileIcon))
        self.folderIcon.addPixmap(std_icon(QStyle.SP_DirClosedIcon),
                                  QIcon.Normal, QIcon.Off)
Esempio n. 53
0
    def __init__(self, model_root_node, project = None, parent_widget = None):
        '''
        @param model_root_node (ElementTree.Element): Root node for this model
        @param project (OpusProject): Loaded project file
        @param parent_widget (QObject): Parent object for this ItemModel
        '''
        QAbstractItemModel.__init__(self, parent_widget)

        # Root element
        self._root_node = model_root_node

        # Root for the subtree of visible items
        self._root_item = XmlItem(self._root_node, None)

        # Rebuild the (whole) tree of visible items
        self.rebuild_tree()

        # Optional reference to loaded project for inheritance handling.
        self.project = project

        # NOTE: when setting the dirty flag, make sure to use self.dirty rather than
        # self.__dirty.
        self.__dirty = False

        # Column headers
        self._headers = ['Name', 'Value']

        # Index of the last inserted item
        self.last_inserted_index = None

        # use platform specific folder and file icons
        self.folderIcon = QIcon()
        self.fileIcon = QIcon()
        std_icon = qApp.style().standardPixmap
        self.fileIcon.addPixmap(std_icon(QStyle.SP_FileIcon))
        self.folderIcon.addPixmap(std_icon(QStyle.SP_DirClosedIcon), QIcon.Normal, QIcon.Off)
Esempio n. 54
0
    def __init__(self, controller, distributedObjects, parent=None):
        """ Constructor <br>
            Create a VariableModel derived from an QAbstractItemModel to display the <br>
            GDB variables in a treeview.<br>
            Listens to the following Signals: SignalProxy::inferiorStoppedNormally(PyQt_PyObject) <br>
                                              SignalProxy::inferiorHasExited(PyQt_PyObject) and <br>
                                              SignalProxy::executableOpened()
        @param controller            controllers.WatchController, Reference to the WatchController
        @param distributedObjects    distributedobjects.DistributedObjects, the DistributedObjects-Instance
        @param parent                parent for the QAbstractItemModel-Constructor, can be None
        """

        QAbstractItemModel.__init__(self, parent)

        self.distributedObjects = distributedObjects
        self.controller = controller

        ## @var root
        #  RootVarWrapper, root item of tree
        self.root = RootVarWrapper()

        self.distributedObjects.signalProxy.inferiorStoppedNormally.connect(self.update)
        self.distributedObjects.signalProxy.inferiorHasExited.connect(self.clear)
        self.distributedObjects.signalProxy.executableOpened.connect(self.clear)
Esempio n. 55
0
 def __init__(self, root, parent=None):
     QAbstractItemModel.__init__(self, parent)
     self.invisibleRootItem = root
     self.symbolIcon = lambda x:None
Esempio n. 56
0
 def __init__(self):
     QAbstractItemModel.__init__(self)
     self.__data = []
Esempio n. 57
0
 def __init__(self, project_finder):
     QAbstractItemModel.__init__(self)
     self.project_finder = project_finder
     self.project_finder.fileChanged.connect(self.fileChanged)
Esempio n. 58
0
 def __init__(self, framework, parent = None):
     QAbstractItemModel.__init__(self, parent)
     self.framework = framework
     self.nodes = []
Esempio n. 59
0
    def __init__(self, wordSet):
        QAbstractItemModel.__init__(self)

        self._wordSet = wordSet