def qMsgBoxAbout(parentWidg, titleMsgBx, messageMsgBx): qmsgParent = None if(parentWidg is not None): qmsgParent = parentWidg reply = QMessageBox.Ok try: reply = QMessageBox.about(qmsgParent, titleMsgBx, messageMsgBx) except: parentScreen = QtGui.QApplication.desktop().screen(QtGui.QApplication.desktop().primaryScreen()) qmsgParent = QtGui.QMainWindow(parentScreen) reply = QMessageBox.about(qmsgParent, titleMsgBx, messageMsgBx) return reply
def about_message(message, parent=None): """ Shows an about message :param message: str :param parent: QWidget """ parent = None message_box = QMessageBox(parent) flags = message_box.windowFlags( ) ^ Qt.WindowContextHelpButtonHint | Qt.WindowStaysOnTopHint message_box.setWindowFlags(flags) message_box.about(parent, 'About', message)