Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

pyqt5 message box

# in pyqt5 it needs to be PyQt5.QtWidgets
msg=QMessageBox() # create an instance of it
msg.setIcon(QMessageBox.Information) # set icon
msg.setText("This is a message box") # set text
msg.setInformativeText("This is additional information") # set information under the main text
msg.setWindowTitle("MessageBox demo") # set title
msg.setDetailedText("The details are as follows:") # a button for more details will add in
msg.setStandardButtons(QMessageBox.Ok | QMessageBox.Cancel) # type of buttons associated
msg.buttonClicked.connect(myfunc) # connect clicked signal
return_value =msg.exec_() # get the return value
print("value of pressed message box button:", str(return_value)) # print result
Comment

pyqt5 message box

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:")
Comment

pyqt5 message box

msg.setStandardButtons(QMessageBox.Ok | QMessageBox.Cancel)
Comment

pyqt5 message box

msg.buttonClicked.connect(msgbtn)
Comment

PREVIOUS NEXT
Code Example
Python :: gráfico barras python 
Python :: csv len python 
Python :: python advanced programs time module 
Python :: python create a dictionary of integers 
Python :: python convert int to hex string 
Python :: pandas fillna with another column 
Python :: python train test val split 
Python :: list comprehesion python 
Python :: count occurrences of character in string python using dictionary 
Python :: python do something while waiting for input 
Python :: Iterate through string backwards in python 
Python :: in python 
Python :: scikit learn train test split 
Python :: python openpyxl csv to excel 
Python :: delete occurrences of an element if it occurs more than n times python 
Python :: python string cut right 
Python :: pandas convert string column to int list column 
Python :: beautifulsoup find text contains 
Python :: python plot horizontal line 
Python :: how to swap two variables without using third variable python 
Python :: python dictionary multiple same keys 
Python :: replace comma with dot in column pandas 
Python :: pandas do not display index 
Python :: how to check if value is in list python 
Python :: docker build python fastapi 
Python :: iterate through directories in python 
Python :: hungry chef 
Python :: assosciate keys as list to values in python 
Python :: importing python module from different directory 
Python :: check for prime in python 
ADD CONTENT
Topic
Content
Source link
Name
8+1 =