qt-material-widgets/components/tabs.h

58 lines
1.2 KiB
C
Raw Normal View History

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
class TabsPrivate;
2016-03-19 10:52:53 +00:00
class Tabs : public QWidget
{
Q_OBJECT
2016-06-05 12:07:56 +00:00
Q_PROPERTY(QColor inkColor WRITE setInkColor READ inkColor)
Q_PROPERTY(QColor backgroundColor WRITE setBackgroundColor READ backgroundColor)
Q_PROPERTY(QColor textColor WRITE setTextColor READ textColor)
2016-03-19 10:52:53 +00:00
public:
explicit Tabs(QWidget *parent = 0);
~Tabs();
2016-06-05 12:07:56 +00:00
void setUseThemeColors(bool value);
bool useThemeColors() const;
void setInkColor(const QColor &color);
QColor inkColor() const;
void setBackgroundColor(const QColor &color);
QColor backgroundColor() const;
void setTextColor(const QColor &color);
QColor textColor() const;
void addTab(const QString &text);
2016-05-30 08:25:02 +00:00
void setRippleStyle(Material::RippleStyle style);
const QLayout *tabLayout() const;
int currentIndex() const;
2016-03-19 10:52:53 +00:00
signals:
void currentChanged(int);
2016-03-19 10:52:53 +00:00
protected:
void moveEvent(QMoveEvent *event) Q_DECL_OVERRIDE;
void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
const QScopedPointer<TabsPrivate> d_ptr;
2016-03-19 10:52:53 +00:00
private slots:
void switchTab();
2016-03-19 10:52:53 +00:00
private:
Q_DISABLE_COPY(Tabs)
Q_DECLARE_PRIVATE(Tabs)
2016-03-19 10:52:53 +00:00
};
#endif // TABS_H