QGIS API Documentation
2.2.0-Valmiera
|
A bar for displaying non-blocking messages to the user. More...
#include <qgsmessagebar.h>
Public Types | |
enum | MessageLevel { INFO = 0, WARNING = 1, CRITICAL = 2 } |
Public Slots | |
bool | popWidget () |
bool | clearWidgets () |
Signals | |
void | widgetAdded (QgsMessageBarItem *item) |
emitted when a message widget is added to the bar | |
void | widgetRemoved (QgsMessageBarItem *item) |
emitted when a message widget was removed from the bar |
Public Member Functions | |
QgsMessageBar (QWidget *parent=0) | |
~QgsMessageBar () | |
void | pushItem (QgsMessageBarItem *item) |
QgsMessageBarItem * | pushWidget (QWidget *widget, MessageLevel level=INFO, int duration=0) |
bool | popWidget (QgsMessageBarItem *item) |
void | pushMessage (const QString &text, MessageLevel level=INFO, int duration=0) |
convenience method for pushing a message to the bar | |
void | pushMessage (const QString &title, const QString &text, MessageLevel level=INFO, int duration=0) |
convenience method for pushing a message with title to the bar |
Static Public Member Functions | |
static QgsMessageBarItem * | createMessage (const QString &text, QWidget *parent=0) |
make out a widget containing a message to be displayed on the bar | |
static QgsMessageBarItem * | createMessage (const QString &title, const QString &text, QWidget *parent=0) |
make out a widget containing title and message to be displayed on the bar | |
static QgsMessageBarItem * | createMessage (QWidget *widget, QWidget *parent=0) |
make out a widget containing title and message to be displayed on the bar |
Protected Member Functions | |
void | mousePressEvent (QMouseEvent *e) |
Private Slots | |
void | updateItemCount () |
updates count of items in widget list | |
void | updateCountdown () |
updates the countdown for widgets that have a timeout duration | |
void | resetCountdown () |
Private Member Functions | |
void | popItem (QgsMessageBarItem *item) |
void | showItem (QgsMessageBarItem *item) |
Private Attributes | |
QgsMessageBarItem * | mCurrentItem |
QList< QgsMessageBarItem * > | mItems |
QMenu * | mCloseMenu |
QToolButton * | mCloseBtn |
QGridLayout * | mLayout |
QLabel * | mItemCount |
QAction * | mActionCloseAll |
QTimer * | mCountdownTimer |
QProgressBar * | mCountProgress |
QString | mCountStyleSheet |
A bar for displaying non-blocking messages to the user.
Definition at line 43 of file qgsmessagebar.h.
Definition at line 48 of file qgsmessagebar.h.
QgsMessageBar::QgsMessageBar | ( | QWidget * | parent = 0 | ) |
Definition at line 33 of file qgsmessagebar.cpp.
References clearWidgets(), QgsApplication::getThemeIcon(), mActionCloseAll, mCloseBtn, mCloseMenu, mCountdownTimer, mCountProgress, mCountStyleSheet, mItemCount, mLayout, popWidget(), tr, updateCountdown(), updateItemCount(), widgetAdded(), and widgetRemoved().
QgsMessageBar::~QgsMessageBar | ( | ) |
Definition at line 101 of file qgsmessagebar.cpp.
|
slot |
remove all items from the bar's widget list
Definition at line 195 of file qgsmessagebar.cpp.
References mCurrentItem, mItems, and popWidget().
Referenced by QgsMessageBar().
|
static |
make out a widget containing a message to be displayed on the bar
Definition at line 278 of file qgsmessagebar.cpp.
References INFO.
|
static |
make out a widget containing title and message to be displayed on the bar
Definition at line 284 of file qgsmessagebar.cpp.
References INFO.
|
static |
make out a widget containing title and message to be displayed on the bar
Definition at line 289 of file qgsmessagebar.cpp.
References INFO.
|
protected |
Definition at line 105 of file qgsmessagebar.cpp.
References mCountdownTimer, mCountProgress, and mCountStyleSheet.
|
private |
Definition at line 122 of file qgsmessagebar.cpp.
References mCurrentItem, mItems, mLayout, showItem(), and widgetRemoved().
Referenced by popWidget().
bool QgsMessageBar::popWidget | ( | QgsMessageBarItem * | item | ) |
remove the passed widget from the bar (if previously added), then display the next one in the stack if any or hide the bar
item | item to remove |
Definition at line 158 of file qgsmessagebar.cpp.
References mCurrentItem, mItems, and popItem().
|
slot |
remove the currently displayed widget from the bar and display the next in the stack if any or hide the bar
Definition at line 182 of file qgsmessagebar.cpp.
References mCurrentItem, popItem(), and resetCountdown().
Referenced by clearWidgets(), pushItem(), QgsMessageBar(), and updateCountdown().
void QgsMessageBar::pushItem | ( | QgsMessageBarItem * | item | ) |
display a message item on the bar after hiding the currently visible one and putting it in a stack.
item | item to display |
Definition at line 248 of file qgsmessagebar.cpp.
References popWidget(), resetCountdown(), and showItem().
Referenced by pushMessage(), and pushWidget().
|
inline |
convenience method for pushing a message to the bar
Definition at line 87 of file qgsmessagebar.h.
References pushMessage().
Referenced by pushMessage().
void QgsMessageBar::pushMessage | ( | const QString & | title, |
const QString & | text, | ||
QgsMessageBar::MessageLevel | level = INFO , |
||
int | duration = 0 |
||
) |
convenience method for pushing a message with title to the bar
Definition at line 272 of file qgsmessagebar.cpp.
References pushItem().
QgsMessageBarItem * QgsMessageBar::pushWidget | ( | QWidget * | widget, |
QgsMessageBar::MessageLevel | level = INFO , |
||
int | duration = 0 |
||
) |
display a widget as a message on the bar after hiding the currently visible one and putting it in a stack.
widget | message widget to display |
level | is QgsMessageBar::INFO, WARNING or CRITICAL |
duration | timeout duration of message in seconds, 0 value indicates no timeout |
Definition at line 256 of file qgsmessagebar.cpp.
References pushItem(), QgsMessageBarItem::setDuration(), and QgsMessageBarItem::setLevel().
|
privateslot |
Definition at line 311 of file qgsmessagebar.cpp.
References mCountdownTimer, mCountProgress, and mCountStyleSheet.
Referenced by popWidget(), pushItem(), and updateCountdown().
|
private |
Definition at line 209 of file qgsmessagebar.cpp.
References QgsMessageBarItem::duration(), QgsMessageBarItem::getStyleSheet(), mCountdownTimer, mCountProgress, mCurrentItem, mItems, mLayout, and widgetAdded().
Referenced by popItem(), and pushItem().
|
privateslot |
updates the countdown for widgets that have a timeout duration
Definition at line 294 of file qgsmessagebar.cpp.
References mCountdownTimer, mCountProgress, popWidget(), and resetCountdown().
Referenced by QgsMessageBar().
|
privateslot |
updates count of items in widget list
Definition at line 320 of file qgsmessagebar.cpp.
References mCloseBtn, mCloseMenu, mItemCount, mItems, and tr.
Referenced by QgsMessageBar().
|
signal |
emitted when a message widget is added to the bar
Referenced by QgsMessageBar(), and showItem().
|
signal |
emitted when a message widget was removed from the bar
Referenced by popItem(), and QgsMessageBar().
|
private |
Definition at line 122 of file qgsmessagebar.h.
Referenced by QgsMessageBar().
|
private |
Definition at line 119 of file qgsmessagebar.h.
Referenced by QgsMessageBar(), and updateItemCount().
|
private |
Definition at line 118 of file qgsmessagebar.h.
Referenced by QgsMessageBar(), and updateItemCount().
|
private |
Definition at line 123 of file qgsmessagebar.h.
Referenced by mousePressEvent(), QgsMessageBar(), resetCountdown(), showItem(), and updateCountdown().
|
private |
Definition at line 124 of file qgsmessagebar.h.
Referenced by mousePressEvent(), QgsMessageBar(), resetCountdown(), showItem(), and updateCountdown().
|
private |
Definition at line 125 of file qgsmessagebar.h.
Referenced by mousePressEvent(), QgsMessageBar(), and resetCountdown().
|
private |
Definition at line 116 of file qgsmessagebar.h.
Referenced by clearWidgets(), popItem(), popWidget(), and showItem().
|
private |
Definition at line 121 of file qgsmessagebar.h.
Referenced by QgsMessageBar(), and updateItemCount().
|
private |
Definition at line 117 of file qgsmessagebar.h.
Referenced by clearWidgets(), popItem(), popWidget(), showItem(), and updateItemCount().
|
private |
Definition at line 120 of file qgsmessagebar.h.
Referenced by popItem(), QgsMessageBar(), and showItem().