本文整理汇总了Python中PyQt4.QtCore.QStringList.count方法的典型用法代码示例。如果您正苦于以下问题:Python QStringList.count方法的具体用法?Python QStringList.count怎么用?Python QStringList.count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtCore.QStringList
的用法示例。
在下文中一共展示了QStringList.count方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _create_control
# 需要导入模块: from PyQt4.QtCore import QStringList [as 别名]
# 或者: from PyQt4.QtCore.QStringList import count [as 别名]
def _create_control ( self, parent ):
# If the caller provided a default path instead of a default directory
# and filename, split the path into it directory and filename
# components.
if ((len( self.default_path ) != 0) and
(len( self.default_directory ) == 0) and
(len( self.default_filename ) == 0)):
default_directory, default_filename = \
os.path.split( self.default_path )
else:
default_directory = self.default_directory
default_filename = self.default_filename
# Convert the filter:
keep = True
filters = QStringList()
for f in self.wildcard.split( '|' ):
if keep and f:
filters << f
keep = not keep
# Set the default directory:
if not default_directory:
default_directory = QDir.currentPath()
dlg = QFileDialog( parent, self.title, default_directory )
dlg.setViewMode( QFileDialog.Detail )
dlg.selectFile( default_filename )
dlg.setFilters( filters )
if self.wildcard_index < filters.count():
dlg.selectFilter( filters[ self.wildcard_index ] )
if self.action == 'open':
dlg.setAcceptMode( QFileDialog.AcceptOpen )
dlg.setFileMode( QFileDialog.ExistingFile )
elif self.action == 'open files':
dlg.setAcceptMode( QFileDialog.AcceptOpen )
dlg.setFileMode( QFileDialog.ExistingFiles )
else:
dlg.setAcceptMode( QFileDialog.AcceptSave )
dlg.setFileMode( QFileDialog.AnyFile )
return dlg
示例2: _initModel
# 需要导入模块: from PyQt4.QtCore import QStringList [as 别名]
# 或者: from PyQt4.QtCore.QStringList import count [as 别名]
def _initModel(self):
from PyQt4.QtCore import QStringList
self._reposModel.clear()
stringList = QStringList([u"Active", u"Path", u"Auto Update", u"Status"])
self._reposModel.setColumnCount(stringList.count())
self._reposModel.setHorizontalHeaderLabels(stringList)