本文整理汇总了Python中kdeui.KListViewItem.row方法的典型用法代码示例。如果您正苦于以下问题:Python KListViewItem.row方法的具体用法?Python KListViewItem.row怎么用?Python KListViewItem.row使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kdeui.KListViewItem
的用法示例。
在下文中一共展示了KListViewItem.row方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: refreshlistView
# 需要导入模块: from kdeui import KListViewItem [as 别名]
# 或者: from kdeui.KListViewItem import row [as 别名]
def refreshlistView(self):
self.clear()
self.setColumnText(1, self.file_type)
if self.trait is None:
traits = self.traits.list()
else:
traits = [self.trait]
for trait in traits:
item = KListViewItem(self, trait)
item.trait = trait
# expand tree by default
item.setOpen(True)
if self.file_type == 'template':
for row in self.templates.templates(trait):
template_item = KListViewItem(item, str(row.templatefile),
row.template)
template_item.trait = trait
template_item.row = row
elif self.file_type == 'script':
# perhaps we need to make a method to obtain scriptnames
# in TraitScript object
for row in self.scripts.cmd.select(clause=Eq('trait', trait), order='script'):
script_item = KListViewItem(item, str(row.scriptfile), row.script)
script_item.trait = trait
script_item.row = row
else:
raise ValueError, "unknown file_type %s" % self.file_type
示例2: refreshlistView
# 需要导入模块: from kdeui import KListViewItem [as 别名]
# 或者: from kdeui.KListViewItem import row [as 别名]
def refreshlistView(self):
self.clear()
if self.ftype == 'template':
self.setColumnText(1, 'template')
elif self.ftype == 'script':
self.setColumnText(1, 'script')
for trait in self.traits.list():
item = KListViewItem(self, trait)
item.trait = trait
if self.ftype == 'template':
for row in self.templates.templates(trait):
titem = KListViewItem(item, str(row.templatefile), row.template, row.package)
titem.trait = trait
titem.row = row
elif self.ftype == 'script':
for row in self.scripts.cmd.select(clause=Eq('trait', trait), order='script'):
sitem = KListViewItem(item, str(row.scriptfile), row.script)
sitem.trait = trait
sitem.row = row