KPIMTextEdit::TextUtils Namespace
namespace KPIMTextEdit::TextUtilsUtility methods for working with rich text. More...
| Header: | #include <textutils.h> |
| CMake: | find_package(KPim6TextEdit REQUIRED)target_link_libraries(mytarget PRIVATE KPim6::TextEdit) |
Functions
| bool | containsFormatting(const QTextDocument *document) |
| QString | flowText(QString &text, const QString &indent, int maxLength) |
Detailed Description
Function Documentation
bool TextUtils::containsFormatting(const QTextDocument *document)
Returns whether the QTextDocument document contains rich text formatting.
QString TextUtils::flowText(QString &text, const QString &indent, int maxLength)
Changes the given text so that each line of it fits into the given maximal length. At each line, the "indent" string is prepended, which is usually the quote prefix. The text parameter will be empty afterwards. text the text to indent indent the indentation prefix string maxLength the maximal length the string of text will fit into Example: text = "Hello World, this is a test." indent = "> " maxLength = 16 Result: "> Hello World,\n" "> this is a test."