Results 1 to 2 of 2

Thread: Limiting the display size of QPlainTextEdit

  1. #1
    Join Date
    Oct 2016
    Posts
    3
    Thanks
    2
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Limiting the display size of QPlainTextEdit

    Hi all,

    To my QFormLayout I add a QPlainTextEdit element.

    When i change the size of my Application Window using my mouse, it stretched vertically the size of my QPlainTextEdit.

    I would like to fix the QPlainTextEdit to 4 lines window.
    Last edited by Adler; 20th November 2016 at 14:43.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,420
    Thanks
    37
    Thanked 1,545 Times in 1,495 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Limiting the display size of QPlainTextEdit

    The default size policy for widgets such as the text edit is to grow.
    You can try setting a different size polixy, e.g. Preferred, or set a maximum height, e.g. derived from the current font via QFontMetrics.

    Cheers,
    _

  3. The following user says thank you to anda_skoa for this useful post:

    Adler (20th November 2016)

Similar Threads

  1. QPlainTextEdit display large plain text
    By ArkKup in forum Qt Programming
    Replies: 1
    Last Post: 13th March 2013, 21:58
  2. Limiting repaint events somehow
    By Marcaunon in forum Qt Programming
    Replies: 1
    Last Post: 15th February 2012, 14:31
  3. Replies: 2
    Last Post: 13th March 2010, 22:42
  4. QPlainTextEdit and its size policy
    By Lykurg in forum Qt Programming
    Replies: 0
    Last Post: 9th March 2010, 10:40
  5. How to display image on QPlainTextEdit
    By naoyamakino in forum Qt Programming
    Replies: 2
    Last Post: 15th July 2009, 16:44

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.