Important: Please read the Qt Code of Conduct -

Multiple QTextBlocks on a single line?

  • Is there an easy way to do this? I have a QTextEdit and I'd like to insert a series of terms as separate QTextBlocks (so I can format them separately), but whenever I call QTextCursor::insertBlock it always adds it to a new line. I need the terms to flow as regular text, but I'd like to logically access them separately. Is there a way to do this without providing a custom document layout? The QAbstractDocumentLayout class seems horrendously complex (or at least poorly documented).

Log in to reply