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] Tooltip display problem?
QtWS25 Last Chance

[Solved] Tooltip display problem?

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

    Suppose i have a window containing one button. I have set a tool tip to that button. When i click that button a new window is opened. In this case once the focus pass to new window when i take the mouse pointer to button again the tool tip is not visible(without clicking). How can i make it visible?

    Pratik Agrawal

    1 Reply Last reply
    0
    • L Offline
      L Offline
      luisvaldes88
      wrote on last edited by
      #2

      Do you mean something like this??

      !http://img847.imageshack.us/img847/5848/windowu.png!

      Does the new windows have the button too?
      If so, I miss it... :P

      Muchos quieren, pocos pueden, algunos consiguen.

      1 Reply Last reply
      0
      • D Offline
        D Offline
        dangelog
        wrote on last edited by
        #3

        Not sure how to do with that. It always annoyed me that (under Linux/X11, at least) the behaviour is inconsistent between toolkits. GTK-based applications will display a tooltip even if the window hasn't focus. Qt-based ones won't.

        Software Engineer
        KDAB (UK) Ltd., a KDAB Group company

        1 Reply Last reply
        0
        • P Offline
          P Offline
          pratik041
          wrote on last edited by
          #4

          ya luisvaldes88 exactly like that, the new window may or may not have button. do you know the solution

          Pratik Agrawal

          1 Reply Last reply
          0
          • L Offline
            L Offline
            luisvaldes88
            wrote on last edited by
            #5

            hi pratik041, as peppe said, Qt app don't display tooltips where they are not focused.
            A solution may be, try to make the button

            @bool QWidget::setMouseTracking(true)@

            and then do something in

            @void QWidget::mouseMoveEvent ( QMouseEvent * event )@

            I did not try, but in theory, whenever you pass your mouse over the button, it will create a move event that will be handled in

            @void QWidget::mouseMoveEvent ( QMouseEvent * event )@

            If you try it let us know

            best regards.

            Muchos quieren, pocos pueden, algunos consiguen.

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

              Actually the following is working and i think it is the best solution to do this @window.setAttribute (Qt::WA_AlwaysShowToolTips, true);@

              Pratik Agrawal

              1 Reply Last reply
              0
              • L Offline
                L Offline
                luisvaldes88
                wrote on last edited by
                #7

                Hey thanks.

                I'll take a note on this. =,)

                how did you find it?

                Muchos quieren, pocos pueden, algunos consiguen.

                1 Reply Last reply
                0
                • P Offline
                  P Offline
                  pratik041
                  wrote on last edited by
                  #8

                  In Qt namespace documentation see Qt::WidgetAttribute type

                  Pratik Agrawal

                  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