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. QPlainTextEdit and indentation of wordwrapped text?
Forum Updated to NodeBB v4.3 + New Features

QPlainTextEdit and indentation of wordwrapped text?

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 651 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.
  • T Offline
    T Offline
    Trapezoid_Dreams
    wrote on last edited by
    #1

    From the searching I've done, the impression I've gotten is this may be something QTextEdit can do, but not QPlainTextEdit due to it being stripped down for plain text, but I don't fully understand why and I thought I'd ask here in case my searches have missed something important.

    In case the title doesn't explain it, what I'm looking to do is the kind of behavior you'd see in an editor like Notepad++, where a block of text that is wordwrapped is displayed with the same indent level for each line. This appears to be something specialized to do with painting? (or whatever terminology would apply to editors like Notepad++) Since it's not an actual indent in terms of space or tab characters on lines past the 1st in the wordwrapped block, it's just painted as if it is? But that's just a guess. I don't have any familiarity with how it's done.

    JonBJ 1 Reply Last reply
    0
    • T Trapezoid_Dreams

      From the searching I've done, the impression I've gotten is this may be something QTextEdit can do, but not QPlainTextEdit due to it being stripped down for plain text, but I don't fully understand why and I thought I'd ask here in case my searches have missed something important.

      In case the title doesn't explain it, what I'm looking to do is the kind of behavior you'd see in an editor like Notepad++, where a block of text that is wordwrapped is displayed with the same indent level for each line. This appears to be something specialized to do with painting? (or whatever terminology would apply to editors like Notepad++) Since it's not an actual indent in terms of space or tab characters on lines past the 1st in the wordwrapped block, it's just painted as if it is? But that's just a guess. I don't have any familiarity with how it's done.

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #2

      @Trapezoid_Dreams
      You won't be able to do that with plain text. It's, well, plain text, so nothing extra in it.

      With QTextEdit/QTextDocument you have HTML/Qt's "rich text". At least that can do indentation. Though it won't automatically do it in relation to word wrap per se, you will (presumably) need to put your paragraph in something which specifies a margin/indentation.

      1 Reply Last reply
      1
      • T Offline
        T Offline
        Trapezoid_Dreams
        wrote on last edited by
        #3

        Gotcha, thanks for the info. Was hoping there might be some way to overcome it with special painting rules or something, but that may be like squaring a circle territory. At least now I know it's not just something I'm missing.

        JonBJ 1 Reply Last reply
        0
        • T Trapezoid_Dreams

          Gotcha, thanks for the info. Was hoping there might be some way to overcome it with special painting rules or something, but that may be like squaring a circle territory. At least now I know it's not just something I'm missing.

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by
          #4

          @Trapezoid_Dreams
          Well theoretically you might be able to do anything at the paint level, but I think that would be totally the wrong approach for this issue.

          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