To create a new polyline in QGIS:
Layer > New shapefile layer
line as geometry and set the name for the layer, e.g.
test. At this point, you can assign attributes to the line. We'll create only one attribute as an example (line's name), and it will be
Now, click on the pencil icon at first and on the line icon afterwards:
When you finish to draw, do a right-click, and you'll be able to configure the line attributes.
To edit a line, click on the pencil first and on the edit icon afterwards:
Now you can select the point that you want to edit. If you click on the
+, you'll be able to extend the line: