QTextBlockUserData Class
QTextBlockUserData 类用于将自定义数据与文本块关联起来。更多内容...
| 头文件: | #include <QTextBlockUserData> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Gui) target_link_libraries(mytarget PRIVATE Qt6::Gui) |
| qmake: | QT += gui |
- 所有成员的列表,包括继承的成员
- QTextBlockUserData 是富文本处理 API 的一部分。
注意:该类中的所有函数均为可重入函数。
公共函数
| virtual | ~QTextBlockUserData() |
详细说明
QTextBlockUserData 为容器类提供了一个抽象接口,用于将应用程序特定的用户数据与QTextDocument 中的文本块关联起来。
通常,该类的子类提供用于存储和检索数据的函数,并且实例通过QTextBlock::setUserData() 附加到文本块上。这使得可以按文本块存储附加数据,并且应用程序可以安全地检索这些数据。
每个子类都应重写析构函数,以确保在删除用户数据对象时,任何私有数据都能被自动清理。
另请参阅 QTextBlock 。
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.