tpLine类
SingleGUI
2025-07-05
介绍
分割线组件
继承关系
基础信息
头文件: | include <tpLine.h> |
---|---|
Cmake: | None |
发布版本: | V0.1.0 |
继承类: | tpChildWidget |
派生类: |
Public 类型
enum LineType {
VLine, HLine
}
Public 成员函数
tpLine(tpChildWidget *parent=nullptr) | ||
---|---|---|
~tpLine() | ||
setLineType(const LineType &type=HLine) | 设置线类型是水平还是垂直,设置后会调整line组件的最小宽高 | |
setLineLength(const uint32_t &length) | 设置绘制线的长度,设置后auto模式为false | |
setLineLengthMode(const bool &isAuto=true) | 设置线长模式,自动则根据组件宽度/高度绘制 | |
setAlign(const tinyPiX::AlignmentFlag &alignment=tinyPiX::AlignCenter) | 设置居中模式 | |
setColor(const int32_t &color) | 设置线条颜色 | |
setLineWidth(const uint32_t &width=1) | 设置线宽,默认为1 |
Protected成员函数
onPaintEvent(tpObjectPaintEvent *event) override | 绘制事件,禁止在该函数调用 paint和update函数 | |
---|---|---|
onResizeEvent(tpObjectResizeEvent *event) override | ||
onThemeChangeEvent(tpThemeChangeEvent *event) override | ||
virtual tpString | pluginType() override | 组件类名,子类实现,返回子类类名字符串,用于匹配CSS中对应样式 |
成员枚举类型说明
enum tpLine::LineType
名称 | 值 | 描述 |
---|---|---|
VLine | 0 | |
HLine | 1 |
成员函数说明
tpLine::tpLine(tpChildWidget *parent=nullptr)
暂无注释...
virtual
tpLine::~tpLine()
暂无注释...
void tpLine::setLineType(const LineType &type=HLine)
点击查看...
设置线类型是水平还是垂直,设置后会调整line组件的最小宽高
void tpLine::setLineLength(const uint32_t &length)
点击查看...
设置绘制线的长度,设置后auto模式为false
void tpLine::setLineLengthMode(const bool &isAuto=true)
点击查看...
设置线长模式,自动则根据组件宽度/高度绘制
void tpLine::setAlign(const tinyPiX::AlignmentFlag &alignment=tinyPiX::AlignCenter)
点击查看...
设置居中模式
void tpLine::setColor(const int32_t &color)
点击查看...
设置线条颜色
void tpLine::setLineWidth(const uint32_t &width=1)
点击查看...
设置线宽,默认为1
virtual
bool tpLine::onPaintEvent(tpObjectPaintEvent *event) override
点击查看...
绘制事件,禁止在该函数调用 paint和update函数
返回值:
返回true继续执行子控件绘制
virtual
bool tpLine::onResizeEvent(tpObjectResizeEvent *event) override
暂无注释...
virtual
void tpLine::onThemeChangeEvent(tpThemeChangeEvent *event) override
暂无注释...
virtual
tpString tpLine::pluginType() override
点击查看...
组件类名,子类实现,返回子类类名字符串,用于匹配CSS中对应样式
返回值:
类名字符串