def msgBox(self): msgBox = QMessageBox() msgBox.setWindowTitle("경고창") # 메세지창의 상단 제목 msgBox.setText("돌이 이미 있습니다") # 메세지 내용 msgBox.setStandardButtons(QMessageBox.Yes) msgBox.exec_() msgBox.show()
def show_success(self): message = QMessageBox(self.gui) message.setIcon(QMessageBox.Information) message.setText("KiPEO has compleletly reshaped your e-book.\r\n\r\nWould you like to see what we have changed?") message.setWindowTitle("KiPEO") message.setStandardButtons(QMessageBox.Yes | QMessageBox.No) message.show() user_choice = message.exec_() if user_choice == QMessageBox.Yes: #Show the user what changes we have made, allowing her to #revert them if necessary self.boss.show_current_diff() #Update the editor UI to take into account all the changes we #have made self.boss.apply_container_update_to_gui()
def __init__(self, parent=None, window_title='Select a File', start_dir=os.getcwd(), *args): QFileDialog.__init__(self, parent, window_title, start_dir, *args) self.setWindowFlag(QtCore.Qt.WindowStaysOnTopHint) if sys.platform == 'darwin': self.setOption(QFileDialog.DontUseNativeDialog) self.data = None title = 'Select a csv file to plot' while True: self.file_path: str = self.getOpenFileName(self, title)[0] if self.file_path[-3:] == 'csv': with open(file=self.file_path, mode='r') as csvfile: self.data = csvfile.read() break elif self.file_path == "": break else: dialog = QMessageBox(icon=QMessageBox.Warning) dialog.setText('Please, select a csv file!') dialog.exec_() dialog.show() continue
def msg(message, parent=None): popup = QMessageBox( QMessageBox.Warning, QCoreApplication.translate("@default", "Error in parameters"), message, QMessageBox.Ok, parent) popup.show()