Results 1 to 8 of 8

Thread: How to make plainTextEdit autofill to parent window?

  1. #1
    Join Date
    Feb 2009
    Location
    London
    Posts
    5
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default How to make plainTextEdit autofill to parent window?

    Any way to make plainTextEdit or other widget size automatically to fill the parent window when I resize that window in runtime?

  2. #2
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to make plainTextEdit autofill to parent window?

    implement sizeHint() of the widget and provide it with the size of the parent..thus, everytime a resize occurs, it will take the size of the parent...hope that works

  3. #3
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: How to make plainTextEdit autofill to parent window?

    Confused, did you use QLayout?

  4. #4
    Join Date
    Dec 2008
    Location
    Istanbul, TURKEY
    Posts
    537
    Thanks
    14
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Windows Android

    Default Re: How to make plainTextEdit autofill to parent window?

    Hi,

    In order to do autofill or "auto resize", you need to give a layout for the parent widget. This is the only way as far as I know.


    Regards.

  5. #5
    Join Date
    Feb 2009
    Location
    London
    Posts
    5
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to make plainTextEdit autofill to parent window?

    Quote Originally Posted by zgulser View Post
    In order to do autofill or "auto resize", you need to give a layout for the parent widget. This is the only way as far as I know.
    I'm using Qt Creator. I dragged layout to centralWidget and put plainTextEdit inside which scaled itself to layout size but layout didn't scale mainWindow size, hope that's clear.

  6. #6
    Join Date
    Dec 2008
    Location
    Istanbul, TURKEY
    Posts
    537
    Thanks
    14
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Windows Android

    Default Re: How to make plainTextEdit autofill to parent window?

    Hi,
    First, try to resize from the bottom side of the mainWindow, you see it's resizing. Secondly, put a frame or widget inside your mainWindow and put your child widgets( i.e. plainTextEdit) to this frame. Then play with the frame size. You see resizing works fine.

  7. #7
    Join Date
    Feb 2009
    Location
    London
    Posts
    5
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Thumbs up Re: How to make plainTextEdit autofill to parent window?

    I got it (thanks to this post)
    All I had to do is put my plainTextEdit on main window, right click on empty space (on main window) and select one of the layouts.

  8. #8
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: How to make plainTextEdit autofill to parent window?

    Quote Originally Posted by kid2000 View Post
    All I had to do is put my plainTextEdit on main window, right click on empty space (on main window) and select one of the layouts.
    Äh, you use the designer... For further problems using designer please use Qt Designer Forum.

Similar Threads

  1. How to close parent window from child window?
    By montylee in forum Qt Programming
    Replies: 5
    Last Post: 14th October 2008, 11:40
  2. How to make window semi modal
    By kaushal_gaurav in forum Qt Programming
    Replies: 7
    Last Post: 29th August 2008, 08:27
  3. Compiling with Qmake/Make
    By VireX in forum Newbie
    Replies: 25
    Last Post: 22nd February 2007, 05:57
  4. move parent window to the front.
    By hvengel in forum Qt Programming
    Replies: 4
    Last Post: 2nd February 2007, 08:41
  5. cannot make a main window modal
    By Dark_Tower in forum Qt Programming
    Replies: 12
    Last Post: 23rd March 2006, 10:21

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.