TpScrollPanel 类
V0.1.1SingleGUIwidgets
2025-09-17
继承关系
基础信息
头文件: | include <TpScrollPanel.h> |
---|---|
Cmake: | None |
发布版本: | V0.1.1 |
继承类: | TpChildWidget |
派生类: |
Public 成员函数
TpScrollPanel(TpChildWidget *parent=nullptr) | ||
---|---|---|
~TpScrollPanel() | ||
horizontalScrollBarValue() | 获取水平方向滚动条的值 | |
setHorizontalScrollBarValue(const uint32_t &value) | 设置水平方向滚动条的值 | |
verticalScrollBarValue() | 获取垂直方向滚动条的值 | |
setVerticalScrollBarValue(const uint32_t &value) | 设置垂直方向滚动条的值 | |
horizontalPostion() | 水平滚动条距离偏移像素量 | |
setHorizontalPostion(const int32_t &value) | 设置水平偏移量 | |
verticalPostion() | 垂直滚动条距离偏移像素量 | |
setVerticalPostion(const int32_t &value) | 设置垂直偏移量 | |
scrollMode() | 获取当前滚动模式 | |
setScrollMode(const bool &isVertical=true) | 设置滚轮滚动模式,默认滚轮滚动滚纵向 | |
setHorizontalScrollBarVisible(const bool &visible) | 设置水平进度条显隐 | |
setVerticalScrollBarVisible(const bool &visible) | 设置垂直进度条显隐 | |
addObject(TpChildWidget *object) | 向滚动窗口添加组件,组件坐标、宽高需外部手动设置 | |
delObject(TpChildWidget *object) | ||
setWidget(TpChildWidget *widget) | 设置滚动区域的窗口,内部会调整窗口充满滚动区域 | |
TpChildWidget * | widget() | 获取设置的滚动窗口 |
TpVector< TpChildWidget * > | children() | 获取滚动窗体内所有添加的子组件 |
clearObject() | ||
recal(bool enableOffset=false) | ||
onPaintEvent(TpPaintEvent *event) override | 绘制事件,禁止在该函数调用 paint和update函数 | |
eventFilter(TpObject *watched, TpEvent *event) override | 事件过滤器处理函数,对象事件会先进入事件过滤器对象的本函数 | |
onMousePressEvent(TpMouseEvent *event) override | ||
onMouseRleaseEvent(TpMouseEvent *event) override | ||
onMouseMoveEvent(TpMouseEvent *event) override | ||
onWheelEvent(TpWheelEvent *event) override | ||
onResizeEvent(TpResizeEvent *event) override | ||
onLeaveEvent(TpLeaveEvent *event) override |
成员函数说明
TpScrollPanel::TpScrollPanel(TpChildWidget *parent=nullptr)
暂无注释...
virtual
TpScrollPanel::~TpScrollPanel()
暂无注释...
uint32_t TpScrollPanel::horizontalScrollBarValue()
点击查看...
获取水平方向滚动条的值
返回值:
取值范围为[0,100]
void TpScrollPanel::setHorizontalScrollBarValue(const uint32_t &value)
点击查看...
设置水平方向滚动条的值
参数:
value: 取值范围为[0,100]
uint32_t TpScrollPanel::verticalScrollBarValue()
点击查看...
获取垂直方向滚动条的值
返回值:
取值范围为[0,100]
void TpScrollPanel::setVerticalScrollBarValue(const uint32_t &value)
点击查看...
设置垂直方向滚动条的值
参数:
value: 取值范围为[0,100]
int32_t TpScrollPanel::horizontalPostion()
点击查看...
水平滚动条距离偏移像素量
返回值:
偏移量值
void TpScrollPanel::setHorizontalPostion(const int32_t &value)
点击查看...
设置水平偏移量
参数:
value: 偏移量值
int32_t TpScrollPanel::verticalPostion()
点击查看...
垂直滚动条距离偏移像素量
返回值:
偏移量值
void TpScrollPanel::setVerticalPostion(const int32_t &value)
点击查看...
设置垂直偏移量
参数:
value: 偏移量值
bool TpScrollPanel::scrollMode()
点击查看...
获取当前滚动模式
返回值:
垂直滚动返回true,否则返回false
void TpScrollPanel::setScrollMode(const bool &isVertical=true)
点击查看...
设置滚轮滚动模式,默认滚轮滚动滚纵向
参数:
isVertical: 垂直滚动返回true,否则返回false
void TpScrollPanel::setHorizontalScrollBarVisible(const bool &visible)
点击查看...
设置水平进度条显隐
参数:
visible: true显示,false不显示
void TpScrollPanel::setVerticalScrollBarVisible(const bool &visible)
点击查看...
设置垂直进度条显隐
参数:
visible: true显示,false不显示
virtual
bool TpScrollPanel::addObject(TpChildWidget *object)
点击查看...
向滚动窗口添加组件,组件坐标、宽高需外部手动设置
参数:
object: 组件指针
返回值:
返回添加结果
virtual
bool TpScrollPanel::delObject(TpChildWidget *object)
暂无注释...
virtual
bool TpScrollPanel::setWidget(TpChildWidget *widget)
点击查看...
设置滚动区域的窗口,内部会调整窗口充满滚动区域
参数:
widget: 窗口指针
返回值:
添加结果
TpChildWidget * TpScrollPanel::widget()
点击查看...
获取设置的滚动窗口
返回值:
窗口指针,不存在则返回空
TpVector< TpChildWidget * > TpScrollPanel::children()
点击查看...
获取滚动窗体内所有添加的子组件
返回值:
子组件列表
bool TpScrollPanel::clearObject()
暂无注释...
virtual
bool TpScrollPanel::recal(bool enableOffset=false)
暂无注释...
virtual
bool TpScrollPanel::onPaintEvent(TpPaintEvent *event) override
点击查看...
绘制事件,禁止在该函数调用 paint和update函数
参数:
event: 绘制事件指针
返回值:
返回true继续执行子控件绘制
virtual
bool TpScrollPanel::eventFilter(TpObject *watched, TpEvent *event) override
点击查看...
事件过滤器处理函数,对象事件会先进入事件过滤器对象的本函数
参数:
watched: 触发事件的对象指针
参数:
event: 事件指针
返回值:
如果返回true则不再触发watched对象本身的事件回调,返回false则本函数执行完毕后会执行watched对象的事件回调