0

Since layout objects don't have a ".setStyleSheet()" attribute, how do I set the background color for a specific layout keeping the possibility of expanding the content of the layout when maximizing the window?

I am trying to have a background like a transparent style, each layout on my window would have a transparent background, and all of them on top of a general background ''you can see the images'

This is the Layout on Qt-designer:

this is the Layout on Qt-designer

This is the Layout after maximizing the window, it looks good!

this is the Layout after maximizing the window, it looks good!

I just added the layout once on an empty QWidget and once on an empty frame and set the StyleSheet on the widget/frame. but when I maximize the window, the widget or the frame is maximized, NOT the content on the layout.

This is the Layout with widget/frame as transparent background on Qt-designer:

this is the Layout with widget/frame as transparent background on Qt-designer

This is the Layout after maximizing the window, only the widget/frame is maximazed:

this is the Layout after maximizing the window, only the widget/frame is maximazed

I am wondering, how can I do it?

I tried the following solution as I explained above:link

musicamante
  • 41,230
  • 6
  • 33
  • 58
MoMo
  • 23
  • 5
  • Your question is unclear. In the first two images it seems to do what you want, why don't you keep the same approach? – musicamante Dec 07 '22 at 18:46
  • @musicamante Yes, in the first two images it looks ok, but without the transparent background, I want to add it. so in the other two images, it doesn't, actually, the background I added as a frame or as a widget is expanding but not the ListBox and the buttons. That is why I asked the question, why does the frame expand and what is inside it does not expand . I want to add a transparent background for each layout in the window (it's a resizable window, not a fixed one) just for a good look and design, nothing else. – MoMo Dec 13 '22 at 08:59

0 Answers0