本文整理汇总了Python中pyqtcore.QVector.insert方法的典型用法代码示例。如果您正苦于以下问题:Python QVector.insert方法的具体用法?Python QVector.insert怎么用?Python QVector.insert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyqtcore.QVector
的用法示例。
在下文中一共展示了QVector.insert方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: MapScene
# 需要导入模块: from pyqtcore import QVector [as 别名]
# 或者: from pyqtcore.QVector import insert [as 别名]
#.........这里部分代码省略.........
# Adapts the scene, layers and objects to new map size, orientation or
# background color.
##
def mapChanged(self):
self.updateSceneRect()
for item in self.mLayerItems:
tli = item
if type(tli) == TileLayerItem:
tli.syncWithTileLayer()
for item in self.mObjectItems.values():
item.syncWithMapObject()
map = self.mMapDocument.map()
if (map.backgroundColor().isValid()):
self.setBackgroundBrush(map.backgroundColor())
else:
self.setBackgroundBrush(self.mDefaultBackgroundColor)
def tilesetChanged(self, tileset):
if (not self.mMapDocument):
return
if (contains(self.mMapDocument.map().tilesets(), tileset)):
self.update()
def tileLayerDrawMarginsChanged(self, tileLayer):
index = self.mMapDocument.map().layers().indexOf(tileLayer)
item = self.mLayerItems.at(index)
item.syncWithTileLayer()
def layerAdded(self, index):
layer = self.mMapDocument.map().layerAt(index)
layerItem = self.createLayerItem(layer)
self.addItem(layerItem)
self.mLayerItems.insert(index, layerItem)
z = 0
for item in self.mLayerItems:
item.setZValue(z)
z += 1
def layerRemoved(self, index):
self.mLayerItems.remove(index)
##
# A layer has changed. This can mean that the layer visibility, opacity or
# offset changed.
##
def layerChanged(self, index):
layer = self.mMapDocument.map().layerAt(index)
layerItem = self.mLayerItems.at(index)
layerItem.setVisible(layer.isVisible())
multiplier = 1
if (self.mHighlightCurrentLayer and self.mMapDocument.currentLayerIndex() < index):
multiplier = opacityFactor
layerItem.setOpacity(layer.opacity() * multiplier)
layerItem.setPos(layer.offset())
# Layer offset may have changed, affecting the scene rect and grid
self.updateSceneRect()
if self.mGridVisible:
self.update()
##
# When an object group has changed it may mean its color or drawing order
# changed, which affects all its objects.
##
def objectGroupChanged(self, objectGroup):