I Added some QLabels with different colors to A QGridLayout as Layout of a QWidget, now I have a spacing between each Qlabel to the next and I want to remove it. I tried to set the margin of the Labels to "0" and the Alignment of the GridLayout to "0" but it didnt worked very good. i thought the space is maybe the border of the Labels but i checked. do you have any idea?
Asked
Active
Viewed 6,823 times
5
-
Look at the docs for the layout itself. There's things with "spacing" in their name at the very top. – Mat May 05 '13 at 19:15
2 Answers
2
You can try setting the spacing:
layout->setSpacing(0);
If that doesn't do it, you can also try setting the contents margins to zero:
layout->setContentsMargins(0,0,0,0);

Garjy
- 467
- 5
- 12