#include <CoordTip.h>
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 |
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); }
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] |
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; } }
void SciFigs::CoordTip::setEnabled | ( | bool | e | ) |
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); } }
CoordTipTip* SciFigs::CoordTip::_coordTip [protected] |
Referenced by CoordTip(), fallAsleep(), hidden(), hideTip(), and ~CoordTip().
QTimer SciFigs::CoordTip::_coordTipShowTimer [protected] |
Referenced by CoordTip(), and fallAsleep().
QTimer SciFigs::CoordTip::_coordTipTimer [protected] |
Referenced by CoordTip(), hideTip(), and setMousePos().
GraphContent* SciFigs::CoordTip::_currentGC [protected] |
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().