qteditorfactory.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:QtPropertyBrowserV2.6-for-pyqt5 作者: theall 项目源码 文件源码
def createEditor(self, manager, property, parent):
        editor = self.d_ptr.createEditor(property, parent)
        editor.setSizeAdjustPolicy(QComboBox.AdjustToMinimumContentsLengthWithIcon)
        editor.setMinimumContentsLength(1)
        editor.view().setTextElideMode(Qt.ElideRight)
        enumNames = manager.enumNames(property)
        editor.addItems(enumNames)
        enumIcons = manager.enumIcons(property)
        enumNamesCount = len(enumNames)
        for i in range(enumNamesCount):
            icon = enumIcons[i]
            if type(icon) is not QIcon:
                icon = QIcon()
            editor.setItemIcon(i, icon)
        editor.setCurrentIndex(manager.value(property))

        editor.currentIndexChanged.connect(self.d_ptr.slotSetValue)
        editor.destroyed.connect(self.d_ptr.slotEditorDestroyed)
        return editor

    ###
    #   \internal

    #   Reimplemented from the QtAbstractEditorFactory class.
    ###
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号