52 lines
1014 B
C
52 lines
1014 B
C
|
|
#ifndef DASHBOARD_H
|
||
|
|
#define DASHBOARD_H
|
||
|
|
|
||
|
|
#include <QObject>
|
||
|
|
|
||
|
|
class QMdiArea;
|
||
|
|
class QPushButton;
|
||
|
|
class QMenu;
|
||
|
|
class DataPanel;
|
||
|
|
|
||
|
|
class Dashboard : public QObject
|
||
|
|
{
|
||
|
|
Q_OBJECT
|
||
|
|
|
||
|
|
public:
|
||
|
|
explicit Dashboard(const QString& strName, QObject *parent = nullptr);
|
||
|
|
~Dashboard();
|
||
|
|
|
||
|
|
const QString& getName();
|
||
|
|
void setName(const QString&);
|
||
|
|
QPushButton* tabButton();
|
||
|
|
QWidget* displayArea();
|
||
|
|
void setSelected(bool);
|
||
|
|
void addPanel(const QString&);
|
||
|
|
void removePanel(const QString&);
|
||
|
|
|
||
|
|
private:
|
||
|
|
void updateTabButtonSize();
|
||
|
|
|
||
|
|
public slots:
|
||
|
|
void contextMenu_tabButton(const QPoint&);
|
||
|
|
void onAction_rename();
|
||
|
|
void onAction_remove();
|
||
|
|
|
||
|
|
void onSignal_removePanel(const QString&);
|
||
|
|
|
||
|
|
signals:
|
||
|
|
void sgl_rename();
|
||
|
|
void sgl_remove();
|
||
|
|
|
||
|
|
private:
|
||
|
|
QString m_strName;
|
||
|
|
QPushButton* m_pTabButton;
|
||
|
|
QMenu* m_pTabBtnMenu;
|
||
|
|
QWidget* m_pDisplayArea;
|
||
|
|
QList<DataPanel*> m_dataPanels;
|
||
|
|
int m_nPanenlNameNumber;
|
||
|
|
};
|
||
|
|
|
||
|
|
|
||
|
|
#endif
|