• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python pyqtcore.QMap类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中pyqtcore.QMap的典型用法代码示例。如果您正苦于以下问题:Python QMap类的具体用法?Python QMap怎么用?Python QMap使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了QMap类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: __init__

    def __init__(self, parent = None):
        self.mValues = QMap()
        self.mSuggestions = QMapList()
        self.mSuggestionsAttribute = QString()
        self.Data = VariantPropertyManager.Data()

        super().__init__(parent)
        self.mSuggestionsAttribute = "suggestions"
开发者ID:theall,项目名称:Python-Tiled,代码行数:8,代码来源:variantpropertymanager.py


示例17: __init__

    def __init__(self, parent=None):
        super(DecoratedDoubleSpinBoxFactory, self).__init__(parent)

        self.propertyToData = QMap()
        # We delegate responsibilities for QtDoublePropertyManager, which is a base class
        #   of DecoratedDoublePropertyManager to appropriate 
        self.originalFactory = QtDoubleSpinBoxFactory(self)
        self.createdEditors = QMapList()
        self.editorToProperty = QMap()
开发者ID:theall,项目名称:QtPropertyBrowserV2.6-for-pyqt5,代码行数:9,代码来源:decoration.py


示例18: __init__

    def __init__(self):
        self.m_cursorNames = QList()
        self.m_cursorIcons = QMap()
        self.m_valueToCursorShape = QMap()
        self.m_cursorShapeToValue = QMap()

        self.appendCursor(Qt.ArrowCursor, QCoreApplication.translate("QtCursorDatabase", "Arrow"),
                     QIcon(":/qt-project.org/qtpropertybrowser/images/cursor-arrow.png"))
        self.appendCursor(Qt.UpArrowCursor, QCoreApplication.translate("QtCursorDatabase", "Up Arrow"),
                     QIcon(":/qt-project.org/qtpropertybrowser/images/cursor-uparrow.png"))
        self.appendCursor(Qt.CrossCursor, QCoreApplication.translate("QtCursorDatabase", "Cross"),
                     QIcon(":/qt-project.org/qtpropertybrowser/images/cursor-cross.png"))
        self.appendCursor(Qt.WaitCursor, QCoreApplication.translate("QtCursorDatabase", "Wait"),
                     QIcon(":/qt-project.org/qtpropertybrowser/images/cursor-wait.png"))
        self.appendCursor(Qt.IBeamCursor, QCoreApplication.translate("QtCursorDatabase", "IBeam"),
                     QIcon(":/qt-project.org/qtpropertybrowser/images/cursor-ibeam.png"))
        self.appendCursor(Qt.SizeVerCursor, QCoreApplication.translate("QtCursorDatabase", "Size Vertical"),
                     QIcon(":/qt-project.org/qtpropertybrowser/images/cursor-sizev.png"))
        self.appendCursor(Qt.SizeHorCursor, QCoreApplication.translate("QtCursorDatabase", "Size Horizontal"),
                     QIcon(":/qt-project.org/qtpropertybrowser/images/cursor-sizeh.png"))
        self.appendCursor(Qt.SizeFDiagCursor, QCoreApplication.translate("QtCursorDatabase", "Size Backslash"),
                     QIcon(":/qt-project.org/qtpropertybrowser/images/cursor-sizef.png"))
        self.appendCursor(Qt.SizeBDiagCursor, QCoreApplication.translate("QtCursorDatabase", "Size Slash"),
                     QIcon(":/qt-project.org/qtpropertybrowser/images/cursor-sizeb.png"))
        self.appendCursor(Qt.SizeAllCursor, QCoreApplication.translate("QtCursorDatabase", "Size All"),
                     QIcon(":/qt-project.org/qtpropertybrowser/images/cursor-sizeall.png"))
        self.appendCursor(Qt.BlankCursor, QCoreApplication.translate("QtCursorDatabase", "Blank"),
                     QIcon())
        self.appendCursor(Qt.SplitVCursor, QCoreApplication.translate("QtCursorDatabase", "Split Vertical"),
                     QIcon(":/qt-project.org/qtpropertybrowser/images/cursor-vsplit.png"))
        self.appendCursor(Qt.SplitHCursor, QCoreApplication.translate("QtCursorDatabase", "Split Horizontal"),
                     QIcon(":/qt-project.org/qtpropertybrowser/images/cursor-hsplit.png"))
        self.appendCursor(Qt.PointingHandCursor, QCoreApplication.translate("QtCursorDatabase", "Pointing Hand"),
                     QIcon(":/qt-project.org/qtpropertybrowser/images/cursor-hand.png"))
        self.appendCursor(Qt.ForbiddenCursor, QCoreApplication.translate("QtCursorDatabase", "Forbidden"),
                     QIcon(":/qt-project.org/qtpropertybrowser/images/cursor-forbidden.png"))
        self.appendCursor(Qt.OpenHandCursor, QCoreApplication.translate("QtCursorDatabase", "Open Hand"),
                     QIcon(":/qt-project.org/qtpropertybrowser/images/cursor-openhand.png"))
        self.appendCursor(Qt.ClosedHandCursor, QCoreApplication.translate("QtCursorDatabase", "Closed Hand"),
                     QIcon(":/qt-project.org/qtpropertybrowser/images/cursor-closedhand.png"))
        self.appendCursor(Qt.WhatsThisCursor, QCoreApplication.translate("QtCursorDatabase", "What's This"),
                     QIcon(":/qt-project.org/qtpropertybrowser/images/cursor-whatsthis.png"))
        self.appendCursor(Qt.BusyCursor, QCoreApplication.translate("QtCursorDatabase", "Busy"),
                     QIcon(":/qt-project.org/qtpropertybrowser/images/cursor-busy.png"))
开发者ID:theall,项目名称:Python-Tiled,代码行数:44,代码来源:qtpropertybrowserutils.py


示例19: intToFlag

    def intToFlag(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) and self.isPowerOf2(value)):
                valueMap[value] = True
                values.append(value)

        flagValue = 0
        temp = intValue
        i = 0
        while (temp):
            if (i >= values.count()):
                return -1
            if (temp & 1):
                flagValue |= values.at(i)
            i += 1
            temp = temp >> 1

        return flagValue
开发者ID:theall,项目名称:QtPropertyBrowserV2.6-for-pyqt5,代码行数:21,代码来源:objectcontroller.py


示例20: __init__

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python pyqtcore.QVector类代码示例发布时间:2022-05-27
下一篇:
Python pyqtcore.QList类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap