Sep-17-2022, 04:34 PM
I am trying to set up a
QPushButton
with menu that has a horizontal frame in it, but it won't show. The button menu has several labels-based QWidgetActions
that all work fine, but a frame won't show. Any ideas why?self.remote_but = QPushButton('Blocked Content') self.remote_menu = QMenu(self.remote_but) self.remote_but.setMenu(self.remote_menu) lab = QLabel(f'Allow content from <b>{from_addr}</b>') widget = QWidgetAction(self.remote_menu) widget.setDefaultWidget(lab) self.remote_menu.addAction(widget) frame = QFrame() frame.setFrameShape(QFrame.Shape.HLine) widget = QWidgetAction(self.remote_menu) widget.setDefaultWidget(frame) self.remote_menu.addAction(widget)That's just an excerpt there's more to the code (multiple labels and configuring). Why isn't the frame showing? I ran
actions()
on the menu, and it includes the frame, however it doesn't show/display in the menu.