Results 1 to 16 of 16

Thread: Problem in layout spacing

  1. #1
    Join Date
    Nov 2008
    Posts
    11
    Qt products
    Qt4
    Platforms
    Windows

    Default Problem in layout spacing

    Hi,

    i have a problem in Qt designer ui.

    I have a dilog having a VSplitter. Inside the Splitter there are two panes, the above pane has a filedialog and the lowe pane contains the stacked widget contains two pages in it. Both the pages having thier own group boxes.

    Now my problem is that on one of the page , there is small groupbox which is having some space above and below it. i want to remove this space.

    I need it urgently so any type of help is highly appriciated.

    Thanks in advance

  2. #2
    Join Date
    Nov 2008
    Posts
    11
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problem in layout spacing

    If anybody has any problem in undestanding my "layout spacing problem", plz. let me know through reply to this...

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

    Default Re: Problem in layout spacing

    If you click the parent of the groupbox and scroll down the property browser you'll notice properties where you can adjust the margin and spacing of the layout.

  4. #4
    Join Date
    Nov 2008
    Posts
    11
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problem in layout spacing

    Thanks for the reply..., But r u talking about the size policy property or some other

    Actually In my case the parent of the group box is a stacked widget

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

    Default Re: Problem in layout spacing

    No, I'm talking about the group such as the one in the attachment.
    Attached Images Attached Images

  6. #6
    Join Date
    Nov 2008
    Posts
    11
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problem in layout spacing

    Actually , the group box is placed on the page( which is of stacked widget) having space left above and below it and in stacked widget we are not having any margin or spacing property.

    So how can i remove that space.?

    Is there any way to do it programatically?

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

    Default Re: Problem in layout spacing

    Did you apply a layout to the page? I think you didn't and that's why you don't see those properties.

  8. #8
    Join Date
    Nov 2008
    Posts
    11
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problem in layout spacing

    Yes u r right, i haven't applied layout on the page.

    I have applied layout on the page and set the margin and spacing properties but still my space problem was not solved.

    I am still getting spaces above and below my group box..

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

    Default Re: Problem in layout spacing

    Can you attach the ui file here?

  10. #10
    Join Date
    Nov 2008
    Posts
    11
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problem in layout spacing

    i have uploaded the screen shot of the ui.. due to some problem i can not upload the ui.

    When u look into this screenshot the groupbox(select info) placed below is having the space problem. i need to remove it .
    Thanks for replying
    Attached Files Attached Files

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

    Default Re: Problem in layout spacing

    Please post your Designer file, not a screenshot of it.

    I see your layout is incorrect. You have placed each widget into a separate layout instead of applying the layout to the groupbox. There could be more errors...

  12. #12
    Join Date
    Nov 2008
    Posts
    11
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problem in layout spacing

    Hi,

    Plz. find attached my ui (FileDialog.ui).

    In the ui, the lower pane of the splitter having a stacked widget has two pages . The one is having the "student information" group box and the second is having "Student content" group box.

    I m having the problem only in the first page groupbox.

    In the first groupbox ( student information )you can see the space above and below it. I just want to remove that space anyhow. Also when the user moves the splitter up and down the lower edge of the dialog also moves up and down.

    It will be great.,f there is any progrmatic way to do it, plz. tell me that,
    I hope, i'll be able to define my problem.. if u have any queries so plz. let me know..

    Thanks
    Attached Files Attached Files

  13. #13
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Problem in layout spacing

    you want something like this?
    Attached Files Attached Files
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  14. #14
    Join Date
    Nov 2008
    Posts
    11
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problem in layout spacing

    Hi Spirit,
    Thanks for replying.

    No, this is not what i want. I think you have modified the size policy of the group box. I have already done it but i haven't got the exact solution what i want.

    I'll try once again ....

    The student Information group box has fixed height so What i want was, on moving the splitter up and down( in case of Student Information) the lower edge of the dialog should move with it and one more thing the second page( having another group box named student contents) should not be affected with it.

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

    Default Re: Problem in layout spacing

    You won't obtain what you want with the layout engine. Actually I think the effect you want to obtain is unintuitive and unnatural. If you want it that way, you don't need the splitter at all. Instead make the lower part of the dialog fixed size using whatever means you wish to choose (there are at least two approaches) and then set the size policy of the upper part to expanding. Then your user only needs to... resize the window - the lower part will go up without changing its size and the upper part will be squezzed to fit the new size of the dialog.

  16. #16
    Join Date
    Nov 2008
    Posts
    11
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problem in layout spacing

    Thanks wysota,

    I think you are correct .. I will make it change now.

Similar Threads

  1. QT Layout problem
    By bod in forum Qt Programming
    Replies: 1
    Last Post: 1st July 2008, 13:29
  2. Problem with spacing
    By ali22 in forum Qt Tools
    Replies: 1
    Last Post: 21st January 2008, 17:51
  3. problem with Tool button n Layout
    By arjunasd in forum Qt Tools
    Replies: 11
    Last Post: 24th July 2007, 21:14
  4. Grid Layout Problem
    By Seema Rao in forum Qt Programming
    Replies: 2
    Last Post: 4th May 2006, 12:45
  5. Layout Problem
    By Seema Rao in forum Qt Programming
    Replies: 4
    Last Post: 19th April 2006, 11:08

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.