forked from goldendict/goldendict
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainstatusbar.hh
47 lines (35 loc) · 1 KB
/
mainstatusbar.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/* This file is (c) 2012 Tvangeste <[email protected]>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#ifndef MAINSTATUSBAR_HH
#define MAINSTATUSBAR_HH
#include <QWidget>
#include <QLabel>
#include <QString>
#include <QTimer>
class MainStatusBar : public QWidget
{
Q_OBJECT
Q_PROPERTY(bool hasImage READ hasImage)
public:
explicit MainStatusBar(QWidget * parent);
QString currentMessage() const;
signals:
public slots:
void showMessage(const QString & text, int timeout = 0, const QPixmap & pixmap = QPixmap());
void clearMessage();
void setBackgroundMessage( QString const & message );
protected:
virtual void mousePressEvent(QMouseEvent * event);
private:
// component to display a small picture
QLabel * picWidget;
// component to display text
QLabel * textWidget;
QTimer * timer;
QString backgroungMessage;
QString message;
bool eventFilter(QObject *obj, QEvent * event);
void refresh();
bool hasImage() const;
};
#endif // MAINSTATUSBAR_HH