def __init__(self, parent, node): # 1001 is nodeListItem type self.node = node self.display_text = "%s:%s:v%s" % (node["id"], node["ip"], node["version"]) #super(QListWidgetItem, self).__init__(self.display_text, parent, 1001) QListWidgetItem.__init__(self, self.display_text, parent, 1001)
def __init__(self, name, ischecked=False, enabled=True): QListWidgetItem.__init__(self) self.setText(name) self.setFlags(self.flags() | Qt.ItemIsUserCheckable) if ischecked: self.setCheckState(Qt.Checked) else: self.setCheckState(Qt.Unchecked) if not enabled: self.setFlags(Qt.ItemIsUserCheckable)
def __init__(self, motors={}, name=""): QListWidgetItem.__init__(self) # QListWidgetItem method for setting the text of the item self.setText(name) ## A list of moves self.__moves = [] ## The name of the sequence self.__name = name ## A dictionary of all the motors self.__motors = motors
def __init__(self, move=None, text=None, motors={}, parent=None): """ Initialization of the move label :param move: The move :param text: The text in the label :param motors: Dictionary of all the motors :param parent: The Qt parent """ QListWidgetItem.__init__(self, parent) ## The move for the label self.__move = move ## The dictionary of all the motors self.__motors = motors self.setText(text)
def __init__(self, listview, first, second, third, icon): """ :param listview: The parent ListView. :param first: The first line of text. :param second: The second line of text. :param third: The third line of text. :param icon: The full path to the icon. """ QListWidgetItem.__init__(self, listview, type=QListWidgetItem.UserType) self.widget = QWidget() # Vertical box (texts) self.vbox = QVBoxLayout() self.first_line = QLabel(first) self.first_line.setWordWrap(True) self.second_line = QLabel(second) self.second_line.setWordWrap(True) self.third_line = QLabel(third) self.third_line.setWordWrap(True) for widget in [self.first_line, self.second_line, self.third_line]: self.vbox.addWidget(widget) # Horizontal box (icon + vertical box) self.hbox = QHBoxLayout() self.icon = QLabel() pixmap = QPixmap(icon) if not pixmap.isNull(): pixmap = pixmap.scaled(CustomItem.icon_size) self.icon.setPixmap(pixmap) self.hbox.addWidget(self.icon, 0) self.hbox.addLayout(self.vbox, 1) self.widget.setLayout(self.hbox) # Set the widget as the content of the list item self.setSizeHint(self.widget.sizeHint()) listview.setItemWidget(self, self.widget) self.first_line.setStyleSheet('''font-weight: bold;''') # self.comment.setStyleSheet('''''') self.third_line.setStyleSheet('''font-style: italic;''')
def __init__(self): QListWidgetItem.__init__(self)
def __init__(self, text="", data=None): QListWidgetItem.__init__(self, text=text) self.setText(text) self.d = data
def __init__(self, new_segment_obj): QListWidgetItem.__init__(self) self.segment_obj = None self.set_segment(new_segment_obj)