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. Tool tip not showing up

Tool tip not showing up

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 396 Views 1 Watching
  • 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.
  • M Offline
    M Offline
    misterfreezepants
    wrote on last edited by
    #1

    hi guys,
    I am learning how to use Qt and currently coding in a c++ src file. I am reading this assigned reading from my class https://wiki.qt.io/Qt_for_Beginners
    but for some reason when I try adding a tooltip to my button it is not showing up. This happens even when I copy paste the code from this document.

    Here is a look at my code so far . Any help would be appreciated!

    #include <QApplication>
    #include <QPushButton>

    int main(int argc, char **argv)
    {
    QApplication app (argc, argv);

    QWidget window;
    window.setFixedSize(500, 250);

    QPushButton *button = new QPushButton("!!!TEXT MESSAGE!!!", &window);
    button->setToolTip("A tooltip");
    button->setToolTipDuration(500);
    button->setGeometry(30, 30, 200, 30);
    QFont font("Courier");
    button->setFont(font);
    window.show();
    return app.exec();
    }

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mpergand
      wrote on last edited by
      #2

      Hi,

      Works as expected, but the display duration is short ;)

      1 Reply Last reply
      0
      • M Offline
        M Offline
        misterfreezepants
        wrote on last edited by
        #3

        hmm it like does not show up for me...i'll increase duration thank you !

        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