Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. C++ Gurus
  4. How to "restructure " text line output ?
Qt 6.11 is out! See what's new in the release blog

How to "restructure " text line output ?

Scheduled Pinned Locked Moved Unsolved C++ Gurus
2 Posts 2 Posters 520 Views 2 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.
  • A Offline
    A Offline
    Anonymous_Banned275
    wrote on last edited by
    #1

    I am asking for ideas , not for code in particular.
    Ideas on how to "restructure " the attached output to "shrink" so the irregular space between the strings can be adjusted and still have the last string ended at same location.

    I was thinking to get the average of the line - both strings - length , then retrieve the actual length of the last / second string . By searching for two or three consecutive spaces - from the end of of the line...

    Then I got stuck what to do next...

    Any better idea / help would be appreciated.

    290efb6b-0582-4436-aef7-0d194ec12f7d-image.png

    1 Reply Last reply
    0
    • Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Idea 1. Split the strings on two or more spaces, put them in a two column model and display in a tree view with auto adjusting column widths and left/right alignment.

      Idea 2. Switch to monospace font. Find the longest line and assume that as your number of characters in a line (lets call it X). For each line count the characters (lets call it Y), find a location of two or more spaces and insert (X-Y) spaces.

      1 Reply Last reply
      1

      • Login

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