Results 1 to 8 of 8

Thread: Layout automatically adjusting the space dynamically

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2008
    Location
    Bengaluru
    Posts
    144
    Thanks
    8
    Thanked 7 Times in 7 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: Layout automatically adjusting the space dynamically

    Quote Originally Posted by MarekR22 View Post
    If widget is managed by a layout then you are not directly responsible for size changes of this widget, so you short code snippet suggests bad design or bug in your code. Describe problem with more details: what is changing that should cause resizing? what is (or isn't) in the layout? Expected outcome? How you code looks like (maybe you did some mistakes)?
    The code and the layout everything is working fine. There is no point in bad design or buggy code. Here i want to enter email address, the lineedit should change its width depending on the user entry into the field. So the above code/slot only specifies to increase the lineedit width dynamically.
    Expected outcome: 1) increase in the lineedit width(this is happening) 2) Dynamically layout has to adjust the size of the other widgets present in that layout(Not Happening and i want to fix this)

    Quote Originally Posted by wysota View Post
    If your setGeometry() call has any visible effect then the widget is not managed by a layout.
    oh! Thanks for info. That's what i need. yes, there will be increase in the width of the lineedit and layout has to adjust to size of the other widgets present in it. Then how to achieve it ?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Layout automatically adjusting the space dynamically

    You change the sizeHint or the minimumWidth of the line edit.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Layout automatically adjusting the space dynamically

    Don't forget to do something sane when the user's GMail account is I_am_froody_dude_that_always_knows_where_his_towel _is@gmail.com and you have completely crowded out the other widgets in the layout.

Similar Threads

  1. Hiding Layout item - Layout does not use available space
    By Asperamanca in forum Qt Programming
    Replies: 0
    Last Post: 27th January 2011, 09:51
  2. How to fill a QFrame space in QSplitter layout
    By henryjoye in forum Qt Programming
    Replies: 2
    Last Post: 12th October 2010, 05:18
  3. Dynamically change the layout
    By pippo42 in forum Qt Programming
    Replies: 2
    Last Post: 12th November 2009, 13:01
  4. Layout not giving space equally
    By gruszczy in forum Qt Programming
    Replies: 1
    Last Post: 2nd January 2009, 22:49
  5. Qt layout space + stretch
    By bunjee in forum Qt Programming
    Replies: 3
    Last Post: 20th December 2007, 15:53

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.