简体   繁体   中英

displaying message in PyQt4

I am developing an application using PyQt4 .

Currently I am in need of a message box ie if I am on a current screen and user presses a function the callback function should display message whether by a message box or any other way you can suggest ......However when the user cancels it the flow should go to the current screen.

Please help ....

Thanks a lot..

If I have understood your question, I believe your scenario is the common one.

In order to show a message, the easiest way is:

my_msg = "Hello world"
QtGui.QMessageBox.information(None, 'My Title', my_msg)

This code should be in the callback function you have mention.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM