How to display cutoff label with continuing dots?
I have a label that can't be bigger than fixed size. Therefore some strings are cutoff and some aren't. Is there a way to test if the text exceeds the size of the label? And then to draw "..." at the end of the string?
Code:
QString numberStr
= "1.234556776544";
label->setToolTip(numberStr);
label->setTextInteractionFlags(Qt::TextSelectableByMouse);
label->setFixedWidth(66);
l->addWidget(label);
Thanks!
Re: How to display cutoff label with continuing dots?
Try to use the QFontMetrics class.