Get the App
SLTechnology News&Howtos  ›  Development  › 

How to add the type of help prompt to PyQt in Python

Shulou Source: shulou.com Published: 2022-06-03 17:35:26 10月05日 Update

Editor to share with you how to add PyQt help tips in Python types, I hope you will learn something after reading this article, let's discuss it together!

1. A status prompt is a help prompt displayed by the application on the status bar when the user hangs the mouse pointer over a menu option or a toolbar button.

By default, the status prompt contains an empty string.

2. Tooltips are help tips that the application displays as floating information.

By default, tooltips contain text that identifies the operation at hand.

Example

Class Window (QMainWindow): # Snip... Def _ createActions (self): # File actions # Snip... Self.saveAction.setShortcut ("Ctrl+S") # Adding help tips newTip = "Create a new file" self.newAction.setStatusTip (newTip) self.newAction.setToolTip (newTip) # Edit actions self.copyAction = QAction (QIcon (": edit-copy.svg"), "& Copy", self) # Snip... After reading this article, I believe you have a certain understanding of "how to add help tips to PyQt in Python". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!

Tags: Tips help tools status type application situation program article application information done instance toolbar hand pointer button text more user Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi Apple Shulou Technology Microsoft Huawei