event : Qt paint event Definition at line 51 of file aiverticalmargin.cpp. 00052 { 00053 QPainter painter(this); 00054 QSize size = this->size(); 00055 00056 for( int y = 0 ; y < size.height() ; y++ ) 00057 { 00058 if( y % 10 == 0 ) 00059 { 00060 painter.drawLine( size.width() - 6 , y , size.width() , y ); 00061 if( y % 50 == 0 ) 00062 { 00063 painter.drawText( size.width() - 20, y , QString("%1").arg( y / 10 ) ); 00064 } 00065 } 00066 else if( y % 4 == 0 ) 00067 { 00068 painter.drawLine( size.width() - 4 , y , size.width() , y ); 00069 } 00070 else if( y % 2 == 0 ) 00071 { 00072 painter.drawLine( size.width() - 2 , y , size.width() , y ); 00073 } 00074 } 00075 } |