Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 import rospy
00020
00021 from python_qt_binding.QtGui import *
00022 from python_qt_binding.QtCore import *
00023
00024 from airbus_pyqt_extend.QtAgiCore import loadRsc
00025
00026 rsc = loadRsc("airbus_pyqt_extend")
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 class QAgiMessageBox(QMessageBox):
00038
00039 STYLE = "QLabel{font-size: 18pt; font-weight:40; color: #000000;} \
00040 QPushButton{ background-color:qlineargradient(x1: 0, \
00041 y1: 0, \
00042 x2: 0, \
00043 y2: 1, \
00044 stop: 0 #2ca1cf, \
00045 stop: 1 #0482bb); \
00046 border: 2px #616763; border-radius: 5px; \
00047 font-size: 16pt; font-weight:40; color: #000000;\
00048 width:100px; \
00049 height:40px}"
00050
00051 INFO = QMessageBox.Information
00052 WARN = QMessageBox.Warning
00053 CRITICAL = QMessageBox.Critical
00054 QUESTION = QMessageBox.Question
00055
00056 def __init__(self, type=None, msg=None):
00057 """! The constructor."""
00058
00059 QMessageBox.__init__(self)
00060 self.setWindowFlags(Qt.FramelessWindowHint)
00061 self.setMinimumSize(QSize(600,300))
00062
00063 style_base = ""
00064
00065 if type == QMessageBox.Information:
00066 self.setIcon(QMessageBox.Information)
00067 style_base = "QMessageBox{ border: 2px solid bleu;}"
00068 elif type == QMessageBox.Warning:
00069 self.setIcon(QMessageBox.Warning)
00070 style_base = "QMessageBox{ border: 2px solid yellow;}"
00071 elif type == QMessageBox.Critical:
00072 self.setIcon(QMessageBox.Critical)
00073 style_base = "QMessageBox{ border: 2px solid red;}"
00074 elif type == QMessageBox.Question:
00075 self.setIcon(QMessageBox.Question)
00076 style_base = "QMessageBox{ border: 2px solid blue;}"
00077 else:
00078 self.setIcon(QMessageBox.NoIcon)
00079
00080 self.setStyleSheet(style_base+self.STYLE)
00081
00082 if msg is not None:
00083 self.setText(msg)
00084
00085 def setStyle(self, style):
00086 self.STYLE = style
00087
00088
00089