本文整理汇总了Python中kdeui.KListViewItem类的典型用法代码示例。如果您正苦于以下问题:Python KListViewItem类的具体用法?Python KListViewItem怎么用?Python KListViewItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了KListViewItem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: refreshlistView
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
def refreshlistView(self):
self.listView.clear()
clients = KListViewItem(self.listView, 'clients')
rows = self.db.mcursor.select(fields=['clientid', 'client'], table='clients')
for row in rows:
c = KListViewItem(clients, row['client'])
c.clientid = row.clientid
示例3: refreshListView
def refreshListView(self):
self.listView.clear()
cursor = self.app.conn.stmtcursor()
rows = self.app.guests.get_guest_rows()
for row in rows:
name = '%s %s' % (row.firstname, row.lastname)
item = KListViewItem(self.listView, name)
item.guestid = row['guestid']
示例4: initlistView
def initlistView(self):
self.listView.addColumn('client')
self.listView.setRootIsDecorated(True)
clients = KListViewItem(self.listView, 'clients')
rows = self.db.mcursor.select(fields=['clientid', 'client'], table='clients')
for row in rows:
c = KListViewItem(clients, row['client'])
c.clientid = row.clientid
示例5: refreshListView
def refreshListView(self):
trait_folder = KListViewItem(self.listView, 'traits')
for trait in self.trait.get_trait_list():
item = KListViewItem(trait_folder, trait)
item.trait = trait
for widget in ['trait', 'template', 'environ', 'scripts']:
w = KListViewItem(item, widget)
w.trait = item.trait
w.widget = widget
示例6: refreshlistView
def refreshlistView(self):
self.listView.clear()
all = KListViewItem(self.listView, 'all')
client = KListViewItem(self.listView, 'client')
rows = self.db.select(fields=['clientid', 'client'], table='clients')
for row in rows:
c = KListViewItem(client, row.client)
c.clientid = row.clientid
unassigned = KListViewItem(self.listView, 'unassigned')
示例7: selectionChanged
def selectionChanged(self):
item = self.etypeView.currentItem()
etype = item.etype
self.current_etype = etype
fields = self.app.db.get_etype_extra_fields(etype)
self.extfieldsView.clear()
for field in fields:
item = KListViewItem(self.extfieldsView, *field)
item.fieldname = field[0]
示例8: __init__
def __init__(self, parent, name='ProfileSelectorDialog'):
BaseDialogWindow.__init__(self, parent, name=name)
self.dbox = self.app.make_new_dosbox_object()
profiles = self.dbox.get_profile_list()
self.listView = KListView(self)
self.listView.addColumn('profile')
self.setMainWidget(self.listView)
for profile in profiles:
item = KListViewItem(self.listView, profile)
item.profile = profile
示例9: refreshListView
def refreshListView(self):
self.listView.clear()
gameids = self.handler.get_all_html_ids()
print 'in initlistView', gameids
for gameid in gameids:
#item = KListViewItem(self.listView, str(gameid))
#item.gameid = gameid
self.handler.get_game_data(gameid)
item = KListViewItem(self.listView, self.handler.parser.title)
item.gameid = gameid
示例10: initlistView
def initlistView(self):
self.listView.addColumn('group')
self.listView.setRootIsDecorated(True)
all = KListViewItem(self.listView, 'all')
groups = [KListViewItem(self.listView, g) for g in self.groupfields]
for g, parent in zip(self.groupfields, groups):
fields = ['distinct %s' % g]
rows = self.db.mcursor.select(fields=fields, table=self.table, order=g)
for row in rows:
item = KListViewItem(parent, row[g])
item.groupfield = g
示例11: refreshlistView
def refreshlistView(self):
self.listView.clear()
rows = self.manager.get_users()
print rows
print 'helo;'
users = KListViewItem(self.listView, 'user')
groups = KListViewItem(self.listView, 'group')
for row in rows:
c = KListViewItem(users, row.usename)
c.userid = row.usesysid
for row in self.manager.get_groups():
c = KListViewItem(groups, row.group)
c.grosysid = row.grosysid
示例12: refreshListView
def refreshListView(self):
self.listView.clear()
#cursor = self.app.conn.stmtcursor()
#rows = self.app.db.get_entities()
#for row in rows:
# item = KListViewItem(self.listView, row['name'])
# item.entityid = row['entityid']
entities = self.app.db.get_entities()
for entity in entities:
item = KListViewItem(self.listView, entity.name)
# we don't need the id anymore
item.entityid = entity.entityid
# since we can hold the whole object
# which will talk to the db as needed
item.entity = entity
示例13: refreshlistView
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
示例14: refreshlistView
def refreshlistView(self):
self.listView.clear()
all = KListViewItem(self.listView, 'all')
status = KListViewItem(self.listView, 'status')
rows = self.db.select(table='trouble_status')
for row in rows:
s = KListViewItem(status, row.status)
s.status = row.status
client = KListViewItem(self.listView, 'client')
sel = self.db.stmt.select(fields=['clientid'], table='troubles',
clause=Neq('status', 'done'))
clause = In('clientid', sel)
rows = self.db.select(fields=['clientid', 'client'], table='clients',
clause=clause)
for row in rows:
c = KListViewItem(client, row.client)
c.clientid = row.clientid
magnet = KListViewItem(self.listView, 'magnet')
for m in self.manager.getUsedMagnets():
item = KListViewItem(magnet, m)
item.magnet = m
untouched = KListViewItem(self.listView, 'untouched')
statreport = KListViewItem(self.listView, 'status report')
示例15: refreshListView
def refreshListView(self):
self.listView.clear()
for suite in self.suitecursor.get_suites():
item = KListViewItem(self.listView, suite)
item.suite = suite