Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

ToolTip for qPushButton is displayed far away from butten control.



  • I have implemented a qPushButton in my VC++ application. The implementation is as shown below.
    m_pBtnCurr = new QPushButton("");
    m_pBtnCurr->setMaximumSize(nBtnSize, nBtnSize);
    m_pBtnCurr->setMinimumSize(nBtnSize, nBtnSize);
    m_pBtnCurr->setIconSize(QSize(nBtnSize, nBtnSize));
    m_pBtnCurr->setToolTip(tr("Go to current time"));

    The tooltip is displayed at appropriate location but on some machines the tooltip is displayed far away from the button. The font is also bigger in that case. Is there any other way to implement this? Can we specify the location for the tooltip?



  • @Sayajirao
    I don't think I've ever had a problem with tooltip appearing where button is. Just possibly, I don't know, is your button on a layout or not, that might affect position?

    If you have to, there is https://doc.qt.io/qt-5/qtooltip.html#showText-1 etc. which can be used to position tooltip. I think you then have to handle invoking tooltip yourself.


Log in to reply