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


Python QListView.__init__方法代码示例

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


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

示例1: __init__

# 需要导入模块: from PyQt4.Qt import QListView [as 别名]
# 或者: from PyQt4.Qt.QListView import __init__ [as 别名]
 def __init__(self, parent):
     QListView.__init__(self, parent)
     setup_dnd_interface(self)
     self.setUniformItemSizes(True)
     self.setWrapping(True)
     self.setFlow(self.LeftToRight)
     # We cannot set layout mode to batched, because that breaks
     # restore_vpos()
     # self.setLayoutMode(self.Batched)
     self.setResizeMode(self.Adjust)
     self.setSelectionMode(self.ExtendedSelection)
     self.setVerticalScrollMode(self.ScrollPerPixel)
     self.delegate = CoverDelegate(self)
     self.delegate.animation.valueChanged.connect(self.animation_value_changed)
     self.delegate.animation.finished.connect(self.animation_done)
     self.setItemDelegate(self.delegate)
     self.setSpacing(self.delegate.spacing)
     self.padding_left = 0
     self.set_color()
     self.ignore_render_requests = Event()
     self.thumbnail_cache = ThumbnailCache(max_size=gprefs['cover_grid_disk_cache_size'],
         thumbnail_size=(self.delegate.cover_size.width(), self.delegate.cover_size.height()))
     self.render_thread = None
     self.update_item.connect(self.re_render, type=Qt.QueuedConnection)
     self.doubleClicked.connect(self.double_clicked)
     self.setCursor(Qt.PointingHandCursor)
     self.gui = parent
     self.context_menu = None
     self.update_timer = QTimer(self)
     self.update_timer.setInterval(200)
     self.update_timer.timeout.connect(self.update_viewport)
     self.update_timer.setSingleShot(True)
开发者ID:shamray,项目名称:calibre,代码行数:34,代码来源:alternate_views.py

示例2: __init__

# 需要导入模块: from PyQt4.Qt import QListView [as 别名]
# 或者: from PyQt4.Qt.QListView import __init__ [as 别名]
 def __init__(self, completer_widget, max_visible_items=7):
     QListView.__init__(self)
     self.completer_widget = weakref.ref(completer_widget)
     self.setWindowFlags(Qt.Popup)
     self.max_visible_items = max_visible_items
     self.setEditTriggers(self.NoEditTriggers)
     self.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
     self.setSelectionBehavior(self.SelectRows)
     self.setSelectionMode(self.SingleSelection)
     self.setAlternatingRowColors(True)
     self.setModel(CompleteModel(self))
     self.setMouseTracking(True)
     self.entered.connect(self.item_entered)
     self.activated.connect(self.item_chosen)
     self.pressed.connect(self.item_chosen)
     self.installEventFilter(self)
开发者ID:089git,项目名称:calibre,代码行数:18,代码来源:complete2.py

示例3: __init__

# 需要导入模块: from PyQt4.Qt import QListView [as 别名]
# 或者: from PyQt4.Qt.QListView import __init__ [as 别名]
 def __init__(self, parent=None):
     self.last_mouse_idx = -1
     QListView.__init__(self, parent)
     self._model = CharModel(self)
     self.setModel(self._model)
     self.delegate = CharDelegate(self)
     self.setItemDelegate(self.delegate)
     self.setFlow(self.LeftToRight)
     self.setWrapping(True)
     self.setMouseTracking(True)
     self.setSpacing(2)
     self.setUniformItemSizes(True)
     self.setContextMenuPolicy(Qt.CustomContextMenu)
     self.customContextMenuRequested.connect(self.context_menu)
     self.showing_favorites = False
     pi = plugins['progress_indicator'][0]
     if hasattr(pi, 'set_no_activate_on_click'):
         pi.set_no_activate_on_click(self)
     self.activated.connect(self.item_activated)
     self.clicked.connect(self.item_activated)
开发者ID:mapopescu,项目名称:calibre,代码行数:22,代码来源:char_select.py

示例4: __init__

# 需要导入模块: from PyQt4.Qt import QListView [as 别名]
# 或者: from PyQt4.Qt.QListView import __init__ [as 别名]
 def __init__(self, parent):
     QListView.__init__(self, parent)
     self.setSelectionMode(self.SingleSelection)
     self.setAlternatingRowColors(True)
     self.d = FontFamilyDelegate(self)
     self.setItemDelegate(self.d)
开发者ID:BobPyron,项目名称:calibre,代码行数:8,代码来源:font_family_chooser.py


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