本文整理汇总了Python中pyqtcore.QMap类的典型用法代码示例。如果您正苦于以下问题:Python QMap类的具体用法?Python QMap怎么用?Python QMap使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QMap类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: FormatHelper
class FormatHelper():
def __init__(self, capabilities, initialFilter):
self.mFilter = initialFilter
self.mFormats = QList()
self.mFormatByNameFilter = QMap()
def t(self, format):
if (format.hasCapabilities(capabilities)):
nameFilter = format.nameFilter()
self.mFilter += ";;"
self.mFilter += nameFilter
self.mFormats.append(format)
self.mFormatByNameFilter.insert(nameFilter, format)
PluginManager.each(self, t)
def filter(self):
return self.mFilter
def formats(self):
return self.mFormats
def formatByNameFilter(self, nameFilter):
return self.mFormatByNameFilter.value(nameFilter)
示例2: __init__
def __init__(self, parent=None):
super(MainWindow, self).__init__(parent)
self.propertyToId = QMap()
self.idToProperty = QMap()
self.idToExpanded = QMap()
editMenu = self.menuBar().addMenu(self.tr("Edit"))
newObjectMenu = editMenu.addMenu(self.tr("New Object"))
newRectangleAction = QAction(self.tr("Rectangle"), self)
newRectangleAction.triggered.connect(self.newRectangle)
newObjectMenu.addAction(newRectangleAction)
newLineAction = QAction(self.tr("Line"), self)
newLineAction.triggered.connect(self.newLine)
newObjectMenu.addAction(newLineAction)
newEllipseAction = QAction(self.tr("Ellipse"), self)
newEllipseAction.triggered.connect(self.newEllipse)
newObjectMenu.addAction(newEllipseAction)
newTextAction = QAction(self.tr("Text"), self)
newTextAction.triggered.connect(self.newText)
newObjectMenu.addAction(newTextAction)
self.deleteAction = QAction(self.tr("Delete Object"), self)
self.deleteAction.triggered.connect(self.deleteObject)
editMenu.addAction(self.deleteAction)
clearAction = QAction(self.tr("Clear All"), self)
clearAction.triggered.connect(self.clearAll)
editMenu.addAction(clearAction)
fillAction = QAction(self.tr("Fill View"), self)
fillAction.triggered.connect(self.fillView)
editMenu.addAction(fillAction)
self.variantManager = QtVariantPropertyManager(self)
self.variantManager.valueChangedSignal.connect(self.valueChanged)
variantFactory = QtVariantEditorFactory(self)
self.canvas = QtCanvas(800, 600)
self.canvasView = CanvasView(self.canvas, self)
self.setCentralWidget(self.canvasView)
dock = QDockWidget(self)
self.addDockWidget(Qt.RightDockWidgetArea, dock)
self.propertyEditor = QtTreePropertyBrowser(dock)
self.propertyEditor.setFactoryForManager(self.variantManager, variantFactory)
dock.setWidget(self.propertyEditor)
self.currentItem = QtCanvasItem(None)
self.canvasView.itemClickedSignal.connect(self.itemClicked)
self.canvasView.itemMovedSignal.connect(self.itemMoved)
self.fillView()
self.itemClicked(QtCanvasItem(None))
示例3: __init__
def __init__(self, parent=None):
super(VariantManager, self).__init__(parent)
self.propertyToData = QMap()
self.xToProperty = QMap()
self.yToProperty = QMap()
self.valueChangedSignal.connect(self.slotValueChanged)
self.propertyDestroyedSignal.connect(self.slotPropertyDestroyed)
示例4: __init__
def __init__(self):
self.q_ptr = None
self.m_indexToItem = QMap()
self.m_itemToIndex = QMap()
self.m_widgetToItem = QMap()
self.m_mainLayout = 0
self.m_children = QList()
self.m_recreateQueue = QList()
示例5: __init__
def __init__(self, parent=None):
super(QtPropertyEditorDelegate, self).__init__(parent)
self.m_editorPrivate = 0
self.m_editedItem = 0
self.m_editedWidget = 0
self.m_disablePainting = False
self.m_propertyToEditor = QMap()
self.m_editorToProperty = QMap()
示例6: __init__
def __init__(self, parent):
super().__init__(parent)
self.mObjectGroups = QList()
self.mObjects = QMap()
self.mGroups = QMap()
self.mMapDocument = None
self.mMap = None
self.mObject = None
self.mObjectGroupIcon = ":/images/16x16/layer-object.png"
示例7: intToEnum
def intToEnum(self, metaEnum, intValue):
valueMap = QMap() # dont show multiple enum values which have the same values
values = QList()
for i in range(metaEnum.keyCount()):
value = metaEnum.value(i)
if (not valueMap.contains(value)):
valueMap[value] = True
values.append(value)
if (intValue >= values.count()):
return -1
return values.at(intValue)
示例8: enumToInt
def enumToInt(self, metaEnum, enumValue):
valueMap = QMap() # dont show multiple enum values which have the same values
pos = 0
for i in range(metaEnum.keyCount()):
value = metaEnum.value(i)
if (not valueMap.contains(value)):
if (value == enumValue):
return pos
valueMap[value] = pos
pos += 1
return -1
示例9: __init__
def __init__(self):
self.q_ptr = 0
self.m_object = 0
self.m_classToProperty = QMap()
self.m_propertyToClass = QMap()
self.m_propertyToIndex = QMap()
self.m_classToIndexToProperty = QMapMap()
self.m_propertyToExpanded = QMap()
self.m_topLevelProperties = QList()
self.m_browser = 0
self.m_manager = 0
self.m_readOnlyManager = 0
示例10: insertRow
def insertRow(self, layout, row):
itemToPos = QMap()
idx = 0
while (idx < layout.count()):
r, c, rs, cs = layout.getItemPosition(idx)
if (r >= row):
itemToPos[layout.takeAt(idx)] = QRect(r + 1, c, rs, cs)
else:
idx += 1
for it in itemToPos.keys():
r = itemToPos[it]
layout.addItem(it, r.x(), r.y(), r.width(), r.height())
示例11: __init__
def __init__(self, *args):
self.mInvalidTile = None
self.mTilesetColumnCounts = QMap()
self.mFirstGidToTileset = QMap()
if len(args)==1:
##
# Constructor that initializes the gid mapper using the given \a tilesets.
##
firstGid = 1
tilesets = args[0]
for tileset in tilesets:
self.insert(firstGid, tileset)
firstGid += tileset.tileCount()
示例12: removeRow
def removeRow(self, layout, row):
itemToPos = QMap()
idx = 0
while (idx < len(layout)):
r, c, rs, cs = layout.getItemPosition(idx)
if (r > row):
itemToPos[layout.takeAt(idx)] = QRect(r - 1, c, rs, cs)
else:
idx += 1
for k in itemToPos.keys():
r = itemToPos[k]
layout.addItem(k, r.x(), r.y(), r.width(), r.height())
示例13: flagToInt
def flagToInt(self, metaEnum, flagValue):
if (not flagValue):
return 0
intValue = 0
valueMap = QMap() # dont show multiple enum values which have the same values
pos = 0
for i in range(metaEnum.keyCount()):
value = metaEnum.value(i)
if (not valueMap.contains(value) and self.isPowerOf2(value)):
if (self.isSubValue(flagValue, value)):
intValue |= (1 << pos)
valueMap[value] = pos
pos += 1
return intValue
示例14: __init__
def __init__(self, parent = None):
super().__init__(parent)
self.mWatchCount = QMap()
self.mWatcher = QFileSystemWatcher(self)
self.mWatcher.fileChanged.connect(self.onFileChanged)
self.mWatcher.directoryChanged.connect(self.onDirectoryChanged)
示例15: constructAdditionalTable
def constructAdditionalTable(self, props, propOrder):
tableString = QString()
unhandledProps = QMap(props)
# Remove handled properties
for i in range(0, propOrder.size()):
unhandledProps.remove(propOrder[i])
# Construct the Lua string
if (unhandledProps.size() > 0) :
tableString = "{"
for i in unhandledProps:
tableString = "%s%s=%s,"%tableString, i[0], i[1]
tableString = "%s}"%tableString
return tableString