QTextBlock block = document->findBlock(cursor.position()); block.setUserState(1);
QTextBlock block = document->findBlock(cursor.position()); int state = block.userState();These examples show how to set and retrieve the user state of a QTextBlock. The package/library used for QTextBlock is Qt.