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


Python QListView.setHorizontalScrollMode方法代码示例

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


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

示例1: __init__

# 需要导入模块: from PyQt4.QtGui import QListView [as 别名]
# 或者: from PyQt4.QtGui.QListView import setHorizontalScrollMode [as 别名]
 def __init__(self, model, enlargeFunction, parent):
     QWidget.__init__(self, parent)
     
     def enlarge(index):
         enlargeFunction(model.list[index.row()])
     
     windowSize = self.window().frameSize()
     self.resize(QSize(windowSize.width()-(25+utilities.bigCardSize[0]),275))
     
     lvViewer = QListView(self)
     lvViewer.setModel(model)
     lvViewer.setDragEnabled(True)
     lvViewer.setHorizontalScrollMode(QAbstractItemView.ScrollPerPixel)
     lvViewer.setFlow(QListView.LeftToRight)
     lvViewer.setFocus()
     self.connect(lvViewer, SIGNAL('clicked(QModelIndex)'), enlarge)
     
     button = QPushButton("Close", self)
     self.connect(button,SIGNAL('clicked()'),self.hide)
     
     layout = QVBoxLayout(self)
     layout.addWidget(QLabel("I'm sorry this is so ugly.",self))
     layout.addWidget(lvViewer)
     layout.addWidget(button)
     self.setLayout(layout)
     
     self.show()
开发者ID:mplamann,项目名称:PTG,代码行数:29,代码来源:QCardListViewer.py

示例2: displayExile

# 需要导入模块: from PyQt4.QtGui import QListView [as 别名]
# 或者: from PyQt4.QtGui.QListView import setHorizontalScrollMode [as 别名]
 def displayExile(self):
     from PyQt4.QtGui import QListView, QAbstractItemView, QPushButton, QVBoxLayout, QLabel
     from PyQt4.QtCore import QSize
     from util import utilities
     windowSize = self.window().frameSize()
     self.viewer = QWidget(self.window())
     self.viewer.move(10,10)
     self.viewer.resize(QSize(windowSize.width()-(25+utilities.bigCardSize[0]),275))
     
     lvViewer = QListView(self.viewer)
     lvViewer.setModel(self.model)
     lvViewer.setDragEnabled(True)
     lvViewer.setHorizontalScrollMode(QAbstractItemView.ScrollPerPixel)
     lvViewer.setFlow(QListView.LeftToRight)
     lvViewer.setFocus()
     self.connect(lvViewer, SIGNAL('clicked(QModelIndex)'), self.enlarge)
     
     button = QPushButton("Close", self.viewer)
     self.connect(button,SIGNAL('clicked()'),self.hideViewer)
     
     layout = QVBoxLayout(self)
     layout.addWidget(QLabel("I'm sorry this is so ugly.",self.viewer))
     layout.addWidget(lvViewer)
     layout.addWidget(button)
     self.viewer.setLayout(layout)
     
     self.viewer.show()
开发者ID:mplamann,项目名称:PTG,代码行数:29,代码来源:QPlayer.py


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