How to set the Stylesheet for the QSpacerItem?

  • Can anyone please tell me how to set the Stylesheet for the QSpacerItem ? AFAIK, QSpacerItem doesn't have this setStylesheet function. Please suggest...

  • Lifetime Qt Champion


    Indeed you can't, QSpacerItem is not a widget. Why would you need to do that ?

  • I have few PushButtons, When I click/hover on first PushButton then i add a QSpacerItem between the first two PushButtons. Same like, if I click on the second PushButton, then I add a QSpacerItem between the second and Third PushButtons. I set the background of the Widget as Black in color. But when i add these QSpacerItem, then the color of the spacer item didn't changes.

  • Lifetime Qt Champion

    Does it stay out of color if you hide/show this widget ?

    On a related note, you can use the add/insert Spacing/Stretch functions to do that

Log in to reply