This is a very broad question, so I won't go into details on every step. Instead, I summarized the basic process you would want to follow, along with proper terminology to help you locate instructions elsewhere.
Step One: Find a route between two known points
This process is called routing. Here's an excellent blog post by Anita Graser summarizing the ...
Other than with expressions, you can use the line-width-assistant - it's probably easier because you don't need expressions (but you can, if you want, see below).
Select the assistent, select the source ( field that contains the values/width-information in your attribute table), than update values (that automatically selects min./max. values - otherwise ...
I think using the "Meters at scale" unit type in the size section of the label properties should let you achieve what you're after. This setting automaticaly adjust the label size as you zoom in and out.
You'll have to first set the "meters at scale" unit then play with the size value till your label are the same length of your line (if you need to set ...
Suppose that I want to divide line layer of following image in 5 equal segments.
In attributes table, it was calculated with geometry options of field calculator, total line length and each equal segment length (5 in total).
Afterward, I opened v.split tool and filled following options:
After click in Run, I got Split by length layer where it can be ...
You want the length to be displayed along your line and auto-update as you draw or edit the line? In this case, simply label your line with the expression length($geometry)
For the attribute table, use Creating a Virtual Field - when you create a new field with the field-calculator, select virtual field and set the expression you like - e.g. length($...
Just ST_MakeLine the the initial and the closest point:
FROM pois_1600 AS a
CROSS JOIN LATERAL (
ST_MakeLine(a.geom, b.geom) AS line_geom,
a.geom <-> b.geom AS dist
FROM intersections AS b