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> QTextTableCellFormat help
Forum Updated to NodeBB v4.3 + New Features

<SOLVED> QTextTableCellFormat help

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 825 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.
  • P Offline
    P Offline
    Pt_develop
    wrote on last edited by
    #1

    This may seem like a dumb question but I cannot find the answer. Does anyone know how to find and modify a QTextTableCellFormat in a table? Finding the QTextTableCell is easy but my documentation doesn't have a method to access the QTextTableCellFormat for that cell nor can I find a way to access the format using QTextCursor. There are a lot of useful functions of QTextTableCellFormat listed in the documentation but they are all useless unless I can access the cell format.

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

      Hi,

      Unless I'm mistaken, QTextTableCellFormat is a QTextCharFormat which is a QTextFormat which has the toTableCellFormat method. You could try converting the format your get from QTextTableCell with it.

      Hope it helps

      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
      0
      • P Offline
        P Offline
        Pt_develop
        wrote on last edited by
        #3

        SGaist:

        Thanks, should have figured this out myself. I ran a short test on a QTextTableCell which I'll call cell. The methods cell.format().isTableCellFormat() returns true so the format is a QTextTableCellFormat in contrast to the documentation (4.8) which lists the format as QTextCharFormat. Haven't tried it yet but I presume this means the additional padding methods of QTextTableCellFormat are now accessible.

        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