Answers for "pyqt message box set detailed text"

2

pyqt5 messagebox seticon

messageBox.setIcon(QMessageBox.Information)
Posted by: Guest on December-06-2020
0

qmessagebox pyqt5

import sys
from PyQt4.QtGui import *
from PyQt4.QtCore import *

def window():
   app = QApplication(sys.argv)
   w = QWidget()
   b = QPushButton(w)
   b.setText("Show message!")

   b.move(50,50)
   b.clicked.connect(showdialog)
   w.setWindowTitle("PyQt Dialog demo")
   w.show()
   sys.exit(app.exec_())
	
def showdialog():
   msg = QMessageBox()
   msg.setIcon(QMessageBox.Information)

   msg.setText("This is a message box")
   msg.setInformativeText("This is additional information")
   msg.setWindowTitle("MessageBox demo")
   msg.setDetailedText("The details are as follows:")
   msg.setStandardButtons(QMessageBox.Ok | QMessageBox.Cancel)
   msg.buttonClicked.connect(msgbtn)
	
   retval = msg.exec_()
   print "value of pressed message box button:", retval
	
def msgbtn(i):
   print "Button pressed is:",i.text()
	
if __name__ == '__main__': 
   window()
Posted by: Guest on June-09-2020
0

pyqt message box set detailed text

msg.setDetailedText("The details are as follows:")
Posted by: Guest on December-06-2020
1

qmessagebox icon pyqt5

# Question
# Information
# Warning
# Critical

# Example:
msg.setIcon(QMessageBox.Information)
Posted by: Guest on December-01-2020

Python Answers by Framework

Browse Popular Code Answers by Language