Label: <ul> indentation is first line only
Unsolved
QML and Qt Quick
-
When using an unordered list on a Label in QML, indentation is wrong after the first line (so: there's actually no indentation).
* Using A Label with <strong>RichText</strong> works * It's a real fun to make an unordered List like this * My problem occurs, when a <li> element is getting too long to fit into the first line. When wordWrap kicks in, every subsequent line is unindented, like you can see here. * I would wish to have it be properly indented, just as in this example, where everything looks nice and tidy.
I've seen somebody propose the use of -qt-list-indent (see subset), similar to this:
<ul style="-qt-list-indent:5;">
And I have found this in a forum post:
<ul style=" -qt-list-indent: 1;"> <li style=" -qt-block-indent:0; text-indent:0px;">foo</li> <li style=" -qt-block-indent:0; text-indent:0px;">foo</li> <li style=" -qt-block-indent:0; text-indent:0px;">foo</li> </ul>
I am not too experienced with HTML, my mistake might be pretty basic. I've tried (multiple versions of) this
Label { width: 200 wrapMode: Text.WordWrap text: '<ul style="-qt-list-indent:5;"> \ <li> Using A Label with <strong>RichText</strong> works</li> \ <li> It\'s a real fun to make an unordered List like this</li> \ <li> My problem occurs, when a <li> element is getting too long to fit into \ the first line. When wordWrap kicks in, every subsequent line is unindented, \ like you can see here.</li> \ </ul>' }
With the same result as above. No sign that QML might want to adhere to the command.
Trying to set indentations to the list element themselves, like here:text: '<ul style="-qt-list-indent:5"> \ <li style="text-indent:5"> Using A Label with <strong>RichText</strong> works</li> \ <li style="text-indent:5"> It\'s a real fun to make an unordered List like this</li> \ <li style="text-indent:5"> My problem occurs, when a <li> element is getting too long to fit into \ the first line. When wordWrap kicks in, every subsequent line is unindented, \ like you can see here.</li> \ </ul>'
killed the whole unordered list, the result being:
Using A Label with RichText works It's a real fun to make an unordered List like this My problem occurs, when a li element is getting too long to fit into the first line. When wordWrap kicks in, every subsequent line is unindented, like you can see here.
Same result with -qt-block-indent or -qt-list-indent.
How can I get <ul> to show proper indentation?