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. Duration of a ToolTip
QtWS25 Last Chance

Duration of a ToolTip

Scheduled Pinned Locked Moved Unsolved General and Desktop
11 Posts 3 Posters 4.0k 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by VRonin
    #1
    This post is deleted!
    VRoninV 1 Reply Last reply
    0
    • ? A Former User

      This post is deleted!

      VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on last edited by
      #2

      @vale88 said in Duration of a ToolTip:

      It works

      HOW?!

      QToolTip * b;
      a= QString("%1 , %2").arg(x).arg(y);
      b->showText(g, a );
      

      should mercilessly crash

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      ? 1 Reply Last reply
      2
      • VRoninV VRonin

        @vale88 said in Duration of a ToolTip:

        It works

        HOW?!

        QToolTip * b;
        a= QString("%1 , %2").arg(x).arg(y);
        b->showText(g, a );
        

        should mercilessly crash

        ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        @VRonin Yes it works, I can also write: QToolTip::showText(g, a ); it's the same thing..but it'isn't this the problem

        1 Reply Last reply
        0
        • VRoninV Offline
          VRoninV Offline
          VRonin
          wrote on last edited by
          #4

          I see, it's static.
          try adding setToolTipDuration(30000); in CustomPlotZoom::CustomPlotZoom and change QToolTip::showText(g, a ); to QToolTip::showText(g, a, this);

          "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
          ~Napoleon Bonaparte

          On a crusade to banish setIndexWidget() from the holy land of Qt

          ? 1 Reply Last reply
          0
          • VRoninV VRonin

            I see, it's static.
            try adding setToolTipDuration(30000); in CustomPlotZoom::CustomPlotZoom and change QToolTip::showText(g, a ); to QToolTip::showText(g, a, this);

            ? Offline
            ? Offline
            A Former User
            wrote on last edited by
            #5

            @VRonin I wrote:

            CustomPlotZoom::CustomPlotZoom(QWidget * parent)
            : QCustomPlot(parent)
            , mZoomMode(false)
            , mRubberBand(new QRubberBand(QRubberBand::Rectangle, this))
            {
            setToolTipDuration(3000);
            }

            and:

            QToolTip::showText(g, a ,this);
            but it doesn't work

            1 Reply Last reply
            0
            • VRoninV Offline
              VRoninV Offline
              VRonin
              wrote on last edited by
              #6

              I'm retarded, sorry. http://doc.qt.io/qt-5/qtooltip.html#showText-2
              QToolTip::showText(g, a, this, QRect(), 30000);

              "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
              ~Napoleon Bonaparte

              On a crusade to banish setIndexWidget() from the holy land of Qt

              ? 1 Reply Last reply
              2
              • VRoninV VRonin

                I'm retarded, sorry. http://doc.qt.io/qt-5/qtooltip.html#showText-2
                QToolTip::showText(g, a, this, QRect(), 30000);

                ? Offline
                ? Offline
                A Former User
                wrote on last edited by
                #7

                @VRonin said in Duration of a ToolTip:

                QToolTip::showText(g, a, this, QRect(), 30000);

                It doesn't work..maybe it's because it's connected to mouse event? I don't understand

                VRoninV 1 Reply Last reply
                0
                • ? A Former User

                  @VRonin said in Duration of a ToolTip:

                  QToolTip::showText(g, a, this, QRect(), 30000);

                  It doesn't work..maybe it's because it's connected to mouse event? I don't understand

                  VRoninV Offline
                  VRoninV Offline
                  VRonin
                  wrote on last edited by
                  #8

                  @vale88 said in Duration of a ToolTip:

                  It doesn't work

                  Define "doesn't work".

                  • Crashes
                  • Doesn't show the popup at all
                  • Shows the popup but not for 30secs

                  "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
                  ~Napoleon Bonaparte

                  On a crusade to banish setIndexWidget() from the holy land of Qt

                  ? 1 Reply Last reply
                  2
                  • VRoninV VRonin

                    @vale88 said in Duration of a ToolTip:

                    It doesn't work

                    Define "doesn't work".

                    • Crashes
                    • Doesn't show the popup at all
                    • Shows the popup but not for 30secs
                    ? Offline
                    ? Offline
                    A Former User
                    wrote on last edited by
                    #9

                    @VRonin the third

                    1 Reply Last reply
                    0
                    • mrjjM Offline
                      mrjjM Offline
                      mrjj
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      Hi
                      Just as a note.
                      I tried the code
                      QToolTip::showText(g, a, this, QRect(), 30000);
                      from a button's clicked.
                      It will stay for 30 secs IF you do not move the mouse.
                      If you mouse the mouse - it vanish a few sec later.
                      So i think that is what you are seeing.

                      ? 1 Reply Last reply
                      2
                      • mrjjM mrjj

                        Hi
                        Just as a note.
                        I tried the code
                        QToolTip::showText(g, a, this, QRect(), 30000);
                        from a button's clicked.
                        It will stay for 30 secs IF you do not move the mouse.
                        If you mouse the mouse - it vanish a few sec later.
                        So i think that is what you are seeing.

                        ? Offline
                        ? Offline
                        A Former User
                        wrote on last edited by
                        #11
                        This post is deleted!
                        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