當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。