本文整理汇总了Python中PyQt4.QtGui.QListView.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python QListView.__init__方法的具体用法?Python QListView.__init__怎么用?Python QListView.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtGui.QListView
的用法示例。
在下文中一共展示了QListView.__init__方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PyQt4.QtGui import QListView [as 别名]
# 或者: from PyQt4.QtGui.QListView import __init__ [as 别名]
def __init__(self, qpart, model):
QListView.__init__(self, qpart.viewport())
self.setAttribute(Qt.WA_DeleteOnClose)
self.setItemDelegate(HTMLDelegate(self))
self._qpart = qpart
self.setFont(qpart.font())
self.setCursor(QCursor(Qt.PointingHandCursor))
self.setFocusPolicy(Qt.NoFocus)
self.setModel(model)
self._selectedIndex = -1
# if cursor moved, we shall close widget, if its position (and model) hasn't been updated
self._closeIfNotUpdatedTimer = QTimer(self)
self._closeIfNotUpdatedTimer.setInterval(200)
self._closeIfNotUpdatedTimer.setSingleShot(True)
self._closeIfNotUpdatedTimer.timeout.connect(self._afterCursorPositionChanged)
qpart.installEventFilter(self)
qpart.cursorPositionChanged.connect(self._onCursorPositionChanged)
self.clicked.connect(lambda index: self.itemSelected.emit(index.row()))
self.updateGeometry()
self.show()
qpart.setFocus()
示例2: __init__
# 需要导入模块: from PyQt4.QtGui import QListView [as 别名]
# 或者: from PyQt4.QtGui.QListView import __init__ [as 别名]
def __init__(self, parent = None, model=None):
QListView.__init__(self, parent)
if model is None:
model = LayerStackModel()
self.init(model)
示例3: __init__
# 需要导入模块: from PyQt4.QtGui import QListView [as 别名]
# 或者: from PyQt4.QtGui.QListView import __init__ [as 别名]
def __init__(self,parent=None,dataModel = None):
QListView.__init__(self, parent)
self._dataModel = dataModel
self._selectedDisplayMapping = OrderedDict()
self._modelDisplayMapping = OrderedDict()
self._attrModel = QStandardItemModel(self)
示例4: __init__
# 需要导入模块: from PyQt4.QtGui import QListView [as 别名]
# 或者: from PyQt4.QtGui.QListView import __init__ [as 别名]
def __init__(self, game, parent=None):
QListView.__init__(self, parent)
self.game = None
self.setWindowTitle(m18n('Explain Scores').replace('&', '') + ' - Kajongg')
self.setGeometry(0, 0, 300, 400)
self.model = QStringListModel()
self.setModel(self.model)
StateSaver(self)
self.refresh(game)
示例5: __init__
# 需要导入模块: from PyQt4.QtGui import QListView [as 别名]
# 或者: from PyQt4.QtGui.QListView import __init__ [as 别名]
def __init__(self, curve_source):
QListView.__init__(self)
self.curve_source = curve_source
self.setViewMode(QListView.IconMode)
self.setIconSize(QSize(64,64))
self.model = QStandardItemModel()
for curve in curve_source._curves:
self.add_curve(curve)
self.setModel(self.model)
self.setWrapping(True)
self.show()
示例6: __init__
# 需要导入模块: from PyQt4.QtGui import QListView [as 别名]
# 或者: from PyQt4.QtGui.QListView import __init__ [as 别名]
def __init__(self, parent):
'''
@param parent - QMainWindow
'''
QListView.__init__(self, parent)
self.parentWindow = parent
self.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
self.setSelectionBehavior(QAbstractItemView.SelectItems)
self.viewport().installEventFilter(self)
示例7: __init__
# 需要导入模块: from PyQt4.QtGui import QListView [as 别名]
# 或者: from PyQt4.QtGui.QListView import __init__ [as 别名]
def __init__(self, *args):
QListView.__init__(self, *args)
self.setModel(
AppListModel(
[WebApp.get_local_apps_dir(), utils.libFile('.')],
self))
self.setIconSize(QtCore.QSize(kIconSize, kIconSize))
self.downloadErrShown = False
# To be set through functions
self.win = None
示例8: __init__
# 需要导入模块: from PyQt4.QtGui import QListView [as 别名]
# 或者: from PyQt4.QtGui.QListView import __init__ [as 别名]
def __init__(self, parent=None, model=None):
"""
This method initializes the class.
:param parent: Object parent. ( QObject )
"""
LOGGER.debug("> Initializing '{0}()' class.".format(self.__class__.__name__))
QListView.__init__(self, parent)
# --- Setting class attributes. ---
self.setModel(model)
示例9: __init__
# 需要导入模块: from PyQt4.QtGui import QListView [as 别名]
# 或者: from PyQt4.QtGui.QListView import __init__ [as 别名]
def __init__(self, base_maps_list, parent=None, thumb_size=64):
QListView.__init__(self, parent)
self._model = BaseMapsModel(base_maps_list, parent)
self.setModel(self._model)
self.setEditTriggers(QListView.NoEditTriggers)
self.setViewMode(QListView.IconMode)
self.setMovement(QListView.Static)
self.setResizeMode(QListView.Adjust)
#self.setFlow(QListView.TopToBottom)
#self.setWrapping(True)
#self.setSpacing(0)
self.set_thumb_size(thumb_size)
示例10: __init__
# 需要导入模块: from PyQt4.QtGui import QListView [as 别名]
# 或者: from PyQt4.QtGui.QListView import __init__ [as 别名]
def __init__(self, *args, **kwargs):
QListView.__init__(self, *args, **kwargs)
self.setViewMode(QListView.IconMode)
self.setWrapping(False)
self.setWordWrap(True)
self.setSelectionMode(QListView.SingleSelection)
self.setEditTriggers(QListView.NoEditTriggers)
self.setMovement(QListView.Static)
self.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
self.setIconSize(QSize(120, 80))
示例11: __init__
# 需要导入模块: from PyQt4.QtGui import QListView [as 别名]
# 或者: from PyQt4.QtGui.QListView import __init__ [as 别名]
def __init__( self, completer ):
QListView.__init__( self, completer.parent() )
self.__completer = completer
self.setAlternatingRowColors( True )
self.setSelectionMode( QAbstractItemView.SingleSelection )
self.setSelectionBehavior( QAbstractItemView.SelectRows )
self.setHorizontalScrollBarPolicy( Qt.ScrollBarAlwaysOff )
shiftTabAct = QAction( self )
shiftTabAct.setShortcut( 'Shift+Tab' )
shiftTabAct.triggered.connect( self.__completer.moveToPrevious )
self.addAction( shiftTabAct )
ctrlSpaceAct = QAction( self )
ctrlSpaceAct.setShortcut( 'Ctrl+ ' )
ctrlSpaceAct.triggered.connect( self.__completer.moveToNext )
self.addAction( ctrlSpaceAct )
return
示例12: __init__
# 需要导入模块: from PyQt4.QtGui import QListView [as 别名]
# 或者: from PyQt4.QtGui.QListView import __init__ [as 别名]
def __init__(self, parent=None):
QListView.__init__(self, parent)
self.setModel(MouseDevicesModel(self))
self.model().checkedDevicesChanged.connect(self.checkedDevicesChanged)
示例13: __init__
# 需要导入模块: from PyQt4.QtGui import QListView [as 别名]
# 或者: from PyQt4.QtGui.QListView import __init__ [as 别名]
def __init__(self, parent = None):
QListView.__init__(self, parent)
self.setEditTriggers(QAbstractItemView.SelectedClicked)
示例14: __init__
# 需要导入模块: from PyQt4.QtGui import QListView [as 别名]
# 或者: from PyQt4.QtGui.QListView import __init__ [as 别名]
def __init__(self, parent):
QListView.__init__(self, parent)
self.setAlternatingRowColors(True)
self.setEditTriggers(QAbstractItemView.NoEditTriggers)
self.setSelectionMode(QAbstractItemView.ExtendedSelection)