当前位置: 首页>>代码示例>>Python>>正文


Python QAbstractItemModel.__init__方法代码示例

本文整理汇总了Python中PyQt4.QtCore.QAbstractItemModel.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python QAbstractItemModel.__init__方法的具体用法?Python QAbstractItemModel.__init__怎么用?Python QAbstractItemModel.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PyQt4.QtCore.QAbstractItemModel的用法示例。


在下文中一共展示了QAbstractItemModel.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from PyQt4.QtCore import QAbstractItemModel [as 别名]
# 或者: from PyQt4.QtCore.QAbstractItemModel import __init__ [as 别名]
	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
开发者ID:KelSolaar,项目名称:Umbra,代码行数:36,代码来源:models.py

示例2: __init__

# 需要导入模块: from PyQt4.QtCore import QAbstractItemModel [as 别名]
# 或者: from PyQt4.QtCore.QAbstractItemModel import __init__ [as 别名]
    def __init__(self, parent ):
        """Constructor of SearchResultsModel class
        """
        QAbstractItemModel.__init__(self, parent )
        self._replaceMode = False

        self.fileResults = []  # list of FileResults
开发者ID:adjustive,项目名称:enki,代码行数:9,代码来源:searchresultsmodel.py

示例3: __init__

# 需要导入模块: from PyQt4.QtCore import QAbstractItemModel [as 别名]
# 或者: from PyQt4.QtCore.QAbstractItemModel import __init__ [as 别名]
 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)
开发者ID:tarmack,项目名称:Pythagora,代码行数:9,代码来源:filesystem.py

示例4: __init__

# 需要导入模块: from PyQt4.QtCore import QAbstractItemModel [as 别名]
# 或者: from PyQt4.QtCore.QAbstractItemModel import __init__ [as 别名]
    def __init__( self, parent = None ):
        QAbstractItemModel.__init__( self, parent )

        self.rootItem = FileItemRoot( [ "File name", "Full path" ] )
        self.count = 0
        self.__populateModel()
        return
开发者ID:eaglexmw,项目名称:codimension,代码行数:9,代码来源:findfile.py

示例5: __init__

# 需要导入模块: from PyQt4.QtCore import QAbstractItemModel [as 别名]
# 或者: from PyQt4.QtCore.QAbstractItemModel import __init__ [as 别名]
 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)
开发者ID:adjustive,项目名称:enki,代码行数:9,代码来源:openedfilemodel.py

示例6: __init__

# 需要导入模块: from PyQt4.QtCore import QAbstractItemModel [as 别名]
# 或者: from PyQt4.QtCore.QAbstractItemModel import __init__ [as 别名]
 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)  
开发者ID:bschen,项目名称:ricodebug,代码行数:34,代码来源:variablemodel.py

示例7: __init__

# 需要导入模块: from PyQt4.QtCore import QAbstractItemModel [as 别名]
# 或者: from PyQt4.QtCore.QAbstractItemModel import __init__ [as 别名]
  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)
开发者ID:halbbob,项目名称:dff,代码行数:32,代码来源:vfsitemmodel.py

示例8: __init__

# 需要导入模块: from PyQt4.QtCore import QAbstractItemModel [as 别名]
# 或者: from PyQt4.QtCore.QAbstractItemModel import __init__ [as 别名]
 def __init__(self, ert):
     """
     @type ert: ert.enkf.EnKFMain
     """
     QAbstractItemModel.__init__(self)
     self.__ert = ert
     self.__icon = util.resourceIcon("ide/small/bullet_star")
开发者ID:akva2,项目名称:ert,代码行数:9,代码来源:data_type_keys_list_model.py

示例9: __init__

# 需要导入模块: from PyQt4.QtCore import QAbstractItemModel [as 别名]
# 或者: from PyQt4.QtCore.QAbstractItemModel import __init__ [as 别名]
    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)
开发者ID:ssimons,项目名称:PyTreeEditor,代码行数:9,代码来源:tree_model.py

示例10: __init__

# 需要导入模块: from PyQt4.QtCore import QAbstractItemModel [as 别名]
# 或者: from PyQt4.QtCore.QAbstractItemModel import __init__ [as 别名]
    def __init__( self, headerData, parent = None ):
        QAbstractItemModel.__init__( self, parent )

        self.rootItem = TreeViewItem( None, headerData )
        self.globalData = GlobalData()
        self.projectTopLevelDirs = []
        self.showTooltips = True
        return
开发者ID:eaglexmw,项目名称:codimension,代码行数:10,代码来源:browsermodelbase.py

示例11: __init__

# 需要导入模块: from PyQt4.QtCore import QAbstractItemModel [as 别名]
# 或者: from PyQt4.QtCore.QAbstractItemModel import __init__ [as 别名]
	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)
开发者ID:LeoMirr,项目名称:tagcoder,代码行数:10,代码来源:_model.py

示例12: __init__

# 需要导入模块: from PyQt4.QtCore import QAbstractItemModel [as 别名]
# 或者: from PyQt4.QtCore.QAbstractItemModel import __init__ [as 别名]
    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
开发者ID:eaglexmw,项目名称:codimension,代码行数:10,代码来源:findname.py

示例13: __init__

# 需要导入模块: from PyQt4.QtCore import QAbstractItemModel [as 别名]
# 或者: from PyQt4.QtCore.QAbstractItemModel import __init__ [as 别名]
 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)
开发者ID:tarmack,项目名称:Pythagora,代码行数:11,代码来源:playlists.py

示例14: __init__

# 需要导入模块: from PyQt4.QtCore import QAbstractItemModel [as 别名]
# 或者: from PyQt4.QtCore.QAbstractItemModel import __init__ [as 别名]
 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)
开发者ID:r0b1n1983liu,项目名称:o3env,代码行数:12,代码来源:OWGeneInfo.py

示例15: __init__

# 需要导入模块: from PyQt4.QtCore import QAbstractItemModel [as 别名]
# 或者: from PyQt4.QtCore.QAbstractItemModel import __init__ [as 别名]
 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)
开发者ID:herr-biber,项目名称:sloth,代码行数:13,代码来源:model.py


注:本文中的PyQt4.QtCore.QAbstractItemModel.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。