paint event for drawing and updating widget
Definition at line 52 of file aihorizontalmargin.cpp. 00053 { 00054 QSize size = this->size(); 00055 QPainter painter(this); 00056 00057 for( int x = 0 ; x < size.width() ; x++ ) 00058 { 00059 //~ drawing a big line eath 10 pixel and (pixels count) % 20 00060 if( x % 10 == 0 ) 00061 { 00062 painter.drawLine(x,size.height() - 6 , x , size.height()); 00063 if( x % 50 == 0 ) 00064 { 00065 painter.drawText(x, size.height() - 10, QString("%1").arg( x / 10 ) ); 00066 } 00067 } 00068 else if( x % 4 == 0 ) 00069 { 00070 painter.drawLine(x,size.height() - 4,x, size.height()); 00071 } 00072 else if( x % 2 == 0 ) 00073 { 00074 painter.drawLine(x, size.height() - 2,x, size.height()); 00075 } 00076 } 00077 } |