def set_text(self, label):
    metrics = QtGui.QFontMetrics(self.label.font())
    elided = metrics.elidedText(label, QtCore.Qt.ElideMiddle, self.label.width())
    self.label.setText(elided)
    self.setToolTip(label)
def set_text(self, label):
    metrics = QtGui.QFontMetrics(self.label.font())
    elided = metrics.elidedText(label, QtCore.Qt.ElideMiddle, self.label.width())
    self.label.setText(elided)
    self.setToolTip(label)