2016-03-19 10:52:53 +00:00
|
|
|
#ifndef TABS_H
|
|
|
|
#define TABS_H
|
|
|
|
|
|
|
|
#include <QWidget>
|
2016-05-30 08:25:02 +00:00
|
|
|
#include "lib/theme.h"
|
2016-03-19 10:52:53 +00:00
|
|
|
|
2016-05-30 06:51:46 +00:00
|
|
|
class TabsPrivate;
|
2016-03-19 10:52:53 +00:00
|
|
|
|
|
|
|
class Tabs : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit Tabs(QWidget *parent = 0);
|
|
|
|
~Tabs();
|
|
|
|
|
2016-05-30 06:51:46 +00:00
|
|
|
void addTab(const QString &text);
|
|
|
|
|
2016-05-30 08:25:02 +00:00
|
|
|
void setRippleStyle(Material::RippleStyle style);
|
|
|
|
|
2016-05-30 06:51:46 +00:00
|
|
|
const QLayout *tabLayout() const;
|
|
|
|
int currentIndex() const;
|
2016-03-19 10:52:53 +00:00
|
|
|
|
2016-05-30 06:51:46 +00:00
|
|
|
signals:
|
|
|
|
void currentChanged(int);
|
2016-03-19 10:52:53 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
|
|
|
|
void moveEvent(QMoveEvent *event) Q_DECL_OVERRIDE;
|
|
|
|
void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
|
|
|
|
|
2016-05-30 06:51:46 +00:00
|
|
|
const QScopedPointer<TabsPrivate> d_ptr;
|
2016-03-19 10:52:53 +00:00
|
|
|
|
2016-05-30 06:51:46 +00:00
|
|
|
private slots:
|
|
|
|
void switchTab();
|
2016-03-19 10:52:53 +00:00
|
|
|
|
|
|
|
private:
|
2016-05-30 06:51:46 +00:00
|
|
|
Q_DISABLE_COPY(Tabs)
|
|
|
|
Q_DECLARE_PRIVATE(Tabs)
|
2016-03-19 10:52:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // TABS_H
|