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


Python QAbstractListModel.__init__方法代码示例

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


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

示例1: __init__

# 需要导入模块: from PyQt4.Qt import QAbstractListModel [as 别名]
# 或者: from PyQt4.Qt.QAbstractListModel import __init__ [as 别名]
    def __init__(self, prefs, fm, pref_name, parent=None):
        QAbstractListModel.__init__(self, parent)

        self.fm = fm
        self.pref_name = pref_name
        if pref_name == 'column_color_rules':
            self.rule_kind = 'color'
            rules = list(prefs[pref_name])
            self.rules = []
            for col, template in rules:
                if col not in self.fm and col != color_row_key: continue
                try:
                    rule = rule_from_template(self.fm, template)
                except:
                    rule = template
                self.rules.append(('color', col, rule))
        else:
            self.rule_kind = 'icon'
            rules = list(prefs[pref_name])
            self.rules = []
            for kind, col, template in rules:
                if col not in self.fm and col != color_row_key: continue
                try:
                    rule = rule_from_template(self.fm, template)
                except:
                    rule = template
                self.rules.append((kind, col, rule))
开发者ID:john-peterson,项目名称:calibre,代码行数:29,代码来源:coloring.py

示例2: __init__

# 需要导入模块: from PyQt4.Qt import QAbstractListModel [as 别名]
# 或者: from PyQt4.Qt.QAbstractListModel import __init__ [as 别名]
    def __init__(self, current_cover, parent=None):
        QAbstractListModel.__init__(self, parent)

        if current_cover is None:
            current_cover = QPixmap(I('default_cover.png'))

        self.blank = QPixmap(I('blank.png')).scaled(150, 200)
        self.cc = current_cover
        self.reset_covers(do_reset=False)
开发者ID:yeyanchao,项目名称:calibre,代码行数:11,代码来源:single_download.py

示例3: __init__

# 需要导入模块: from PyQt4.Qt import QAbstractListModel [as 别名]
# 或者: from PyQt4.Qt.QAbstractListModel import __init__ [as 别名]
    def __init__(self, prefs, fm, parent=None):
        QAbstractListModel.__init__(self, parent)

        self.fm = fm
        rules = list(prefs['column_color_rules'])
        self.rules = []
        for col, template in rules:
            try:
                rule = rule_from_template(self.fm, template)
            except:
                rule = template
            self.rules.append((col, rule))
开发者ID:yeyanchao,项目名称:calibre,代码行数:14,代码来源:coloring.py

示例4: __init__

# 需要导入模块: from PyQt4.Qt import QAbstractListModel [as 别名]
# 或者: from PyQt4.Qt.QAbstractListModel import __init__ [as 别名]
 def __init__(self, *args):
     QAbstractListModel.__init__(self, *args)
     from calibre.utils.fonts import fontconfig
     try:
         self.families = fontconfig.find_font_families()
     except:
         self.families = []
         print 'WARNING: Could not load fonts'
         traceback.print_exc()
     # Restrict to Qt families as Qt tends to crash
     qt_families = set([unicode(x) for x in QFontDatabase().families()])
     self.families = list(qt_families.intersection(set(self.families)))
     self.families.sort()
     self.families[:0] = [_('None')]
     self.font = QFont('Arial' if iswindows else 'sansserif')
开发者ID:yeyanchao,项目名称:calibre,代码行数:17,代码来源:widgets.py

示例5: __init__

# 需要导入模块: from PyQt4.Qt import QAbstractListModel [as 别名]
# 或者: from PyQt4.Qt.QAbstractListModel import __init__ [as 别名]
 def __init__(self, widgets):
     self.widgets = widgets
     QAbstractListModel.__init__(self)
开发者ID:Hainish,项目名称:calibre,代码行数:5,代码来源:single.py

示例6: __init__

# 需要导入模块: from PyQt4.Qt import QAbstractListModel [as 别名]
# 或者: from PyQt4.Qt.QAbstractListModel import __init__ [as 别名]
 def __init__(self, parent=None):
     QAbstractListModel.__init__(self, parent)
     self.all_items = self.current_items = ()
     self.current_prefix = ''
开发者ID:briangraeme,项目名称:calibre,代码行数:6,代码来源:complete2.py

示例7: __init__

# 需要导入模块: from PyQt4.Qt import QAbstractListModel [as 别名]
# 或者: from PyQt4.Qt.QAbstractListModel import __init__ [as 别名]
 def __init__(self, parent):
     QAbstractListModel.__init__(self, parent)
     self.icon_size = parent.iconSize()
     self.build()
开发者ID:FaustXVI,项目名称:calibre,代码行数:6,代码来源:insert_resource.py

示例8: __init__

# 需要导入模块: from PyQt4.Qt import QAbstractListModel [as 别名]
# 或者: from PyQt4.Qt.QAbstractListModel import __init__ [as 别名]
 def __init__(self, recipe_model):
     QAbstractListModel.__init__(self)
     self.recipe_model = recipe_model
开发者ID:Hainish,项目名称:calibre,代码行数:5,代码来源:user_profiles.py

示例9: __init__

# 需要导入模块: from PyQt4.Qt import QAbstractListModel [as 别名]
# 或者: from PyQt4.Qt.QAbstractListModel import __init__ [as 别名]
 def __init__(self, parent=None):
     QAbstractListModel.__init__(self, parent)
     self.states = []
     self.pos = 0
开发者ID:Hainish,项目名称:calibre,代码行数:6,代码来源:undo.py

示例10: __init__

# 需要导入模块: from PyQt4.Qt import QAbstractListModel [as 别名]
# 或者: from PyQt4.Qt.QAbstractListModel import __init__ [as 别名]
 def __init__(self, manufacturer):
     QAbstractListModel.__init__(self)
     self.devices = get_devices_of(manufacturer)
开发者ID:yeyanchao,项目名称:calibre,代码行数:5,代码来源:__init__.py

示例11: __init__

# 需要导入模块: from PyQt4.Qt import QAbstractListModel [as 别名]
# 或者: from PyQt4.Qt.QAbstractListModel import __init__ [as 别名]
 def __init__(self, names, parent=None):
     self.items = []
     QAbstractListModel.__init__(self, parent)
     self.set_names(names)
开发者ID:dusual,项目名称:calibre,代码行数:6,代码来源:widgets.py

示例12: __init__

# 需要导入模块: from PyQt4.Qt import QAbstractListModel [as 别名]
# 或者: from PyQt4.Qt.QAbstractListModel import __init__ [as 别名]
    def __init__(self, db, parent=None):
        QAbstractListModel.__init__(self, parent)

        self.fields = []
        self.db = db
        self.changed = False
开发者ID:HaraldGustafsson,项目名称:calibre,代码行数:8,代码来源:look_feel.py

示例13: __init__

# 需要导入模块: from PyQt4.Qt import QAbstractListModel [as 别名]
# 或者: from PyQt4.Qt.QAbstractListModel import __init__ [as 别名]
 def __init__(self, parent=None):
     QAbstractListModel.__init__(self, parent)
     self.chars = []
     self.allow_dnd = False
开发者ID:mapopescu,项目名称:calibre,代码行数:6,代码来源:char_select.py

示例14: __init__

# 需要导入模块: from PyQt4.Qt import QAbstractListModel [as 别名]
# 或者: from PyQt4.Qt.QAbstractListModel import __init__ [as 别名]
    def __init__(self, parent=None):
        QAbstractListModel.__init__(self, parent)
        SearchQueryParser.__init__(self, ['all'])
        raw_defaults, raw_custom = read_raw_tweaks()

        self.parse_tweaks(raw_defaults, raw_custom)
开发者ID:089git,项目名称:calibre,代码行数:8,代码来源:tweaks.py

示例15: __init__

# 需要导入模块: from PyQt4.Qt import QAbstractListModel [as 别名]
# 或者: from PyQt4.Qt.QAbstractListModel import __init__ [as 别名]
 def __init__(self, parent=None):
     QAbstractListModel.__init__(self, parent)
     self.items = []
     self.sorting = QCompleter.UnsortedModel
开发者ID:Eksmo,项目名称:calibre,代码行数:6,代码来源:complete.py


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