本文整理汇总了Python中pyqtcore.QMap.values方法的典型用法代码示例。如果您正苦于以下问题:Python QMap.values方法的具体用法?Python QMap.values怎么用?Python QMap.values使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyqtcore.QMap
的用法示例。
在下文中一共展示了QMap.values方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: MapScene
# 需要导入模块: from pyqtcore import QMap [as 别名]
# 或者: from pyqtcore.QMap import values [as 别名]
#.........这里部分代码省略.........
##
# Repaints the specified region. The region is in tile coordinates.
##
def repaintRegion(self, region, layer):
renderer = self.mMapDocument.renderer()
margins = self.mMapDocument.map().drawMargins()
for r in region.rects():
boundingRect = QRectF(renderer.boundingRect(r))
self.update(QRectF(renderer.boundingRect(r).adjusted(-margins.left(),
-margins.top(),
margins.right(),
margins.bottom())))
boundingRect.translate(layer.offset())
self.update(boundingRect)
def currentLayerIndexChanged(self):
self.updateCurrentLayerHighlight()
# New layer may have a different offset, affecting the grid
if self.mGridVisible:
self.update()
##
# 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)
##