tpFileListWidget类
GUIFramework
2025-07-05
介绍
桌面UI框架下的,文件列表窗口
继承关系
基础信息
头文件: | include <tpFileListWidget.h> |
---|---|
Cmake: | None |
发布版本: | V0.1.0 |
继承类: | tpChildWidget |
派生类: |
信号
信号名称 | 参数 | 描述 |
---|---|---|
itemPressed | tpVariant | item被点击事件,鼠标按下即触发 |
itemDoubleClicked | tpVariant | item双击事件 |
itemContext | tpVariant | item右键事件 |
widgetContext | ItpPoint, ItpPoint | 窗口右键事件 |
Public 成员函数
tpFileListWidget(tpChildWidget *parent) | ||
---|---|---|
~tpFileListWidget() | ||
setHeaderList(const tpList< tpString > &headerList) | 设置标题栏文本 | |
setHeaderBackColor(const int32_t &color) | 设置标题栏背景色 | |
setColumnStrech(const tpList< uint32_t > &strechList) | 设置列宽占比 | |
addRow(const tpList< tpString > &rowData, const tpVariant &data) | 添加一行数据 | |
setColumnIcon(const tpVariant &data, const uint32_t &column, const tpString &iconPath) | 对某行数据的某一列设置icon,不设置则不绘制icon | |
setRowBackColor(const int32_t &color) | 设置一行数据的背景色 | |
setRowHoverColor(const int32_t &color) | 设置一行数据鼠标悬停色 | |
setRowPressColor(const int32_t &color) | 设置一行数据鼠标点击色 | |
tpFont * | titleFont() | 获取标题栏字体 |
tpFont * | itemFont() | 获取item字体 |
tpList< tpVariant > | selectedList() | 获取选中列表 |
setTitleHeight(const uint32_t &height) | 设置选择模式,默认为 tinyPiX::ExtendedSelection | |
setItemHeight(const uint32_t &height) | 设置item高度 | |
clear() | 清空所有当前item |
Protected成员函数
onResizeEvent(tpObjectResizeEvent *event) override | item切换 | |
---|---|---|
onKeyboardEvent(tpKeyboardEvent *event) override | 设置鼠标事件监听函数 | |
onMouseKeyEvent(tpMouseKeyEvent *event) override | ||
onMouseMotionEvent(tpMouseMotionEvent *event) override | ||
onLeaveEvent(tpObjectLeaveEvent *event) override | ||
onPaintEvent(tpObjectPaintEvent *event) override | 绘制事件,禁止在该函数调用 paint和update函数 |
成员函数说明
tpFileListWidget::tpFileListWidget(tpChildWidget *parent)
暂无注释...
tpFileListWidget::~tpFileListWidget()
暂无注释...
void tpFileListWidget::setHeaderList(const tpList< tpString > &headerList)
点击查看...
设置标题栏文本
void tpFileListWidget::setHeaderBackColor(const int32_t &color)
点击查看...
设置标题栏背景色
void tpFileListWidget::setColumnStrech(const tpList< uint32_t > &strechList)
点击查看...
设置列宽占比
void tpFileListWidget::addRow(const tpList< tpString > &rowData, const tpVariant &data)
点击查看...
添加一行数据
void tpFileListWidget::setColumnIcon(const tpVariant &data, const uint32_t &column, const tpString &iconPath)
点击查看...
对某行数据的某一列设置icon,不设置则不绘制icon
void tpFileListWidget::setRowBackColor(const int32_t &color)
点击查看...
设置一行数据的背景色
void tpFileListWidget::setRowHoverColor(const int32_t &color)
点击查看...
设置一行数据鼠标悬停色
void tpFileListWidget::setRowPressColor(const int32_t &color)
点击查看...
设置一行数据鼠标点击色
tpFont * tpFileListWidget::titleFont()
点击查看...
获取标题栏字体
返回值:
字体指针,请勿释放
tpFont * tpFileListWidget::itemFont()
点击查看...
获取item字体
返回值:
字体指针,请勿释放
tpList< tpVariant > tpFileListWidget::selectedList()
点击查看...
获取选中列表
返回值:
选中行的数据
void tpFileListWidget::setTitleHeight(const uint32_t &height)
点击查看...
设置选择模式,默认为 tinyPiX::ExtendedSelection
参数:
selectMode: 选择模式枚举
参数:
height: 高度值,px
void tpFileListWidget::setItemHeight(const uint32_t &height)
点击查看...
设置item高度
void tpFileListWidget::clear()
点击查看...
清空所有当前item
virtual
bool tpFileListWidget::onResizeEvent(tpObjectResizeEvent *event) override
点击查看...
item切换
virtual
bool tpFileListWidget::onKeyboardEvent(tpKeyboardEvent *event) override
点击查看...
设置鼠标事件监听函数
virtual
bool tpFileListWidget::onMouseKeyEvent(tpMouseKeyEvent *event) override
暂无注释...
virtual
bool tpFileListWidget::onMouseMotionEvent(tpMouseMotionEvent *event) override
暂无注释...
virtual
bool tpFileListWidget::onLeaveEvent(tpObjectLeaveEvent *event) override
暂无注释...
virtual
bool tpFileListWidget::onPaintEvent(tpObjectPaintEvent *event) override
点击查看...
绘制事件,禁止在该函数调用 paint和update函数
返回值:
返回true继续执行子控件绘制