#include <VisReco/VisMuonCSC/interface/VisCSCPlotWidgetAxisY.h>
Public Member Functions | |
QSize | minimumSizeHint () const |
QSize | sizeHint () const |
VisCSCPlotWidgetAxisY (VisCSCPlotWidget *pw, QWidget *parent=0, const char *name=0) | |
~VisCSCPlotWidgetAxisY (void) | |
Protected Member Functions | |
void | paintEvent (QPaintEvent *) |
Private Attributes | |
VisCSCPlotWidget * | m_pw |
Definition at line 8 of file VisCSCPlotWidgetAxisY.h.
VisCSCPlotWidgetAxisY::VisCSCPlotWidgetAxisY | ( | VisCSCPlotWidget * | pw, | |
QWidget * | parent = 0 , |
|||
const char * | name = 0 | |||
) |
VisCSCPlotWidgetAxisY::~VisCSCPlotWidgetAxisY | ( | void | ) |
QSize VisCSCPlotWidgetAxisY::minimumSizeHint | ( | ) | const |
Definition at line 13 of file VisCSCPlotWidgetAxisY.cc.
00014 { 00015 // minimumSizeHint/sizeHint must be coordinated with x axis/VisCSCPlotWidget 00016 return QSize( 50, 40 ); 00017 }
void VisCSCPlotWidgetAxisY::paintEvent | ( | QPaintEvent * | ) | [protected] |
Definition at line 22 of file VisCSCPlotWidgetAxisY.cc.
References VisCSCPlotWidget::getScale(), m_pw, scale, and width.
00023 { 00024 QPainter painter(this); 00025 painter.setPen(Qt::gray); 00026 int xoffset = 4; // 3 + 1 to back off from the width()'th pixel 00027 int tickLength = 4; 00028 QPointArray scale( 4 ); 00029 scale.setPoint(0, width()- xoffset - tickLength, 0); 00030 scale.setPoint(1, width()-xoffset, 0 ); 00031 scale.setPoint(2, width()-xoffset, height()-1 ); 00032 scale.setPoint(3, width()- xoffset - tickLength, height()-1); 00033 painter.drawPolyline(scale); 00034 00035 QFont sansFont( "Arial", 12 ); 00036 painter.setFont( sansFont ); 00037 QFontMetrics fm( sansFont ); 00038 // maxv is the full-scale value 00039 if (m_pw->getScale() > 0.F ) 00040 { 00041 QString maxv = QString("%1").arg(m_pw->height()/m_pw->getScale(),0,'f',0); 00042 painter.drawText( width() - xoffset -tickLength - fm.width(maxv) - 2, fm.height(), maxv ); 00043 } 00044 }
QSize VisCSCPlotWidgetAxisY::sizeHint | ( | void | ) | const |
VisCSCPlotWidget* VisCSCPlotWidgetAxisY::m_pw [private] |