Store the error message in the QTextCharFormat of the extra selection.
Attach a file by drag & drop or click to upload