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. [SOLVED]QTextDocument, table and table border width 1px.
Forum Updated to NodeBB v4.3 + New Features

[SOLVED]QTextDocument, table and table border width 1px.

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 11.2k 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.
  • S Offline
    S Offline
    silver47
    wrote on 6 Jun 2011, 03:34 last edited by
    #1

    Hello.

    I'm create table by two ways:
    QTextCursor::insertTable
    @QTextTableFormat tableFormat;
    tableFormat.setBorderStyle(QTextFrameFormat::BorderStyle_Solid);
    tableFormat.setCellPadding(1);
    tableFormat.setWidth(QTextLength(QTextLength::PercentageLength, 40));
    tableFormat.setAlignment(Qt::AlignLeft);
    m_cursor->insertTable(4, 2, tableFormat);@
    and with HTML
    @QString tableStr;
    tableStr.append("<table align="center" border="1">");
    //...
    m_cursor.insertHtml(tableStr);@

    And the table have a "3D" border. How I can set thin border.

    Many thanks.

    sorry for my english :(

    1 Reply Last reply
    0
    • L Offline
      L Offline
      loladiro
      wrote on 6 Jun 2011, 03:42 last edited by
      #2

      For the first one:
      @tableFormat.setBorderMargin(1)@
      And for the second one:
      @tableStr.append("<table align="center" "style"="border: solid 1px;">")@
      remove the " around style, it wouldn't show up in the post without it.
      Hope that helps.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        silver47
        wrote on 6 Jun 2011, 04:11 last edited by
        #3

        thanks for reply.

        @tableFormat.setBorderMargin(1);@ - there is no setBorderMardin method in the QTextTableFormat :( There is setMargin(qreal) method, but it has no effect :(
        I found tableFormat.setCellSpacing(0), which make border more thin.

        "And for the second one: "
        I set "<table "style"="border:solid 1px;">" but, I can't see any border :(.

        Can anybody talk me, how to make table with QTextCursor::insertTable if table is a difficult (have a cells with a "rowspan" and "colspan")?

        I found @QTextTable::mergeCells(int row, int col, int rowspan, int colspan);@

        sorry for my english :(

        1 Reply Last reply
        0

        1/3

        6 Jun 2011, 03:34

        • Login

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