00001 #ifndef QTOPPANEL_H 00002 #define QTOPPANEL_H 00003 00004 #include <QWidget> 00005 #include <QLabel> 00006 #include <QPushButton> 00007 #include <QHBoxLayout> 00008 #include <QMouseEvent> 00009 00010 namespace Ui { 00011 class QTopPanel; 00012 } 00013 00014 class QTopPanel : public QWidget 00015 { 00016 Q_OBJECT 00017 00018 public: 00019 explicit QTopPanel(QWidget *parent = 0); 00020 ~QTopPanel(); 00021 00022 void setPixmap(QPixmap icon); 00023 void setText(QString text); 00024 void setRefreshIcon(QIcon icon); 00025 void setBackIcon(QIcon icon); 00026 void setInfoWidget(QWidget *infoWidget); 00027 void setBackVisible(bool visible); 00028 00029 private: 00030 QPushButton *back; 00031 QPushButton *refresh; 00032 QLabel *icon; 00033 QLabel *text; 00034 00035 QWidget *infoWidget; 00036 00037 protected: 00038 void mousePressEvent(QMouseEvent *); 00039 00040 signals: 00041 void clicked(); 00042 void backPressed(); 00043 void refreshPressed(); 00044 00045 public slots: 00046 void hideInfoWidget(); 00047 void showInfoWidget(); 00048 void toggleInfoWidget(); 00049 }; 00050 00051 #endif // QTOPPANEL_H