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 internal padding
Qt 6.11 is out! See what's new in the release blog

QPlainTextEdit internal padding

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

    When I compare QLabel to QPlainTextEdit, I notice that QPlainTextEdit has some internal padding, maybe 3 pixels or so, that causes the text to be lower and to the right, compared to QLabel.

    Is there a way to completely eliminate that internal padding of QPlainTextEdit?

    M 1 Reply Last reply
    0
    • M mpergand

      @whatabout
      Reminds me this:
      https://forum.qt.io/topic/86693/qt-designer-qtextedit-remove-indentation?_=1706110440931

      W Offline
      W Offline
      whatabout
      wrote on last edited by
      #3

      @mpergand Yep. Their solution worked:

      textEdit->document()->setDocumentMargin(0);

      1 Reply Last reply
      0
      • W whatabout

        When I compare QLabel to QPlainTextEdit, I notice that QPlainTextEdit has some internal padding, maybe 3 pixels or so, that causes the text to be lower and to the right, compared to QLabel.

        Is there a way to completely eliminate that internal padding of QPlainTextEdit?

        M Offline
        M Offline
        mpergand
        wrote on last edited by mpergand
        #2

        @whatabout
        Reminds me this:
        https://forum.qt.io/topic/86693/qt-designer-qtextedit-remove-indentation?_=1706110440931

        W 1 Reply Last reply
        0
        • M mpergand

          @whatabout
          Reminds me this:
          https://forum.qt.io/topic/86693/qt-designer-qtextedit-remove-indentation?_=1706110440931

          W Offline
          W Offline
          whatabout
          wrote on last edited by
          #3

          @mpergand Yep. Their solution worked:

          textEdit->document()->setDocumentMargin(0);

          1 Reply Last reply
          0
          • W whatabout has marked this topic as solved on

          • Login

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