Popup widgets like menu and combo share a common look. How to give that look to a custom widget?
I tried reimplementing the paint event
def paintEvent(self, e):
option.rect = self.rect()
self.
style().
drawPrimitive(QStyle.
PE_FrameMenu, option, p, self
) self.
style().
drawPrimitive(QStyle.
PE_PanelMenu, option, p, self
)
def paintEvent(self, e):
p = QPainter(self)
option = QStyleOption()
option.initFrom(QMenu())
option.rect = self.rect()
self.style().drawPrimitive(QStyle.PE_FrameMenu, option, p, self)
self.style().drawPrimitive(QStyle.PE_PanelMenu, option, p, self)
To copy to clipboard, switch view to plain text mode
But it isn't enough for styles like Oxygen or Bespin...
What am I missing?
Bookmarks