42 lines
685 B
C++
42 lines
685 B
C++
#ifndef CUSTOMTAB_H
|
|
#define CUSTOMTAB_H
|
|
|
|
#include <QWidget>
|
|
|
|
class QLabel;
|
|
class QPushButton;
|
|
class QBoxLayout;
|
|
class CustomTab : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
CustomTab(QWidget *parent = nullptr);
|
|
virtual ~CustomTab();
|
|
|
|
void setText(const QString&);
|
|
const QString text();
|
|
|
|
void setIcon(const QIcon&);
|
|
|
|
signals:
|
|
void closeTab(QWidget*);
|
|
|
|
protected:
|
|
void enterEvent(QEnterEvent*);
|
|
void leaveEvent(QEvent*);
|
|
|
|
private slots:
|
|
void onCloseButtonClicked();
|
|
|
|
private:
|
|
QIcon m_Icon;
|
|
QSize m_IconSize;
|
|
QLabel* m_pIconLabel;
|
|
QLabel* m_pTitle;
|
|
QPushButton* m_pCloseBtn;
|
|
QBoxLayout* m_pLayout;
|
|
};
|
|
|
|
#endif //CUSTOMTAB_H
|