Qt 6.11 is out! See what's new in the release
blog
QML Txt with multiple links - keyboard navigation
-
Hello
I have a QML Text element with multiple links :
Text { text: "Lorem ipsum <a href='https://www.google.com'>dolor</a> sit amet, consectetur adipiscing elit. Pellentesque convallis mi urna, nec condimentum sapien cursus a. In hac <a href='https://www.google.com'>habitasse</a> platea dictumst. Vivamus faucibus, metus in porta aliquet, neque dolo." }I would like to make it possible to navigate between the links using the keyboard.
I am aware of the usual solution for navigating between elements :
Keys.onTabPressed: focusOnNextItem() Keys.onBacktabPressed: focusOnPreviousItem()in combination with :
elementToFocusOn.forceActiveFocus(), but the QML Text element is always represented by one QML object. It doesn't matter how many links it contains. I am not sure how I could navigate between these links with the keyboard.
What would be the best possible solution for this?