本文整理匯總了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):