I was looking for a way to update the length value automatically with signals and slots (rather than just checking every time the viewer time changes). This should do the trick.