{
double angle;
int n, xs, xe, ys, ye, xc, yc;
bool ok;
if ( paintSupportLines.count () > 0 )
{
f.setFamily ( "Courier" );
f.setPointSize ( dwgScaleFactor );
p.setFont ( f );
pen.setBrush ( Qt::blue );
p.setPen ( pen );
p.setViewport ( viewportRect );
p.setWindow ( windowRect );
if ( clearWindow == "erase" ) { p.eraseRect ( windowRect ); clearWindow = "cancel erase"; }
else
{
for ( n = 0; n < paintSupportLines.count(); ++n )
{
p.setClipRect ( clippingRect );
k = paintSupportLines[n];
tempList = k.split ( "," );
xs = tempList[0].toInt ( &ok );
ys = tempList[1].toInt ( &ok );
xe = tempList[2].toInt ( &ok );
ye = tempList[3].toInt ( &ok );
p.drawLine ( xs, ys, xe, ye );
void BaseForm::paintEvent ( QPaintEvent * event )
{
QString k, h;
double angle;
int n, xs, xe, ys, ye, xc, yc;
bool ok;
QPainter p ( this );
QPen pen;
QFont f;
if ( paintSupportLines.count () > 0 )
{
f.setFamily ( "Courier" );
f.setPointSize ( dwgScaleFactor );
p.setFont ( f );
pen.setBrush ( Qt::blue );
p.setPen ( pen );
p.setViewport ( viewportRect );
p.setWindow ( windowRect );
if ( clearWindow == "erase" ) { p.eraseRect ( windowRect ); clearWindow = "cancel erase"; }
else
{
for ( n = 0; n < paintSupportLines.count(); ++n )
{
p.setClipRect ( clippingRect );
k = paintSupportLines[n];
tempList = k.split ( "," );
xs = tempList[0].toInt ( &ok );
ys = tempList[1].toInt ( &ok );
xe = tempList[2].toInt ( &ok );
ye = tempList[3].toInt ( &ok );
p.drawLine ( xs, ys, xe, ye );
To copy to clipboard, switch view to plain text mode
etc. I can single step thru the program, all values seem correct.,
Bookmarks