Python Forum
[PyQt] QWidgetAction of QFrame not showing in menu
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyQt] QWidgetAction of QFrame not showing in menu
#1
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.
Reply


Messages In This Thread
QWidgetAction of QFrame not showing in menu - by malonn - Sep-17-2022, 04:34 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyQt] Help: Replace widgets in a QFrame on Combobox change mart79 2 3,567 May-14-2020, 05:21 AM
Last Post: mart79
  Menu bar not showing in gui window mlh 2 10,622 Sep-09-2018, 10:27 PM
Last Post: mlh
  [Tkinter] Tkinter optionmenu child menu position showing 0,0 thatguy14 2 4,706 Jun-15-2018, 10:42 AM
Last Post: thatguy14

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020