标签:def ext width strong ide span bsp else too
void CommonHelper::setQLabelText(QLabel *label, const QString &text) { QFontMetrics cs(label->font()); int textWidth = cs.width(text); if(textWidth > label->width()) { label->setToolTip(text); } else { label->setToolTip(""); } QFontMetrics elideFont(label->font()); label->setText(elideFont.elidedText(text, Qt::ElideRight, label->width())); }
标签:def ext width strong ide span bsp else too
原文地址:http://www.cnblogs.com/amwuau/p/8011209.html