This could be simplified into:
```
menu->addAction(QString("Summed linear distance: %1").arg(distance));
```
See http://qt-project.org/doc/qt-4.8/qstring.html#arg