QTextCursor cursor = textEdit->textCursor(); int blockPosition = cursor.block().position();
QTextBlock block = document->findBlock(500); int blockNumber = block.blockNumber();In this example, we use the `findBlock()` method to search for a block with a specific position (in this case, 500). We then use the `blockNumber()` method to get the number of the block within the document. This code is part of the Qt Core library, which provides essential non-GUI functionality for Qt applications.