QTextLine is for representing a line of text, not a graphical object. You can insert a frame, a table or an image with a horizontal line using QTextCursor API.