qt-material-widgets/components/qtmaterialtabs.h

61 lines
1.2 KiB
C
Raw Normal View History

2017-09-29 17:25:42 +00:00
#ifndef QTMATERIALTABS_H
#define QTMATERIALTABS_H
#include <QtWidgets/QWidget>
#include <QIcon>
#include "lib/qtmaterialtheme.h"
2022-02-17 03:03:49 +00:00
namespace md
{
2017-09-29 17:25:42 +00:00
2022-02-17 03:03:49 +00:00
class TabsPrivate;
class Tab;
2017-09-29 17:25:42 +00:00
2022-02-17 03:03:49 +00:00
class Tabs : public QWidget
2017-09-29 17:25:42 +00:00
{
Q_OBJECT
public:
2022-02-17 03:03:49 +00:00
explicit Tabs(QWidget *parent = 0);
~Tabs();
2017-09-29 17:25:42 +00:00
void setUseThemeColors(bool value);
bool useThemeColors() const;
void setHaloVisible(bool value);
bool isHaloVisible() const;
void setRippleStyle(Material::RippleStyle style);
Material::RippleStyle rippleStyle() 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, const QIcon &icon = QIcon());
2022-02-17 03:03:49 +00:00
void setCurrentTab(Tab *tab);
2017-09-29 17:25:42 +00:00
void setCurrentTab(int index);
int currentIndex() const;
signals:
void currentChanged(int);
protected:
void setTabActive(int index, bool active = true);
void updateTabs();
2022-02-17 03:03:49 +00:00
const QScopedPointer<TabsPrivate> d_ptr;
2017-09-29 17:25:42 +00:00
private:
2022-02-17 03:03:49 +00:00
Q_DISABLE_COPY(Tabs)
Q_DECLARE_PRIVATE(Tabs)
2017-09-29 17:25:42 +00:00
};
2022-02-17 03:03:49 +00:00
}
2017-09-29 17:25:42 +00:00
#endif // QTMATERIALTABS_H