PDA

View Full Version : QMenu styling



ttg
12th February 2016, 13:57
How can I add a margin before the first item in QMenu?

"QMenu::item:first { margin-top: 50px; }" doesn't work.

Neither does "QMenu { margin-top: 50px; }"

"QMenu::item { margin-top: 50px; }" works, but obviously adds margin to all items, not only to the first one.

d_stranz
12th February 2016, 19:53
Untested, and I have no idea if it will work: You could check to see if the QMenu has a layout installed on it. If it does, you could try adjusting the contentsMargins property. If it doesn't have a layout, you could try installing one prior to adding items.