Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QML TextEdit: How can I change the richtext header?



  • I'd like to change the header from a richtext from:

    <head><meta name="qrichtext" content="1" /><style type="text/css">
    p, li { white-space: pre-wrap; }
    </style></head>

    to :

    <head><meta name="qrichtext" content="1" /><style type="text/css">
    p, li { white-space: pre; }
    </style></head>

    Is there a way to change white-space?

    Here is my code:

    import QtQuick 2.12
    import QtQuick.Window 2.12
    
    Window {
        visible: true
        width: 640
        height: 480
        TextEdit{
            anchors.fill: parent
            anchors.margins: 10
            textFormat: Qt.RichText
            text: "<pre> test </pre>"
        }
    }
    

Log in to reply