{
int xs, xe, ys, ye;
int w, h;
int width, height;
int counter;
if ( addressList.count() == 0 ) return;
f.setFamily ( "MuktiNarrow" );
f.setPointSize ( 10 );
p.setFont ( f );
pen.setBrush ( Qt::black );
p.setPen ( pen );
W = ui.frmLabelBoxes->width();
H = ui.frmLabelBoxes->height();
width = ( ( W-20 )-30 ) /3;
height = ( H - 115 ) /8;
counter = startCounter;
if ( clearFlag == true ) return;
for ( h = 0; h < 8; ++h )
{
for ( w = 0; w < 3; ++w )
{
k = addressList[counter++];
if ( counter > addressList.count()-1 ) return;
xs = 35 + w * ( 10 + width );
ys = 30 + h * ( 10 + height );
xe = width;
ye = height;
p.drawRect ( xs, ys, xe, ye );
p.fillRect ( xs+1, ys+1, xe-1, ye-1, Qt::white );
k = addressList[counter];
temp = k.split ( "\n" );
temp[0] = temp[0].remove( "*" ); /// remove the "*" beffore the name e xtenuion
count = temp.count();
for ( n = 0; n < count; ++n ) p.drawText ( xs + 5, ys + 13 * ( n + 1 ) , temp[n] );
endCounter = counter;
}
}
h = endCounter;
return;
}
void BaseForm::paintEvent ( QPaintEvent * )
{
QStringList temp;
QString k;
int xs, xe, ys, ye;
int w, h;
int width, height;
int counter;
QPainter p ( this );
QPen pen;
QFont f;
if ( addressList.count() == 0 ) return;
f.setFamily ( "MuktiNarrow" );
f.setPointSize ( 10 );
p.setFont ( f );
pen.setBrush ( Qt::black );
p.setPen ( pen );
W = ui.frmLabelBoxes->width();
H = ui.frmLabelBoxes->height();
width = ( ( W-20 )-30 ) /3;
height = ( H - 115 ) /8;
counter = startCounter;
if ( clearFlag == true ) return;
for ( h = 0; h < 8; ++h )
{
for ( w = 0; w < 3; ++w )
{
k = addressList[counter++];
if ( counter > addressList.count()-1 ) return;
xs = 35 + w * ( 10 + width );
ys = 30 + h * ( 10 + height );
xe = width;
ye = height;
p.drawRect ( xs, ys, xe, ye );
p.fillRect ( xs+1, ys+1, xe-1, ye-1, Qt::white );
k = addressList[counter];
temp = k.split ( "\n" );
temp[0] = temp[0].remove( "*" ); /// remove the "*" beffore the name e xtenuion
count = temp.count();
for ( n = 0; n < count; ++n ) p.drawText ( xs + 5, ys + 13 * ( n + 1 ) , temp[n] );
endCounter = counter;
}
}
h = endCounter;
return;
}
To copy to clipboard, switch view to plain text mode
Guess where I found it.!!!
Bookmarks