Hi,
Solved by compass and straight-edge.
First draw an auxiliary circle with an 8 cm
(See lower) radius centered at point A:
- Activate Circle tool 'Center Radius' (CR).
In the Option Toolbar: Radius = 8; Angle = 0 (Doesn't matter); Reference Point = Middle.
Place the Circle with its center on point A.
Let the cursor snap to the rightmost endpoint of the horizontal segment.
Followed by a right click = 'Cancel tool' when done.
The Circle is the locus of all points at a distance of 8 drawing units from point A.
This Circle may not cross Line B, touch Line B at a single point or intersect with Line B at 2 points.
With intersections, one of the intersections is the required endpoint of a line 8 drawing units long starting in A.
Then draw the required line segment:
- Activate Line tool 'Line form 2 points' (LI).
In the Option Toolbar: Line Segment (Not an Infinite Line or a Ray); Length = cleared; Angle = cleared and both values don't matter.
Indicate the start point A.
Let the cursor snap to the rightmost endpoint of the horizontal segment.
Indicate an intersection of the auxiliary circle and Line B.
Let the cursor snap to the intersection.
Followed by a right click = 'Done adding segments' and a second right click = 'Cancel tool' when done.
Select and delete the auxiliary circle afterwards.
Remind that CAD values are typically unit-less.
8 cm is a radius of 8 drawing units long on a drawing in centimeters.
8 cm is a radius of 80 drawing units long on a drawing in millimeters.
And so on.
If you select only the newly created line segment, it should be 8, 80, ... drawing units long.

See Property Editor when selected.
Please include your QCAD version in newer topics.
The Option Toolbar for
LI has changed over time.
Regards,
CVH