tpLabel类
SingleGUI
2025-07-05
继承关系
基础信息
头文件: | include <tpLabel.h> |
---|---|
Cmake: | None |
发布版本: | V0.1.0 |
继承类: | tpChildWidget |
派生类: | tpFilePathWidgetItem |
Public 成员函数
tpLabel(tpChildWidget *parent=nullptr) | ||
---|---|---|
tpLabel(const tpString &text, tpChildWidget *parent=nullptr) | ||
~tpLabel() | ||
setAutoFit(bool enable=false) | ||
setWordWrap(bool wrap) | 设置label根据文本长度和大小,自动实现换行 | |
setRect(tpRect &rect) | ||
setRect(tpRect *rect) | ||
setRect(ItpRect &rect) | ||
setRect(ItpRect *rect) | ||
setRect(int32_t x, int32_t y, int32_t w, int32_t h) | ||
setText(const tpString &text) | 设置显示文本 | |
virtual tpFont * | font() | 获取文本字体指针 |
setAlign(const tinyPiX::AlignmentFlag align=tinyPiX::AlignLeft) | 设置文本居中模式;当前仅支持水平靠左、靠右、居中 | |
onPaintEvent(tpObjectPaintEvent *event) | 绘制事件,禁止在该函数调用 paint和update函数 | |
onLeaveEvent(tpObjectLeaveEvent *event) override |
Protected成员函数
virtual tpString | pluginType() override | 组件类名,子类实现,返回子类类名字符串,用于匹配CSS中对应样式 |
---|
成员函数说明
tpLabel::tpLabel(tpChildWidget *parent=nullptr)
暂无注释...
tpLabel::tpLabel(const tpString &text, tpChildWidget *parent=nullptr)
暂无注释...
virtual
tpLabel::~tpLabel()
暂无注释...
virtual
void tpLabel::setAutoFit(bool enable=false)
暂无注释...
void tpLabel::setWordWrap(bool wrap)
点击查看...
设置label根据文本长度和大小,自动实现换行
virtual
void tpLabel::setRect(tpRect &rect)
暂无注释...
virtual
void tpLabel::setRect(tpRect *rect)
暂无注释...
virtual
void tpLabel::setRect(ItpRect &rect)
暂无注释...
virtual
void tpLabel::setRect(ItpRect *rect)
暂无注释...
virtual
void tpLabel::setRect(int32_t x, int32_t y, int32_t w, int32_t h)
暂无注释...
virtual
void tpLabel::setText(const tpString &text)
点击查看...
设置显示文本
virtual
tpFont * tpLabel::font()
点击查看...
获取文本字体指针
返回值:
字体指针
virtual
void tpLabel::setAlign(const tinyPiX::AlignmentFlag align=tinyPiX::AlignLeft)
点击查看...
设置文本居中模式;当前仅支持水平靠左、靠右、居中
virtual
bool tpLabel::onPaintEvent(tpObjectPaintEvent *event)
点击查看...
绘制事件,禁止在该函数调用 paint和update函数
返回值:
返回true继续执行子控件绘制
virtual
bool tpLabel::onLeaveEvent(tpObjectLeaveEvent *event) override
暂无注释...
virtual
tpString tpLabel::pluginType() override
点击查看...
组件类名,子类实现,返回子类类名字符串,用于匹配CSS中对应样式
返回值:
类名字符串