Results 1 to 3 of 3

Thread: how to create a message box in pyside?

  1. #1

    Default how to create a message box in pyside?

    Hi everyone,
    I'm new to qt and pyside. Now I'm trying to create a message box in pyside, could you tell me how to do that?

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: how to create a message box in pyside?

    Something like this:
    Qt Code:
    1. #!/usr/bin/python
    2. # -*- coding: utf-8 -*-
    3.  
    4. import sys
    5. from PySide import QtGui
    6.  
    7. def main():
    8. app = QtGui.QApplication(sys.argv)
    9.  
    10. msgBox = QtGui.QMessageBox()
    11. msgBox.setText('Cool message')
    12. msgBox.show();
    13. sys.exit(app.exec_())
    14.  
    15. if __name__ == '__main__':
    16. main()
    To copy to clipboard, switch view to plain text mode 

  3. #3

    Default Re: how to create a message box in pyside?

    Chris is right, you need use QMessageBox. If you want to add more buttons to the message box, you can check this post

Similar Threads

  1. pyside question pls help
    By sujan.dasmahapatra in forum Qt Programming
    Replies: 0
    Last Post: 12th July 2013, 10:44
  2. how to create message queue in qt
    By gauravg in forum Qt Programming
    Replies: 1
    Last Post: 17th November 2011, 12:36
  3. Qt Designer and PySide
    By moabi in forum Newbie
    Replies: 0
    Last Post: 25th August 2011, 08:40
  4. Pyside needs QT?
    By junichiro in forum Installation and Deployment
    Replies: 0
    Last Post: 30th July 2011, 15:13
  5. Replies: 7
    Last Post: 18th May 2010, 12:49

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.