PDA

View Full Version : QPlainTextEdit - hanging indents



Acamapichtli
15th May 2014, 19:28
How can I create hanging indents in QPlainTextEdit?

The normal lines looks like this:

- Lorem ipsum dolor sit amet, consectetur adipiscing
elit. Aliquam ultrices lobortis tortor at dapibus
- Donec faucibus risus nec diam rhoncus, at molestie
mauris bibendum
- Vestibulum faucibus dictum lectus, et elementum lectus
dignissim ut. Donec ac libero et neque sollicitudin viverra.
Donec rhoncus scelerisque ullamcorper
And I would it like to look like this

- Lorem ipsum dolor sit amet, consectetur adipiscing
elit. Aliquam ultrices lobortis tortor at dapibus
- Donec faucibus risus nec diam rhoncus, at molestie
mauris bibendum
- Vestibulum faucibus dictum lectus, et elementum lectus
dignissim ut. Donec ac libero et neque sollicitudin viverra.
Donec rhoncus scelerisque ullamcorper
The rest of the text (new paragraph) without list
Every line has two additional hidden, non-editable spaces (or more, depending on position of "-" character or other), so text lines are in the same position as paragraph text at start.
I don't know how to detect if the line is at the end of the application window and how to apply those indents.