@@ -31,29 +31,46 @@ class QToolButton;
31
31
32
32
/* * \ingroup gui
33
33
* A bar for displaying non-blocking messages to the user.
34
- * \note added in 1.8
34
+ * \note added in 1.9
35
35
*/
36
- class QgsMessageBar : public QFrame
36
+ class GUI_EXPORT QgsMessageBar: public QFrame
37
37
{
38
38
Q_OBJECT
39
+
39
40
public:
40
41
QgsMessageBar ( QWidget *parent = 0 );
41
42
~QgsMessageBar ();
42
43
44
+ /* ! display a widget on the bar after hiding the currently visible one
45
+ * and putting it in a stack
46
+ * @param level is 0 for information, 1 for warning, 2 for critical
47
+ */
43
48
void pushWidget ( QWidget *widget, int level = 0 );
44
- void pushWidget ( QWidget *widget, const QString &styleSheet );
45
49
50
+ /* ! remove the passed widget from the bar (if previously added),
51
+ * then display the next one in the stack if any or hide the bar
52
+ * @return true if the widget was removed, false otherwise
53
+ */
46
54
bool popWidget ( QWidget *widget );
47
55
56
+ // ! make out a widget containing a message to be displayed on the bar
48
57
static QWidget* createMessage ( const QString &text, QWidget *parent = 0 ) { return createMessage ( QString::null, text, QIcon (), parent ); }
58
+ // ! make out a widget containing icon and message to be displayed on the bar
49
59
static QWidget* createMessage ( const QString &text, const QIcon &icon, QWidget *parent = 0 ) { return createMessage ( QString::null, text, icon, parent ); }
60
+ // ! make out a widget containing title and message to be displayed on the bar
50
61
static QWidget* createMessage ( const QString &title, const QString &text, QWidget *parent = 0 ) { return createMessage ( title, text, QIcon (), parent ); }
62
+ // ! make out a widget containing icon, title and message to be displayed on the bar
51
63
static QWidget* createMessage ( const QString &title, const QString &text, const QIcon &icon, QWidget *parent = 0 );
52
64
53
65
signals:
66
+ // ! emitted when a widget was removed from the bar
54
67
void widgetRemoved ( QWidget *widget );
55
68
56
69
public slots:
70
+ /* ! remove the currently displayed widget from the bar and
71
+ * display the next in the stack if any or hide the bar
72
+ * @return true if the widget was removed, false otherwise
73
+ */
57
74
bool popWidget ();
58
75
59
76
private:
@@ -72,6 +89,9 @@ class QgsMessageBar: public QFrame
72
89
QString mStyleSheet ;
73
90
};
74
91
92
+ // ! display a widget on the bar
93
+ void pushWidget ( QWidget *widget, const QString &styleSheet );
94
+
75
95
void popItem ( QgsMessageBarItem *item );
76
96
void pushItem ( QgsMessageBarItem *item );
77
97
0 commit comments