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

QPlainTextEdit internal padding

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 307 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.
  • W Offline
    W Offline
    whatabout
    wrote on 24 Jan 2024, 15:27 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 24 Jan 2024, 15:35
    0
    • M mpergand
      24 Jan 2024, 15:35

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

      W Offline
      W Offline
      whatabout
      wrote on 24 Jan 2024, 18:19 last edited by
      #3

      @mpergand Yep. Their solution worked:

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

      1 Reply Last reply
      0
      • W whatabout
        24 Jan 2024, 15:27

        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 24 Jan 2024, 15:35 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 24 Jan 2024, 18:19
        0
        • M mpergand
          24 Jan 2024, 15:35

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

          W Offline
          W Offline
          whatabout
          wrote on 24 Jan 2024, 18:19 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 24 Jan 2024, 18:19

          2/3

          24 Jan 2024, 15:35

          • Login

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