All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines
Public Slots | Public Member Functions | Protected Slots | Protected Attributes
SciFigs::CoordTip Class Reference

#include <CoordTip.h>

List of all members.

Public Slots

void hideTip ()

Public Member Functions

 CoordTip ()
void setEnabled (bool e)
void setMousePos (GraphContent *gc, QPoint &pt)
 ~CoordTip ()

Protected Slots

void fallAsleep ()
void hidden ()

Protected Attributes

CoordTipTip_coordTip
QTimer _coordTipShowTimer
QTimer _coordTipTimer
GraphContent_currentGC
bool _enabled
QPoint _mousePos

Constructor & Destructor Documentation

References _coordTip, _coordTipShowTimer, _coordTipTimer, _currentGC, _enabled, fallAsleep(), hideTip(), and TRACE.

    : _coordTipTimer(this),
    _coordTipShowTimer(this)
{
  TRACE;
  _enabled=true;
  _coordTip=0;
  _currentGC=0;
  connect(&_coordTipTimer, SIGNAL(timeout()), this, SLOT(fallAsleep()) );
  connect(&_coordTipShowTimer, SIGNAL(timeout()), this, SLOT(hideTip()) );
  _coordTipTimer.setSingleShot(true);
  _coordTipShowTimer.setSingleShot(true);
}

References _coordTip, and TRACE.

{
  TRACE;
  delete _coordTip;
}

Member Function Documentation

void SciFigs::CoordTip::fallAsleep ( ) [protected, slot]

References _coordTip, _coordTipShowTimer, _currentGC, _mousePos, SciFigs::GraphContent::coordinateTipText(), hidden(), hideTip(), and TRACE.

Referenced by CoordTip().

{
  TRACE;
  hideTip();
  if(_currentGC && _currentGC->rect().contains(_mousePos) ) {
    _coordTip=new CoordTipTip();
    connect(_coordTip, SIGNAL(destroyed()), this, SLOT(hidden()) );
    _coordTip->setText(_currentGC->coordinateTipText(_mousePos));
    _coordTip->move(_currentGC->mapToGlobal(_mousePos + QPoint(20, 2) ));
    _coordTip->show();
    _coordTipShowTimer.start(5000);
  }
}
void SciFigs::CoordTip::hidden ( ) [protected, slot]

References _coordTip, and TRACE.

Referenced by fallAsleep().

{
  TRACE;
  _coordTip=0;
}
void SciFigs::CoordTip::hideTip ( ) [slot]

References _coordTip, _coordTipTimer, and TRACE.

Referenced by CoordTip(), fallAsleep(), setEnabled(), and setMousePos().

{
  TRACE;
  if(_coordTipTimer.isActive()) _coordTipTimer.stop();
  if(_coordTip) {
    _coordTip->deleteLater();
    _coordTip=0;
  }
}

References _enabled, hideTip(), and TRACE.

{
  TRACE;
  _enabled=e;
  if(!_enabled) hideTip();
}
void SciFigs::CoordTip::setMousePos ( GraphContent gc,
QPoint &  pt 
)

References _coordTipTimer, _currentGC, _enabled, _mousePos, hideTip(), and TRACE.

{
  TRACE;
  if(_mousePos!=pt && _enabled) {
    hideTip();
    _mousePos=pt;
    _currentGC=gc;
    if(_coordTipTimer.isActive()) _coordTipTimer.stop();
    _coordTipTimer.start(1000);
  }
}

Member Data Documentation

Referenced by CoordTip(), and fallAsleep().

Referenced by CoordTip(), hideTip(), and setMousePos().

Referenced by CoordTip(), fallAsleep(), and setMousePos().

bool SciFigs::CoordTip::_enabled [protected]

Referenced by CoordTip(), setEnabled(), and setMousePos().

QPoint SciFigs::CoordTip::_mousePos [protected]

Referenced by fallAsleep(), and setMousePos().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines