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. Why does QTextDocument not display the table border properly when printing

Why does QTextDocument not display the table border properly when printing

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 2 Posters 772 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.
  • D Offline
    D Offline
    duncan98
    wrote on last edited by
    #1

    hello
    Why does QTextDocument not display the table border properly when printing.The following code

    QPrinter printer;
    QTextDocument textDocument;
        textDocument.setHtml("<table style='border-style:solid;border-color:#787878'><tr><td>11111</td></tr><tr><td>222</td></tr></table>");
        textDocument.print(&printer)
    
    1 Reply Last reply
    1
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Shouldn't you also give a size when setting your border style ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      D 1 Reply Last reply
      0
      • D Offline
        D Offline
        duncan98
        wrote on last edited by
        #3
        This post is deleted!
        1 Reply Last reply
        0
        • SGaistS SGaist

          Hi,

          Shouldn't you also give a size when setting your border style ?

          D Offline
          D Offline
          duncan98
          wrote on last edited by
          #4

          hi.@SGaist

          <table border=1 cellpadding=0 cellspacing=0 border-color:#000000><tr><td>11111</td></tr><tr><td>222</td></tr></table>
          

          alt text
          A little gap with the expected, how to achieve the effect of the black line

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Do you mean something like shown here ?

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            1

            • Login

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