Hello. How to calculate the width of column to display data without ellipsis?

I noticed if I try something like this:
Qt Code:
  1. ui.treeView->header()->resizeSection(DOWNLOADS_COL_SPEED, QFontMetrics(ui.treeView->font()).width(tr("881.20 Kb/s")));
To copy to clipboard, switch view to plain text mode 

Exactly the same value (I mean 881.20 Kb/s) may be displayed with ellipsis for some users. What is my mistake?

Also I noticed that columns with ResizeMode = QHeaderView::ResizeToContents not always change its width correctly.