Python Forum
[PyQt] QAction bold part of the string argument
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyQt] QAction bold part of the string argument
#3
Good to go. Things I've found when passing a QAction to addAction: the QAction needs a parent most times to show in the menu. So, I passed the QMenu to QWidgetAction, then call setDefaultWidget() on that widget. It shows, and using a QLabel allows for selective bolding, etc. This solution does what I want.

I've found QActions are indented by default. I guess to allow for check boxes or icons, and QWidgetAction is not indented. I'm all ears if anyone has a solution to that before I find the solution.

Hopefully this can help someone else.
Reply


Messages In This Thread
RE: QAction bold part of the string argument - by malonn - Sep-12-2022, 02:49 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Exclamation [PyQt] Setting icon on QAction from outside QGuiApplication gradlon93 3 1,882 Jan-04-2023, 11:37 AM
Last Post: gradlon93
  PyQt6 QAction with icon and string malonn 2 1,857 Sep-12-2022, 11:59 AM
Last Post: malonn
  Syntax Error: Positional argument follows keyword argument Rama02 3 4,247 Feb-09-2021, 06:10 PM
Last Post: deanhystad
  How to make button text bold in Tkinter? scratchmyhead 2 12,424 May-16-2020, 02:53 AM
Last Post: scratchmyhead
  [Tkinter] changing title text to bold in tkinter Kumarkv 2 8,910 May-09-2020, 10:41 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

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