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 892 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 21 Apr 2020, 13:41 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
    • F Offline
      F Offline
      fcarney
      wrote on 21 Apr 2020, 14:39 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 2 May 2020, 17:07
      1
      • F fcarney
        21 Apr 2020, 14:39

        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 2 May 2020, 17:07 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?

        J 1 Reply Last reply 2 May 2020, 19:56
        0
        • S senmx
          2 May 2020, 17:07

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

          J Offline
          J Offline
          JonB
          wrote on 2 May 2020, 19:56 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 3 May 2020, 03:33 last edited by senmx 5 Mar 2020, 03:34
            #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