View Full Version : highlight an entire line in QLineEdit

26th July 2014, 21:58
Is there any good way to highlight several, non consecutive lines in a QLineEdit so that they do not depend on the textcursor?

For example, if i have a textlineedit i want to highlight the background of line 1,4 and 8, and this should not be affected by the user moving the cursor around.

if this is not possible conventionally, where do you suggest i hook in to do it manually with a QPainter?

Added after 21 minutes:

i find solution with: setProperty(QTextFormat::FullWidthSelection, true) ! :)