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
#1
My knowledge of PyQt6 is limited. I can't figure how to bold part of a string passed to a QAction. Other widgets support rich text, so it's easy with them, but QAction does not. It's like I want to pass "only part of this string should be bolded" to a QAction.

Can that be done? I got nothing on how to do it.

EDIT:
In the spirit of rubber duck debugging, I had an idea. Can I pass a QLabel (which does support rich text) to a QMenu as an action? I think so via QWidgetAction. I'm gonna try. Let me know if I'm wrong.
Reply


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

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