CMS 3D CMS Logo

VisCSCPlotWidgetAxisY Class Reference

#include <VisReco/VisMuonCSC/interface/VisCSCPlotWidgetAxisY.h>

List of all members.

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

VisCSCPlotWidgetm_pw


Detailed Description

Definition at line 8 of file VisCSCPlotWidgetAxisY.h.


Constructor & Destructor Documentation

VisCSCPlotWidgetAxisY::VisCSCPlotWidgetAxisY ( VisCSCPlotWidget pw,
QWidget *  parent = 0,
const char *  name = 0 
)

Definition at line 5 of file VisCSCPlotWidgetAxisY.cc.

00005                                                                                                    : 
00006 QWidget(parent, name), m_pw(pw)
00007 {
00008 }

VisCSCPlotWidgetAxisY::~VisCSCPlotWidgetAxisY ( void   ) 

Definition at line 10 of file VisCSCPlotWidgetAxisY.cc.

00011 {
00012 }


Member Function Documentation

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

Definition at line 18 of file VisCSCPlotWidgetAxisY.cc.

00019 {
00020         return QSize( 60, 50 );
00021 }


Member Data Documentation

VisCSCPlotWidget* VisCSCPlotWidgetAxisY::m_pw [private]

Definition at line 19 of file VisCSCPlotWidgetAxisY.h.

Referenced by paintEvent().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:35:11 2009 for CMSSW by  doxygen 1.5.4