Results 1 to 3 of 3

Thread: I need help designing a resizable widget

  1. #1
    Join Date
    Jun 2008
    Posts
    83
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default I need help designing a resizable widget

    Hello:

    I've been programming in Qt for a while now, but I still can't figure out how to do this and now I really need it.

    Say you have two QTextEdits in a QMainWindow. Now the window gets resized, however the QTextEdits remain the same size, not occupying the window if it grows lager, and not fitting in it if it grows smaller.

    I usually fixed this with a simple layout. However these are, as far as I know how to use them, tremendously restrictive. If I use a vertical layout for example both QTextEdits become the same size. However If I should happen to want the top one to be taller (bigger height) than the lower one, I can't do it. Not without breaking the layout. (I want to be left clear that I have tried to use spacers, but as the name implies these leave a space between both boxes and I want that space to be minimal)

    So my question is, how do give widgets inside a window the proportion in size that I want, while maintaining the resizing functionality that gives using a layout.
    Is there a simple way? Or should I just hand code all resizing events, doing the math so that the layout of the windows remains with the appropiate proportions and locations?

    Thank you very much for any help.
    Last edited by aarelovich; 2nd February 2009 at 19:09.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 975 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: I need help designing a resizable widget


  3. #3
    Join Date
    Jun 2008
    Posts
    83
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: I need help designing a resizable widget

    ahh thanks.

    Too bad I didn't see it on time. I've just realized that this thing doesn't give me an email reply Like I asked it too.

    I solved it using a QSplitter.

    But thanks anyway.

Similar Threads

  1. QDockWidget inside another widget in the center?
    By Antebios in forum Qt Programming
    Replies: 1
    Last Post: 16th February 2010, 07:06
  2. Playbutton functionality
    By uchennaanyanwu in forum Qt Programming
    Replies: 5
    Last Post: 31st July 2008, 22:29
  3. How to Open & Close a Widget ?!!
    By Fatla in forum Qt Programming
    Replies: 6
    Last Post: 13th June 2008, 20:39
  4. Tricky problem with ARGB widget / UpdateLayeredWindow
    By nooky59 in forum Qt Programming
    Replies: 3
    Last Post: 21st February 2008, 10:35
  5. user resizable and movable QLabel widget
    By hvengel in forum Qt Programming
    Replies: 8
    Last Post: 12th April 2007, 00:01

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.