QToolbar tooltip



  • Hi!

    Is there an option to show the tooltip text when the app window is not in focus? (not the active window) I need it f.e. by the toolbar actions.

    Thank for the reply.


  • Moderators

    @amezei
    Try:

    toolBar->setAttribute( Qt::WA_AlwaysShowToolTips );
    

    if that doesn't work, then try

    toolBar->window()->setAttribute( Qt::WA_AlwaysShowToolTips );
    

    and if that also doesnt't work try the following:

    foreach( QWIdget* w, toolBar->findChildren<QWidget*>() )
        w->setAttribute( Qt::WA_AlwaysShowToolTips );
    

    :)
    sry, but i am not 100% sure where Qt expects the attribute to be set.



  • @raven-worx said in QToolbar tooltip:

    Qt::WA_AlwaysShowToolTips

    Thank you for the answer!
    The second one worked for me, but the method name is setAttribute()! (I use other Qt version maybe :))


  • Moderators

    @amezei said in QToolbar tooltip:

    The second one worked for me, but the method name is setAttribute()! (I use other Qt version maybe :))

    yes, of course. I was typing it just from the top of my head, so i mixed it up.
    (corrected it in my post)


Log in to reply
 

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