Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. ToolTip for qPushButton is displayed far away from butten control.

ToolTip for qPushButton is displayed far away from butten control.

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 212 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sayajirao
    wrote on last edited by
    #1

    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?

    JonBJ 1 Reply Last reply
    0
    • S Sayajirao

      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?

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @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.

      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved