void updateData(const QString& text, int width)
{
QString string = text;
QFontMetrics font(this->font());
int font_size = font.width(string);
int resize_width(width);
if(font_size > resize_width)
{
string = font.elidedText(text_, Qt::ElideRight, width);//返回一个带有省略号的字符串
}
QLabel::setText(string);
}