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


Python QListView.model方法代码示例

本文整理汇总了Python中PyQt5.QtWidgets.QListView.model方法的典型用法代码示例。如果您正苦于以下问题:Python QListView.model方法的具体用法?Python QListView.model怎么用?Python QListView.model使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PyQt5.QtWidgets.QListView的用法示例。


在下文中一共展示了QListView.model方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: OS2Tab

# 需要导入模块: from PyQt5.QtWidgets import QListView [as 别名]
# 或者: from PyQt5.QtWidgets.QListView import model [as 别名]
class OS2Tab(TabWidget):

    def __init__(self, font, parent=None):
        super().__init__(parent, name="OS/2")

        # OS2Group = QGroupBox("OS/2 table", self)
        # OS2Group.setFlat(True)
        OS2Layout = QGridLayout(self)

        usWidthClassLabel = QLabel("usWidthClass:", self)
        self.usWidthClassDrop = QComboBox(self)
        items = [
            "None", "Ultra-condensed", "Extra-condensed", "Condensed",
            "Semi-Condensed", "Medium (normal)", "Semi-expanded", "Expanded",
            "Extra-expanded", "Ultra-expanded"]
        self.usWidthClassDrop.insertItems(0, items)
        if font.info.openTypeOS2WidthClass is not None:
            self.usWidthClassDrop.setCurrentIndex(
                font.info.openTypeOS2WidthClass)

        fsSelectionLabel = QLabel("fsSelection:", self)
        fsSelection = font.info.openTypeOS2Selection
        self.fsSelectionList = QListView(self)
        items = [
            "1 UNDERSCORE", "2 NEGATIVE", "3 OUTLINED", "4 STRIKEOUT",
            "7 USE_TYPO_METRICS", "8 WWS", "9 OBLIQUE"]
        # http://stackoverflow.com/a/26613163
        model = QStandardItemModel(7, 1)
        for index, elem in enumerate(items):
            item = QStandardItem()
            item.setText(elem)
            item.setCheckable(True)
            bit = index + 1
            if fsSelection is not None and bit in fsSelection:
                # maybe default setting? if so, unneeded
                item.setCheckState(Qt.Checked)
            else:
                item.setCheckState(Qt.Unchecked)
            model.setItem(index, item)
        self.fsSelectionList.setModel(model)

        achVendorIDLabel = QLabel("achVendorID:", self)
        self.achVendorIDEdit = QLineEdit(font.info.openTypeOS2VendorID, self)
        self.achVendorIDEdit.setMaxLength(4)

        fsTypeLabel = QLabel("fsType:", self)
        fsType = font.info.openTypeOS2Type
        self.fsTypeDrop = QComboBox(self)
        items = [
            "No embedding restrictions", "Restricted embedding",
            "Preview and print embedding allowed",
            "Editable embedding allowed"]
        self.allowSubsettingBox = QCheckBox("Allow subsetting", self)
        self.allowBitmapEmbeddingBox = QCheckBox(
            "Allow only bitmap embedding", self)
        self.fsTypeDrop.currentIndexChanged[int].connect(
            self._updateFsTypeVisibility)
        self.fsTypeDrop.insertItems(0, items)
        if fsType is not None:
            for i in range(1, 4):
                if i in fsType:
                    self.fsTypeDrop.setCurrentIndex(i)
                    break
            self.allowSubsettingBox.setChecked(8 not in fsType)
            self.allowBitmapEmbeddingBox.setChecked(9 in fsType)

        # XXX: ulUnicodeRange

        # XXX: ulCodePageRange

        sTypoAscenderLabel = QLabel("sTypoAscender:", self)
        sTypoDescenderLabel = QLabel("sTypoDescender:", self)
        sTypoLineGapLabel = QLabel("sTypoLineGap:", self)
        usWeightClassLabel = QLabel("usWeightClass:", self)
        usWinAscentLabel = QLabel("usWinAscent:", self)
        usWinDescentLabel = QLabel("usWinDescent:", self)
        ySubscriptXSizeLabel = QLabel("ySubscriptXSize:", self)
        ySubscriptYSizeLabel = QLabel("ySubscriptYSize:", self)
        ySubscriptXOffsetLabel = QLabel("ySubscriptXOffset:", self)
        ySubscriptYOffsetLabel = QLabel("ySubscriptYOffset:", self)
        ySuperscriptXSizeLabel = QLabel("ySuperscriptXSize:", self)
        ySuperscriptYSizeLabel = QLabel("ySuperscriptYSize:", self)
        ySuperscriptXOffsetLabel = QLabel("ySuperscriptXOffset:", self)
        ySuperscriptYOffsetLabel = QLabel("ySuperscriptYOffset:", self)
        yStrikeoutSizeLabel = QLabel("yStrikeoutSize:", self)
        yStrikeoutPositionLabel = QLabel("yStrikeoutPosition:", self)
        self.loadPositiveInteger(
            font, "openTypeOS2WeightClass", "usWeightClass")
        self.loadInteger(font, "openTypeOS2TypoAscender", "sTypoAscender")
        self.loadInteger(font, "openTypeOS2TypoDescender", "sTypoDescender")
        self.loadInteger(font, "openTypeOS2TypoLineGap", "sTypoLineGap")
        self.loadPositiveInteger(font, "openTypeOS2WinAscent", "usWinAscent")
        self.loadPositiveInteger(font, "openTypeOS2WinDescent", "usWinDescent")
        self.loadInteger(font, "openTypeOS2SubscriptXSize", "ySubscriptXSize")
        self.loadInteger(font, "openTypeOS2SubscriptYSize", "ySubscriptYSize")
        self.loadInteger(
            font, "openTypeOS2SubscriptXOffset", "ySubscriptXOffset")
        self.loadInteger(
            font, "openTypeOS2SubscriptYOffset", "ySubscriptYOffset")
        self.loadInteger(
#.........这里部分代码省略.........
开发者ID:pathumego,项目名称:trufont,代码行数:103,代码来源:fontInfo.py


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