Python Forum
[PyQt] Add a function in QtextBrowser
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyQt] Add a function in QtextBrowser
#2
That kind of thing does not belong in the class (plus it is really annoying). If you want to scroll to the bottom whenever you append text, use an intermediary function that does the append and the scrolling.

You can do what you want (modify method behavior in existing class) in Python. It is called "monkey patching". Now that you know what it's called you can find lots of examples and tutorials.
catlessness likes this post
Reply


Messages In This Thread
Add a function in QtextBrowser - by catlessness - Sep-23-2021, 05:17 PM
RE: Add a function in QtextBrowser - by deanhystad - Sep-23-2021, 06:31 PM
RE: Add a function in QtextBrowser - by Axel_Erfurt - Sep-23-2021, 07:03 PM
RE: Add a function in QtextBrowser - by catlessness - Sep-25-2021, 01:55 PM

Forum Jump:

User Panel Messages

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