本文整理汇总了Python中pyqtcore.QList.prepend方法的典型用法代码示例。如果您正苦于以下问题:Python QList.prepend方法的具体用法?Python QList.prepend怎么用?Python QList.prepend使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyqtcore.QList
的用法示例。
在下文中一共展示了QList.prepend方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: MapObjectModel
# 需要导入模块: from pyqtcore import QList [as 别名]
# 或者: from pyqtcore.QList import prepend [as 别名]
#.........这里部分代码省略.........
return oog.mObject
def toLayer(self, index):
if (not index.isValid()):
return None
oog = index.internalPointer()
if oog:
if oog.mGroup:
_x = oog.mGroup
else:
_x = oog.mObject.objectGroup()
return _x
def setMapDocument(self, mapDocument):
if (self.mMapDocument == mapDocument):
return
if (self.mMapDocument):
self.mMapDocument.disconnect()
self.beginResetModel()
self.mMapDocument = mapDocument
self.mMap = None
self.mObjectGroups.clear()
self.mGroups.clear()
self.mGroups.clear()
self.mObjects.clear()
self.mObjects.clear()
if (self.mMapDocument):
self.mMap = self.mMapDocument.map()
self.mMapDocument.layerAdded.connect(self.layerAdded)
self.mMapDocument.layerChanged.connect(self.layerChanged)
self.mMapDocument.layerAboutToBeRemoved.connect(self.layerAboutToBeRemoved)
for og in self.mMap.objectGroups():
if GROUPS_IN_DISPLAY_ORDER:
self.mObjectGroups.prepend(og)
else:
self.mObjectGroups.append(og)
self.mGroups.insert(og, ObjectOrGroup(og))
for o in og.objects():
self.mObjects.insert(o, ObjectOrGroup(o))
self.endResetModel()
def insertObject(self, og, index, o):
if (index >= 0):
_x = index
else:
_x = og.objectCount()
row = _x
self.beginInsertRows(self.index(og), row, row)
og.insertObject(row, o)
self.mObjects.insert(o, ObjectOrGroup(o))
self.endInsertRows()
self.objectsAdded.emit(QList([o]))
def removeObject(self, og, o):
objects = QList()
objects.append(o)
row = og.objects().indexOf(o)
self.beginRemoveRows(self.index(og), row, row)
og.removeObjectAt(row)
self.mObjects.remove(o)
self.endRemoveRows()
self.objectsRemoved.emit(objects)
return row
def moveObjects(self, og, _from, to, count):