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. QTextTable percentage column width constraints are not kept
Qt 6.11 is out! See what's new in the release blog

QTextTable percentage column width constraints are not kept

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 1.5k 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.
  • ToniyT Offline
    ToniyT Offline
    Toniy
    wrote on last edited by Toniy
    #1

    Greetings everyone.

    I have a QTextTable with two columns.
    I applied percentage column width constraints to it like this:

    QTextTable* const pTable = currentTextCursor.currentTable();
    ...
    QVector<QTextLength> vLens;
    
    vLens.pushBack(QTextLength::PercentageLength, 5);
    vLens.pushBack(QTextLength::PercentageLength, 95);
    
    QTextTableFormat fmt = pTable->format();
    fmt.setColumnWidthConstraints(vLens);
    
    pTable->setFormat(fmt);
    ...
    

    After that I launch my application and try to fill first column of the table that has five percent width with some letter key pressed for example. Width of this column increases (and width of second column decreases) until becoming almost equal to table width. After that columns restore their specified sizes. However I printed constraints during this process and output showed constraints that I specified.

    But if I use QTextLength::FixedLengthinstead then columns' widths remain unchanged always.

    The question is if it is possible to keep percentage-constrained columns' widths unchanged.

    If this information is not sufficient I will provide more of it with great pleasure but at the moment I don't see any stuff I could miss.

    If it is impossible at all It would be nice to know about reason of that impossibility too.

    Thanks in advance.

    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