[Solved]How to avoid Gap/Space between my custom widgets ?
I have created a custom widget ,it contains Pushbutton at top ,down Qframe ,inside the frame some components like buttons,combobox,etc.
I placed my custom widget on AccordionWidget(Qwidget conatins QscrollArea),finally i am placing my AccordionWidget
What i required is
Anyone can give me your suggestions.
welcome to devnet
You have managed to use the link button as explained in "this section":http://qt-project.org/wiki/ForumHelp#9bd9c32b79efb1b2d5b039e4d48300a9 described under 7. Since you have links to pictures you may want to use the picture described under 6.
Please update your post. There is an edit shown below your avatar allowing you to update your post.
ThankYou Koahnig, Plz reply my post.
Insert a VerticalSpacer?
I can't see the picture, but i can assume you want to use "setContentsMargins":http://qt-project.org/doc/qt-4.8/qlayout.html#setContentsMargins or "setSpacing":http://qt-project.org/doc/qt-4.8/qlayout.html#spacing-prop or maybe both, hope it helps ;)
Guys Thanks for your reply
@ MuldeR --> I dont want to avoid space on CustomWidget,I need to avoid space on AccordionExample between the section.
How the panel2 and Panel3 is coming on RequiredOutput.jpg image which i gave the link on my previous post.
Guys help me to solve this problem.
Well, we can't see any of your linked pictures, so we are having quite a hard time of quessing what you are actually want to achieve.
To reduce Gap between the Custom Widgets ..
Place a vertical spacer above the first one and one below the last one?
[quote author="sweeten" date="1336976796"]Guys help me to solve this problem.[/quote]
Somehow your pictures do not display. As far as I see, you have done it correctly.
For us it looks like this
[quote author="Woody" date="1336997079"]Place a vertical spacer above the first one and one below the last one?[/quote]
I guess, one spacer would do. Also, if you are using vertical layout,set spacing to 0.For ex:
I tried setSpacing, that doesn`t works...
Try adding a vertical spacer to you widget. It will set the space to a minimum.
i am adding my custom widget through coding,
@ widget1 = new CustomWidget();
widget2 = new CustomWidget();
widget3 = new CustomWidget();
widget4 = new CustomWidget();
How can i add Spacer to that? Thats why Rahul said to try setSpacing(),That also not works.
Thankyou for your information.
Aah ok, sorry for the misunderstanding.
Something like this: "QSpacerItem":http://qt-project.org/doc/qt-4.8/qspaceritem.html
I didn't really looked into it. I'm using the graphical designer do achieve this.
Hopes this works out for you.
I checked QSpacerItem,there is no need for using this class, spacing can be acheived by calling the method setSpacing().So i already tried setSpacing(),this also not works.
Mmh that is strange. You probably set a layout to the parent widget?
Is it possible to provide the code, so I can have a better look?
Sweeten, Try the combination of spacer in VBoxLayout. It works.
I have uploaded my full project . Just run the application and see the Gap between the custom widgets(Section 1,Section 2,Section 3 & Section 4).
Your suggestions are welcome.
Guys any suggestion..
Sorry I can't download it, haven't got an account. Will get it tonight.
I have done .Thankyou all for your support.
Kindly edit your title and preprend [Solved] to it.
Thank you Sam for your information ,i have edited my title as Solved.