I'm trying to set up a text widget that highlights the searched word, when I open a new file with QPlainText::setDocument
, then immediately use QPlainText::setExtraSelections
I get a SIGSEV
crash in:
QTextDocumentPrivate::rootFrame
QTextDocumentPrivate::frameAt
QTextCursorPrivate::complexSelectionTable
QTextCursor::hasComplexSelection
QWidgetTextControl::selectionRect
QWidgetTextControl::setExtraSelections
QTextDocumentPrivate
is causing a SIGSEV
because it is a null this
pointer. But this doesn't happen if no word is set before the document is loaded.
I must be supposed to do something to force it to generate the QTextDocumentPrivate
. But I have no idea what that is.