Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    [Solved] Tooltip display problem?

    General and Desktop
    3
    8
    5005
    Loading More Posts
    • 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
      pratik041 last edited by

      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 Reply Quote 0
      • L
        luisvaldes88 last edited by

        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 Reply Quote 0
        • D
          dangelog last edited by

          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 Reply Quote 0
          • P
            pratik041 last edited by

            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 Reply Quote 0
            • L
              luisvaldes88 last edited by

              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 Reply Quote 0
              • P
                pratik041 last edited by

                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 Reply Quote 0
                • L
                  luisvaldes88 last edited by

                  Hey thanks.

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

                  how did you find it?

                  Muchos quieren, pocos pueden, algunos consiguen.

                  1 Reply Last reply Reply Quote 0
                  • P
                    pratik041 last edited by

                    In Qt namespace documentation see Qt::WidgetAttribute type

                    Pratik Agrawal

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post