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


Python QListView.__init__方法代码示例

本文整理汇总了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()
开发者ID:kcrossen,项目名称:qutepart,代码行数:36,代码来源:completer.py

示例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)
开发者ID:DerThorsten,项目名称:volumina,代码行数:9,代码来源:layerwidget.py

示例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)
开发者ID:Guillon88,项目名称:stdm,代码行数:9,代码来源:model_attributes_view.py

示例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)
开发者ID:ospalh,项目名称:kajongg-fork,代码行数:11,代码来源:scoring.py

示例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()
开发者ID:nathanial,项目名称:curveeditor,代码行数:13,代码来源:icons.py

示例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)
开发者ID:shinghei,项目名称:MaeMoney,代码行数:13,代码来源:PortfolioListView.py

示例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
开发者ID:cxcxcxcx,项目名称:w-app,代码行数:14,代码来源:applistview.py

示例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)
开发者ID:elanifegnirf,项目名称:Snippets,代码行数:15,代码来源:views.py

示例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)
开发者ID:yellow-sky,项目名称:pyqt_basemap_selector,代码行数:15,代码来源:vlist_basemap_selector.py

示例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))
开发者ID:Zekom,项目名称:orange3,代码行数:16,代码来源:previewbrowser.py

示例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
开发者ID:eaglexmw,项目名称:codimension,代码行数:21,代码来源:completer.py

示例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)
开发者ID:adaptee,项目名称:synaptiks,代码行数:6,代码来源:views.py

示例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)
开发者ID:khertan,项目名称:khtsync,代码行数:5,代码来源:khtsync_gui.py

示例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)
开发者ID:wioota,项目名称:ftools-qgis,代码行数:7,代码来源:widgets.py


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