tpSlider类
SingleGUI
2025-07-05
介绍
可拖动滑块
继承关系
基础信息
头文件: | include <tpSlider.h> |
---|---|
Cmake: | None |
发布版本: | V0.1.0 |
继承类: | tpChildWidget |
派生类: |
Public 类型
enum SliderDirect {
Horizon, Vertical
}
信号
信号名称 | 参数 | 描述 |
---|---|---|
valueChanged | int32_t | 值变化信号 |
rangeChanged | int32_t, int32_t | 范围变化信号 |
Public 成员函数
tpSlider(tpChildWidget *parent=nullptr, const SliderDirect &direct=Horizon) | ||
---|---|---|
~tpSlider() | ||
setRange(const int32_t &min=0, const int32_t &max=100) | 设置取值范围 | |
setDirection(const SliderDirect &direct=Horizon) | 设置滑块条方向 | |
value() | 获取当前值 | |
setValue(const int32_t &value) | 设置当前值 |
Protected成员函数
onMouseKeyEvent(tpMouseKeyEvent *event) override | ||
---|---|---|
onMouseMotionEvent(tpMouseMotionEvent *event) override | ||
onLeaveEvent(tpObjectLeaveEvent *event) override | ||
onPaintEvent(tpObjectPaintEvent *event) override | 绘制事件,禁止在该函数调用 paint和update函数 | |
virtual tpString | pluginType() override | 组件类名,子类实现,返回子类类名字符串,用于匹配CSS中对应样式 |
成员枚举类型说明
enum tpSlider::SliderDirect
名称 | 值 | 描述 |
---|---|---|
Horizon | 0 | |
Vertical | 1 |
成员函数说明
tpSlider::tpSlider(tpChildWidget *parent=nullptr, const SliderDirect &direct=Horizon)
暂无注释...
virtual
tpSlider::~tpSlider()
暂无注释...
virtual
void tpSlider::setRange(const int32_t &min=0, const int32_t &max=100)
点击查看...
设置取值范围
virtual
void tpSlider::setDirection(const SliderDirect &direct=Horizon)
点击查看...
设置滑块条方向
virtual
int32_t tpSlider::value()
点击查看...
获取当前值
virtual
void tpSlider::setValue(const int32_t &value)
点击查看...
设置当前值
virtual
bool tpSlider::onMouseKeyEvent(tpMouseKeyEvent *event) override
暂无注释...
virtual
bool tpSlider::onMouseMotionEvent(tpMouseMotionEvent *event) override
暂无注释...
virtual
bool tpSlider::onLeaveEvent(tpObjectLeaveEvent *event) override
暂无注释...
virtual
bool tpSlider::onPaintEvent(tpObjectPaintEvent *event) override
点击查看...
绘制事件,禁止在该函数调用 paint和update函数
返回值:
返回true继续执行子控件绘制
virtual
tpString tpSlider::pluginType() override
点击查看...
组件类名,子类实现,返回子类类名字符串,用于匹配CSS中对应样式
返回值:
类名字符串