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(
"QTextEdit { background-color: rgba(0,0,0,0); margin-top: 0.25em; max-height: 1.75em; min-height: 1.75em; } "
142 "QScrollBar { background-color: rgba(0,0,0,0); } "
143 "QScrollBar::add-page,QScrollBar::sub-page,QScrollBar::handle { background-color: rgba(0,0,0,0); color: rgba(0,0,0,0); } "
144 "QScrollBar::up-arrow,QScrollBar::down-arrow { color: rgb(0,0,0); } " );
147 QString content =
mText;
151 QString t =
mTitle.trimmed();
152 if ( !t.endsWith(
":" ) && !content.isEmpty() )
154 content.prepend( QString(
"<b>" ) + t +
"</b>" );
162 QLayoutItem *item =
mLayout->itemAt( 2 );
163 if ( !item || item->widget() !=
mWidget )
172 mStyleSheet =
"QgsMessageBar { background-color: #d65253; border: 1px solid #9b3d3d; } "
173 "QLabel,QTextEdit { color: white; } ";
177 mStyleSheet =
"QgsMessageBar { background-color: #ffc800; border: 1px solid #e0aa00; } "
178 "QLabel,QTextEdit { color: black; } ";
182 mStyleSheet =
"QgsMessageBar { background-color: #e7f5fe; border: 1px solid #b9cfe4; } "
183 "QLabel,QTextEdit { color: #2554a1; } ";
185 mStyleSheet +=
"QLabel#mItemCount { font-style: italic; }";
216 if ( item->widget() ==
mWidget )
218 delete item->widget();