Results 1 to 4 of 4

Thread: Resizable layout boxes

  1. #1
    Join Date
    Apr 2008
    Posts
    3
    Thanks
    2
    Platforms
    MacOS X

    Default Resizable layout boxes

    Hi, I'm working on kind of a basic java editor using Qt Jambi (School projec), and it's all been going great so far, but I cant seem to find out how to let the user resize the layout boxes or widgets himself.

    Let's say I have two widgets laid out like this:

    Qt Code:
    1. ------------------
    2. | |
    3. ------------------ <---- I want the user to be able to drag this divider up and down
    4. | |
    5. ------------------
    To copy to clipboard, switch view to plain text mode 

    How would I go about doing this? Do I have to wrap the widget in another element? Simply change a layout / widget property I've overlooked?

    Thanks,
    any help will be highly appreciated!

  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: Resizable layout boxes

    Some more info would be required... Are you trying to mimic what Designer does? Why not take its code directly or even use Designer for editing?

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

    NOR (16th April 2008)

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

    Default Re: Resizable layout boxes

    Quote Originally Posted by NOR View Post
    Do I have to wrap the widget in another element?
    Yes, you have to add your widgets to a splitter. In Qt Designer you have to select some widgets and choose "Lay out in a splitter" from the menu.

  5. The following user says thank you to jacek for this useful post:

    NOR (16th April 2008)

  6. #4
    Join Date
    Apr 2008
    Posts
    3
    Thanks
    2
    Platforms
    MacOS X

    Default Re: Resizable layout boxes

    Quote Originally Posted by jacek View Post
    Yes, you have to add your widgets to a splitter. In Qt Designer you have to select some widgets and choose "Lay out in a splitter" from the menu.
    Thanks!
    QSplitter was exactly what I was looking for.
    I'm not using Qt Designer, so I guess that's why I had so much trouble figuring out what I needed. =)

Similar Threads

  1. changing layout of a widget
    By mikro in forum Qt Programming
    Replies: 10
    Last Post: 4th August 2009, 20:21
  2. Qt Layout engine not respecting minimum size?
    By Mike in forum Qt Programming
    Replies: 2
    Last Post: 28th August 2007, 13:27
  3. Qt layout memory issue
    By bunjee in forum Qt Programming
    Replies: 9
    Last Post: 25th August 2007, 17:11
  4. Promoted widgets and layout boxes
    By notsonerdysunny in forum Qt Tools
    Replies: 3
    Last Post: 2nd May 2007, 14:15
  5. "dynamic" layout
    By hulk in forum Qt Programming
    Replies: 2
    Last Post: 9th May 2006, 07:16

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.