1 Star 0 Fork 0

tongy boys/material-pri

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
qtmaterialslider.h 1.70 KB
一键复制 编辑 原始数据 按行查看 历史
#ifndef QTMATERIALSLIDER_H
#define QTMATERIALSLIDER_H
#include "qtmaterialwidgets.h"
#include <QAbstractSlider>
#include <QScopedPointer>
#define QT_MATERIAL_SLIDER_MARGIN 30
class QtMaterialSliderPrivate;
class QTMATERIALWIDGETS_EXPORT QtMaterialSlider : public QAbstractSlider
{
Q_OBJECT
Q_PROPERTY(bool pageStepMode READ pageStepMode WRITE setPageStepMode)
Q_PROPERTY(QColor thumbColor READ thumbColor WRITE setThumbColor)
Q_PROPERTY(QColor trackColor READ trackColor WRITE setTrackColor)
Q_PROPERTY(QColor disabledColor READ disabledColor WRITE setDisabledColor)
public:
explicit QtMaterialSlider(QWidget *parent = nullptr);
~QtMaterialSlider() override;
bool pageStepMode() const;
void setPageStepMode(bool pageStep);
void setInvertedAppearance(bool value);
bool useThemeColors() const;
void setUseThemeColors(bool value);
QColor thumbColor() const;
void setThumbColor(const QColor &color);
QColor trackColor() const;
void setTrackColor(const QColor &color);
QColor disabledColor() const;
void setDisabledColor(const QColor &color);
protected:
void updateThumbOffset();
const QScopedPointer<QtMaterialSliderPrivate> d_ptr;
private:
Q_DISABLE_COPY(QtMaterialSlider)
Q_DECLARE_PRIVATE(QtMaterialSlider)
// QWidget interface
public:
QSize minimumSizeHint() const override;
protected:
void sliderChange(SliderChange change) override;
void mouseMoveEvent(QMouseEvent *event) override;
void mousePressEvent(QMouseEvent *event) override;
void mouseReleaseEvent(QMouseEvent *event) override;
void leaveEvent(QEvent *event) override;
bool event(QEvent *event) override;
};
#endif // QTMATERIALSLIDER_H
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/tongynj/material-pri.git
git@gitee.com:tongynj/material-pri.git
tongynj
material-pri
material-pri
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385