QLabel`s hyperlink tab order activation



  • Hello!
    I have small question about Tab Order on the form with qlabels. In my project I have some qlabels with hyperlinks inside (inserted with rich text editor in designer with html tags).
    I settings up focusPolicy property on qlabel and set it to "TabFocus". So, I have correct tab order with some controls with qlabels.
    But I need that on tab press hyperlink have been activated, not entire qlabel. Now qlabel focused first and after this hyperlink inside qlabel on next tab press.
    QLabels was setup like

    label->setTextInteractionFlags(Qt::LinksAccessibleByKeyboard | Qt::LinksAccessibleByMouse);

    How can I skip focus on QLabel and immediately focused on Hypertext inside that qlabel?
    Thx

    PS: I don`t know is that problem similar or not - but when I go to QToolButton with tab_key - it is not focused. QToolButton on form has stylesheet:

    QToolButton
    {
    	background: transparent;
    	border:none;
    }
    QToolButton:hover
    {
    	border: 1px solid blue;
    }
    QToolButton:focused, pressed
    {
    	border: 1px solid blue;
    }
    QToolButton:indicator
    {
    	border: 1px solid blue;
    }
    

    but when I go to this button with tab key - widget reacts on pressing by Space, but is not highlighted with border.
    Thx again

    [Edit: Added code tags -- @Wieland]


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.