Initial implementation of barcode object.

This commit is contained in:
Jim Evins
2017-04-29 19:12:20 -04:00
parent 02630aec19
commit cf000a5d5c
17 changed files with 647 additions and 56 deletions
+2 -2
View File
@@ -112,7 +112,7 @@ namespace glbarcode
{
double x1 = x + w/2; // Offset line origin by 1/2 line width.
d->painter->setPen( QPen( d->color, w ) );
d->painter->setPen( QPen( d->color, w, Qt::SolidLine, Qt::FlatCap ) );
d->painter->drawLine( QPointF(x1, y), QPointF(x1, y+h) );
}
}
@@ -145,7 +145,7 @@ namespace glbarcode
QRect rect = fm.boundingRect( QString::fromStdString(text) );
double xCorner = x - rect.width()/2.0;
double yCorner = y - rect.height() + fm.descent();
double yCorner = y + fm.descent();
d->painter->drawText( QPointF(xCorner, yCorner), QString::fromStdString(text) );
}