Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. TextArea rich text css margin and padding not working.
Forum Updated to NodeBB v4.3 + New Features

TextArea rich text css margin and padding not working.

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
5 Posts 3 Posters 893 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    senmx
    wrote on last edited by
    #1
    import QtQuick 2.0
    import QtQuick.Controls 2.12
    
    Rectangle {
        width: 500
        height: 500
        TextArea {
            anchors.fill:parent
            color:"#FFFFFF"
            readOnly: true
            textFormat: Text.RichText
            wrapMode: Text.Wrap
            text:"<p style='background:#181818;color:white;padding:20px;margin:10px;'>HELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLDHELLO WORLD</p>"
       }
    }
    
    1 Reply Last reply
    0
    • fcarneyF Offline
      fcarneyF Offline
      fcarney
      wrote on last edited by
      #2

      Only a subset is supported:
      https://doc.qt.io/qt-5/richtext-html-subset.html
      It can be frustrating and the subset is quite limiting. If you need something like a browser using WebEngine might be better.

      C++ is a perfectly valid school of magic.

      S 1 Reply Last reply
      1
      • fcarneyF fcarney

        Only a subset is supported:
        https://doc.qt.io/qt-5/richtext-html-subset.html
        It can be frustrating and the subset is quite limiting. If you need something like a browser using WebEngine might be better.

        S Offline
        S Offline
        senmx
        wrote on last edited by
        #3

        @fcarney Thanks. But webegine is too big, if I modify the rich text css rendering of TextArea of qt, is it troublesome?

        JonBJ 1 Reply Last reply
        0
        • S senmx

          @fcarney Thanks. But webegine is too big, if I modify the rich text css rendering of TextArea of qt, is it troublesome?

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by
          #4

          @senmx said in TextArea rich text css margin and padding not working.:

          if I modify the rich text css rendering of TextArea of qt, is it troublesome?

          How do you propose to do that?

          1 Reply Last reply
          0
          • S Offline
            S Offline
            senmx
            wrote on last edited by senmx
            #5

            @JonB Change the qt source code?! Depends on how troublesome it is.

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved