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. Use TextFlags in TableWidget
Qt 6.11 is out! See what's new in the release blog

Use TextFlags in TableWidget

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

    Hi there,

    Whenever I make my TableWidget rows narrow so that only one line could fit in it cuts of multi-line text on top and bottom.
    As a solution I'm trying to use TextFlags in my TableWidget, in particular the TextSingleLine flag, which seems to do exactly what I need without explicitly changing all the text to not use newlines, but spaces instead.

    But I can't seem to find the correct object to place the flag on. TableWidgetItem only uses ItemFlags for example.

    What's the best way to use it then? Or is there a better solution to my problem than the TextSingleLine flag?

    thx, Megamouse

    1 Reply Last reply
    0
    • MegamouseM Offline
      MegamouseM Offline
      Megamouse
      wrote on last edited by
      #2

      In the end I just used QString::simplified() to sort this out

      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