22 #include <QHBoxLayout>
31 , mDuration( duration )
33 , mUserIcon( QIcon() )
44 , mDuration( duration )
46 , mUserIcon( QIcon() )
57 , mDuration( duration )
59 , mUserIcon( QIcon() )
70 , mDuration( duration )
72 , mUserIcon( QIcon() )
86 mLayout =
new QHBoxLayout(
this );
87 mLayout->setContentsMargins( 0, 0, 0, 0 );
105 QString msgIcon(
"/mIconInfo.png" );
109 msgIcon = QString(
"/mIconCritical.png" );
112 msgIcon = QString(
"/mIconWarn.png" );
119 mLblIcon->setPixmap( icon.pixmap( 24 ) );
136 mTextEdit->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Maximum );
138 mTextEdit->setFrameShape( QFrame::NoFrame );
141 mTextEdit->setStyleSheet(
"* { background-color: rgba(0,0,0,0); margin-top: 0.25em; max-height: 1.75em; min-height: 1.75em; } "
142 "QScrollBar::add-page,QScrollBar::sub-page,QScrollBar::handle { background-color: rgba(0,0,0,0); color: rgba(0,0,0,0); }" );
145 QString content =
mText;
149 QString t =
mTitle.trimmed();
150 if ( !t.endsWith(
":" ) && !content.isEmpty() )
152 content.prepend( QString(
"<b>" ) + t +
"</b>" );
160 QLayoutItem *item =
mLayout->itemAt( 2 );
161 if ( !item || item->widget() !=
mWidget )
170 mStyleSheet =
"QgsMessageBar { background-color: #d65253; border: 1px solid #9b3d3d; } "
171 "QLabel,QTextEdit { color: white; } ";
175 mStyleSheet =
"QgsMessageBar { background-color: #ffc800; border: 1px solid #e0aa00; } "
176 "QLabel,QTextEdit { color: black; } ";
180 mStyleSheet =
"QgsMessageBar { background-color: #e7f5fe; border: 1px solid #b9cfe4; } "
181 "QLabel,QTextEdit { color: #2554a1; } ";
183 mStyleSheet +=
"QLabel#mItemCount { font-style: italic; }";
214 if ( item->widget() ==
mWidget )
216 delete item->widget();