'Set the text labels.'

def set_labels(self, labels):

    self.clear()
    orientation = (Qt.Horizontal if (self.orientation == Qt.Vertical) else Qt.Vertical)
    for text in labels:
        item = QGraphicsSimpleTextItem(text, self)
        item.setFont(self.font())
        item.setToolTip(text)
        witem = WrapperLayoutItem(item, orientation, parent=self)
        self.layout().addItem(witem)
        self.layout().setAlignment(witem, self.alignment)
        self.label_items.append(item)
    self.layout().activate()
    self.updateGeometry()
