VirtualBox

Changeset 5071 in vbox


Ignore:
Timestamp:
Sep 27, 2007 9:16:12 AM (17 years ago)
Author:
vboxsync
Message:

Add tool-tip to the link under mouse cursor hovered the QIRichLabel.
This improvement lets the user see the tooltip above the QIRichLabel's links (if present). QIRichLabel is currently used at least in all Problem-Reporter message-boxes and in Registration Dialog.

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/include/QIRichLabel.h

    r4071 r5071  
    117117
    118118   QString     ltext;
     119   QString     mTipText;
     120   bool        mIsMainTip;
    119121   QPixmap    *lpixmap;
    120122   QPicture   *lpicture;
  • trunk/src/VBox/Frontends/VirtualBox/src/QIRichLabel.cpp

    r4853 r5071  
    9090{
    9191   mMaxHeightMode = false;
     92   mIsMainTip = true;
    9293   baseheight = 0;
    9394   lpixmap = 0;
     
    381382    QString link = doc->anchorAt (aEvent->pos());
    382383    if (!link.isEmpty()) /* Mouse cursor above link */
     384    {
     385        if (mIsMainTip)
     386        {
     387            mTipText = QToolTip::textFor (this);
     388            QToolTip::remove (this);
     389            QToolTip::add (this, link);
     390            mIsMainTip = false;
     391        }
    383392        setCursor (QCursor (Qt::PointingHandCursor));
     393    }
    384394    else /* Mouse cursor above non-link */
     395    {
     396        if (!mIsMainTip)
     397        {
     398            QToolTip::remove (this);
     399            QToolTip::add (this, mTipText);
     400            mIsMainTip = true;
     401        }
    385402        setCursor (QCursor (Qt::ArrowCursor));
     403    }
    386404}
    387405
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette