#include <PlotTracker.h>
List of all members.
Constructor & Destructor Documentation
PlotTracker::~PlotTracker |
( |
|
) |
[virtual] |
Member Function Documentation
void PlotTracker::enableDateTimeTracker |
( |
bool |
flag |
) |
[inline] |
void PlotTracker::enableDateTracker |
( |
bool |
flag |
) |
[inline] |
void PlotTracker::setBaseDate |
( |
QDate |
date |
) |
[inline] |
void PlotTracker::setBaseDateTime |
( |
QDateTime |
dateTime |
) |
[inline] |
QwtText PlotTracker::trackerText |
( |
const QwtDoublePoint & |
pos |
) |
const [protected, virtual] |
Reimplemented from QwtPlotPicker.
{
QString text;
if ( m_dateTrackerEnabled == false && m_dateTimeTrackerEnabled == false )
{
switch( rubberBand() )
{
case HLineRubberBand:
text.sprintf( "%.4f", pos.y() );
break;
case VLineRubberBand:
text.sprintf( "%.4f", pos.x() );
break;
default:
{
if ( plot()->axisEnabled( QwtPlot::yRight ) == true )
{
double rightAxisValue = plot()->invTransform( QwtPlot::yRight, plot()->transform(
QwtPlot::yLeft, pos.y() ) );
text.sprintf( "%.4f\n<- %.4f\n%.4f ->", pos.x(), pos.y(), rightAxisValue );
}
else
{
text.sprintf( "%.4f\n%.4f", pos.x(), pos.y() );
}
}
}
}
else
{
QString dateTimeString;
if ( m_dateTrackerEnabled == true )
{
QDate thisDate = m_baseDate.addDays( ( int )( floor( pos.x() / 86400.0 ) ) );
dateTimeString = thisDate.toString( QLocale::system().dateFormat( QLocale::ShortFormat ) );
}
else
{
QDateTime thisDateTime = m_baseDateTime.addSecs( ( int )pos.x() );
dateTimeString = thisDateTime.toString( QLocale::system().dateFormat( QLocale::ShortFormat )
+ " " + QLocale::system().timeFormat( QLocale::ShortFormat ) );
}
switch( rubberBand() )
{
case HLineRubberBand:
text.sprintf( "%.4f", pos.y() );
break;
case VLineRubberBand:
text = dateTimeString;
break;
default:
{
if ( plot()->axisEnabled( QwtPlot::yRight ) == true )
{
double rightAxisValue = plot()->invTransform( QwtPlot::yRight, plot()->transform( QwtPlot::yLeft, pos.y() ) );
text = dateTimeString + "\n<- " + QString::number( pos.y() ) + "\n" + QString::number( rightAxisValue ) + " ->";
}
else
{
text = dateTimeString + "\n" + QString::number( pos.y() );
}
}
}
}
return QwtText( text );
}
The documentation for this class was generated from the following files: