In QGIS 3.36 we've introduced a measuredLine method within Qgs(Multi)LineString. This method builds upon the code from PostGIS behind ST_AddMeasure.
measuredLine
Qgs(Multi)LineString
This feature was developed by Loïc Bartoletti
Image Preview
Click the image to open original size image in new tab