本文整理汇总了Python中PyQt4.Qt.QListWidgetItem.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python QListWidgetItem.__init__方法的具体用法?Python QListWidgetItem.__init__怎么用?Python QListWidgetItem.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.Qt.QListWidgetItem
的用法示例。
在下文中一共展示了QListWidgetItem.__init__方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PyQt4.Qt import QListWidgetItem [as 别名]
# 或者: from PyQt4.Qt.QListWidgetItem import __init__ [as 别名]
def __init__(self, pathname, parent=None, watching=Purr.WATCHED):
self._pathname = pathname
pathname = Kittens.utils.collapseuser(pathname)
self._in_setWatching = True
QListWidgetItem.__init__(self, pathname, parent)
self.setFlags(Qt.ItemIsSelectable | Qt.ItemIsUserCheckable | Qt.ItemIsEnabled | Qt.ItemIsTristate)
self.setWatching(watching)
示例2: __init__
# 需要导入模块: from PyQt4.Qt import QListWidgetItem [as 别名]
# 或者: from PyQt4.Qt.QListWidgetItem import __init__ [as 别名]
def __init__(self, parent, user):
if user.username == "root":
icon = "root"
name = _("Super User")
else:
name = user.username
icon = "normal"
label = "%s (%s)" % (name, user.realname)
QListWidgetItem.__init__(self, QIcon(":/gui/pics/user_%s.png" % icon), label, parent)
self.user = user
示例3: __init__
# 需要导入模块: from PyQt4.Qt import QListWidgetItem [as 别名]
# 或者: from PyQt4.Qt.QListWidgetItem import __init__ [as 别名]
def __init__(self, text, user_data=None):
QListWidgetItem.__init__(self, text)
self.user_data = user_data
示例4: __init__
# 需要导入模块: from PyQt4.Qt import QListWidgetItem [as 别名]
# 或者: from PyQt4.Qt.QListWidgetItem import __init__ [as 别名]
def __init__(self, parent, widget):
QListWidgetItem.__init__(self, parent)
self.widget = widget
self.setSizeHint(QSize(widget.width()-20, widget.height()))
示例5: __init__
# 需要导入模块: from PyQt4.Qt import QListWidgetItem [as 别名]
# 或者: from PyQt4.Qt.QListWidgetItem import __init__ [as 别名]
def __init__(self, parent, device, release):
label = "%s on %s" % (release, device.path)
QListWidgetItem.__init__(self, QIcon(":/gui/pics/parduspart.png"), label, parent)
self.device = device
self.release = release
示例6: __init__
# 需要导入模块: from PyQt4.Qt import QListWidgetItem [as 别名]
# 或者: from PyQt4.Qt.QListWidgetItem import __init__ [as 别名]
def __init__(self, parent, connection, package):
QListWidgetItem.__init__(self, QIcon(":/gui/pics/%s.png" % package), connection, parent)
self._connection = [connection, package]
示例7: __init__
# 需要导入模块: from PyQt4.Qt import QListWidgetItem [as 别名]
# 或者: from PyQt4.Qt.QListWidgetItem import __init__ [as 别名]
def __init__(self, parent, pixmap, user):
icon = QIcon(pixmap)
QListWidgetItem.__init__(self, icon, QString(user.username), parent)
self._user = user