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. [SOLVED]Simple Widget ToolTips Not Working

[SOLVED]Simple Widget ToolTips Not Working

Scheduled Pinned Locked Moved General and Desktop
6 Posts 3 Posters 4.9k 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.
  • P Offline
    P Offline
    powerofpi
    wrote on last edited by
    #1

    Hello all,

    I have a Qt4.7 desktop application in development, and I can't seem to get tooltips to show up. I am trying to add tooltips to QToolButtons (that reside in a QGroupBox in a QTabWidget in a QDockWindow) by calling setToolTip() on the buttons. I have tried setting the Qt::WA_AlwaysShowToolTips attribute all the way up the hierarchy of widgets and even in the main window, but tooltips are still not working. I would appreciate any suggestions, as I have run out of ideas.

    1 Reply Last reply
    0
    • F Offline
      F Offline
      Franzk
      wrote on last edited by
      #2

      Show us the code (in a zip, compiling and all). It can also be an example reproducing the problem.

      "Horse sense is the thing a horse has which keeps it from betting on people." -- W.C. Fields

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • P Offline
        P Offline
        powerofpi
        wrote on last edited by
        #3

        http://dl.dropbox.com/u/7027137/git_code.zip

        If you look at the gui/GameTab class, I'm trying to add a tooltip to the "new" button. No modifications I have tried have successfully generated a tooltip. If you can figure it out, I'll be grateful!

        1 Reply Last reply
        0
        • G Offline
          G Offline
          goetz
          wrote on last edited by
          #4

          Change your event method in class GUI:

          @
          bool GUI::event(QEvent * event) {
          // ... do your work here
          return QApplication::event(event);
          // instead of return false
          }
          @

          If you reimplement virtual functions you should always call the base class' implementation if you do not want to handle the call yourself. Don't call the base class method if you are really sure what you do.

          http://www.catb.org/~esr/faqs/smart-questions.html

          1 Reply Last reply
          0
          • P Offline
            P Offline
            powerofpi
            wrote on last edited by
            #5

            Again, thank you for your help Volker :)

            1 Reply Last reply
            0
            • P Offline
              P Offline
              powerofpi
              wrote on last edited by
              #6

              Right on target again, Volker :) Issue solved, thanks.

              1 Reply Last reply
              0

              • Login

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