@wayfarer said in Issues with link switching via keyboard in QPlainTextEdit:
@jeremy_k said in Issues with link switching via keyboard in QPlainTextEdit:
Have you considered QTextBrowser? It has link handling APIs, and tab navigation between links works.
I was hoping to avoid having to use a different widget since I've already built most of my app around the QPlainTextEdit.
Besides, I vastly prefer its scrolling behavior. QTextEdit and QTextBrowser both cut off the text when the user scrolls past it, leaving it partially visible at the top of the window. QPlainTextEdit doesn't. It's a nice visual feature that makes the app feel much smoother.
Switching to QTextBrowser seems like a viable solution, though I'll have to modify my existing code to work with it. I would prefer to keep the QPlainTextEdit scrolling behavior somehow if possible.
Is there any particular reason why that flag doesn't work with QPlainTextEdit?
The scrolling difference is due to QPlainTextEdit's override definition of QAbstractScrollArea::scrollContentsBy. The implementation is here.
My guess is that handling of links, including navigation between them, isn't seen as part of the functionality of the widget. QTextEdit also lacks navigation between links. The QPlainTextEdit::textInteractionFlags contains what may be a revealing error:
Specifies how the label should interact with user input if it displays text.