Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QTextDocument: Style vs. Attribute
Forum Updated to NodeBB v4.3 + New Features

QTextDocument: Style vs. Attribute

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 234 Views 1 Watching
  • 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.
  • HoMaH Offline
    HoMaH Offline
    HoMa
    wrote on last edited by HoMa
    #1

    Hi All!
    In my example https://github.com/Schachigel/QtLetter where I work with QTextDocuments I found, that the following html in a QTextDocument works:

    <p align=justify>...</p>
    

    whereas this version - which I would consider the same - does not:

    <p style='text-align:justify;'> ...
    

    Actually the second one creats rather strange results. Any ideas on this?

    Best regards
    Holger

    JonBJ 1 Reply Last reply
    0
    • HoMaH HoMa

      Hi All!
      In my example https://github.com/Schachigel/QtLetter where I work with QTextDocuments I found, that the following html in a QTextDocument works:

      <p align=justify>...</p>
      

      whereas this version - which I would consider the same - does not:

      <p style='text-align:justify;'> ...
      

      Actually the second one creats rather strange results. Any ideas on this?

      Best regards
      Holger

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

      @HoMa
      According to the reference page cited by @Christian-Ehrlicher, QSS does not recognize style='text-align:...'. The <p align=justify> is recognized. Unfortunately the truth is that Qt's own setHtml() methods should really be named setRichText(), and you do have to use the reference page to check which HTML constructs are/are not supported.

      1 Reply Last reply
      1
      • Christian EhrlicherC Offline
        Christian EhrlicherC Offline
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on last edited by
        #2

        see https://doc.qt.io/qt-5/richtext-html-subset.html

        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
        Visit the Qt Academy at https://academy.qt.io/catalog

        1 Reply Last reply
        1
        • HoMaH HoMa

          Hi All!
          In my example https://github.com/Schachigel/QtLetter where I work with QTextDocuments I found, that the following html in a QTextDocument works:

          <p align=justify>...</p>
          

          whereas this version - which I would consider the same - does not:

          <p style='text-align:justify;'> ...
          

          Actually the second one creats rather strange results. Any ideas on this?

          Best regards
          Holger

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

          @HoMa
          According to the reference page cited by @Christian-Ehrlicher, QSS does not recognize style='text-align:...'. The <p align=justify> is recognized. Unfortunately the truth is that Qt's own setHtml() methods should really be named setRichText(), and you do have to use the reference page to check which HTML constructs are/are not supported.

          1 Reply Last reply
          1
          • HoMaH Offline
            HoMaH Offline
            HoMa
            wrote on last edited by
            #4

            Rtfm, I get it. There it says „block attribute“ align is supported. But text-align not ...
            Thx and sorry...

            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