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. Make cells have equal size in a QTextTable?
QtWS25 Last Chance

Make cells have equal size in a QTextTable?

Scheduled Pinned Locked Moved Unsolved General and Desktop
qtexttableqtexttableformtable
2 Posts 1 Posters 562 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.
  • A Offline
    A Offline
    adamsmith
    wrote on last edited by
    #1

    I've managed to create a table in QTextEdit using this code

    qDebug() << "insering";
        QTextCursor cursor = note->textCursor();
    
        QTextTableFormat format;
        format.setBorder(1);
        format.setCellPadding(10);
        format.setCellSpacing(0);
    
        QTextTable *table = cursor.insertTable(5, 5, format);
        Q_UNUSED(table);
    

    The issue I am having is that the table is kind of stretched out because the cells height is greater than the cells width. Is there a way to change the default height and width of cells in a QTextTable?

    1 Reply Last reply
    0
    • A Offline
      A Offline
      adamsmith
      wrote on last edited by
      #2

      Update
      Using format.setWidth(10);or doing format.setHeight(1000); has no effect on the cells visible height and width

      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