17 #ifndef QGSMESSAGEBAR_H
18 #define QGSMESSAGEBAR_H
137 void pushMessage(
const QString &text,
Qgis::MessageLevel level = Qgis::MessageLevel::Info,
int duration = -1 );
149 void pushMessage(
const QString &title,
const QString &text,
Qgis::MessageLevel level = Qgis::MessageLevel::Info,
int duration = -1 );
162 void pushMessage(
const QString &title,
const QString &text,
const QString &showMore,
Qgis::MessageLevel level = Qgis::MessageLevel::Info,
int duration = -1 );
174 QList<QgsMessageBarItem *> items();
180 static int defaultMessageTimeout(
Qgis::MessageLevel level = Qgis::MessageLevel::NoLevel );
219 void pushSuccess(
const QString &title,
const QString &message );
229 void pushInfo(
const QString &title,
const QString &message );
239 void pushWarning(
const QString &title,
const QString &message );
249 void pushCritical(
const QString &title,
const QString &message );
252 void mousePressEvent( QMouseEvent *e )
override;
258 QList<QgsMessageBarItem *> mItems;
259 QMenu *mCloseMenu =
nullptr;
260 QToolButton *mCloseBtn =
nullptr;
261 QGridLayout *mLayout =
nullptr;
262 QLabel *mItemCount =
nullptr;
263 QAction *mActionCloseAll =
nullptr;
264 QTimer *mCountdownTimer =
nullptr;
265 QProgressBar *mCountProgress =
nullptr;
266 QString mCountStyleSheet;
269 static constexpr
int MAX_ITEMS = 100;
271 void removeLowestPriorityOldestItem();
275 void updateItemCount();
278 void updateCountdown();
279 void resetCountdown();
281 friend class TestQgsMessageBar;
MessageLevel
Level for messages This will be used both for message log and message bar in application.
Represents an item shown within a QgsMessageBar widget.
A bar for displaying non-blocking messages to the user.
void widgetAdded(QgsMessageBarItem *item)
Emitted whenever an item is added to the bar.
void widgetRemoved(QgsMessageBarItem *item)
Emitted whenever an item was removed from the bar.