当前位置: 首页>>代码示例>>Python>>正文


Python pyqtcore.QMap类代码示例

本文整理汇总了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)
开发者ID:theall,项目名称:Python-Tiled,代码行数:25,代码来源:mapformat.py

示例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))
开发者ID:theall,项目名称:QtPropertyBrowserV2.6-for-pyqt5,代码行数:60,代码来源:canvas_variant.py

示例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)
开发者ID:theall,项目名称:QtPropertyBrowserV2.6-for-pyqt5,代码行数:8,代码来源:extension.py

示例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()
开发者ID:theall,项目名称:Python-Tiled,代码行数:8,代码来源:qtgroupboxpropertybrowser.py

示例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()
开发者ID:theall,项目名称:QtPropertyBrowserV2.6-for-pyqt5,代码行数:9,代码来源:qttreepropertybrowser.py

示例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"
开发者ID:theall,项目名称:Python-Tiled,代码行数:10,代码来源:mapobjectmodel.py

示例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)
开发者ID:theall,项目名称:QtPropertyBrowserV2.6-for-pyqt5,代码行数:12,代码来源:objectcontroller.py

示例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
开发者ID:theall,项目名称:QtPropertyBrowserV2.6-for-pyqt5,代码行数:12,代码来源:objectcontroller.py

示例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
开发者ID:theall,项目名称:QtPropertyBrowserV2.6-for-pyqt5,代码行数:12,代码来源:objectcontroller.py

示例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())
开发者ID:theall,项目名称:Python-Tiled,代码行数:13,代码来源:qtgroupboxpropertybrowser.py

示例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()
开发者ID:theall,项目名称:Python-Tiled,代码行数:13,代码来源:gidmapper.py

示例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())
开发者ID:theall,项目名称:QtPropertyBrowserV2.6-for-pyqt5,代码行数:13,代码来源:qtbuttonpropertybrowser.py

示例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
开发者ID:theall,项目名称:QtPropertyBrowserV2.6-for-pyqt5,代码行数:15,代码来源:objectcontroller.py

示例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)
开发者ID:theall,项目名称:Python-Tiled,代码行数:7,代码来源:filesystemwatcher.py

示例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
开发者ID:theall,项目名称:Python-Tiled,代码行数:16,代码来源:tengineplugin.py


注:本文中的pyqtcore.QMap类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。