Code: Select all
ul {
list-style: none;
margin: 0;
padding: 0
}
li {
padding-left: 24px;
padding-bottom: 14px
}
li.first {
background-image: url("icons/plus-circle.svg");
background-repeat: no-repeat
}
li.second {
background-image: url("icons/next-solid.svg");
background-repeat: no-repeat
}
[list]
[*]first bullet point
[*]second bullet point
[/list]

Wenn ich den gleichen HTML-Code zu einem QTextEdit hinzufüge, erhalte ich völlig unterschiedliche Ergebnisse. Anscheinend wird meine Auffüllung ignoriert und die Hintergrundwiederholung: no-repeat wird ebenfalls ignoriert.

Gibt es eine HTML-basierte Version, die in QTextEdit funktionieren würde (oder auf eine andere, bessere Weise?), und gibt es eine umfassende Ressource, die das erklärt Grenzen von HTML in Qt? Vielen Dank im Voraus!
Hier ist der Code für das PySide6-Fenster:
Code: Select all
from PySide6.QtWidgets import QApplication, QMainWindow,, QTextEdit
app = QApplication([])
class MainWindow(QMainWindow):
def __init__(self):
super().__init__()
textEdit = QTextEdit()
textEdit.insertHtml(... the html from above ...)
self.setCentralWidget(textEdit)
window = MainWindow()
window.show()
app.exec()
Mobile version