PDA

View Full Version : how to create a message box in pyside?



markma
28th April 2014, 05:11
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?

ChrisW67
28th April 2014, 06:01
Something like this:


#!/usr/bin/python
# -*- coding: utf-8 -*-

import sys
from PySide import QtGui

def main():
app = QtGui.QApplication(sys.argv)

msgBox = QtGui.QMessageBox()
msgBox.setText('Cool message')
msgBox.show();
sys.exit(app.exec_())

if __name__ == '__main__':
main()

gbstack
28th April 2014, 10:24
Chris is right, you need use QMessageBox. If you want to add more buttons to the message box, you can check this post (http://redino.net/blog/2014/04/pyside-messagebox/)