Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions model/ModelBarcodeObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ namespace glabels

update(); // Initialize cached editor layouts
}


///
/// Copy constructor
Expand Down Expand Up @@ -157,7 +157,14 @@ namespace glabels
}
mHandles.clear();

delete mEditorBarcode;
if ( mEditorBarcode )
{
delete mEditorBarcode;
}
if ( mEditorDefaultBarcode )
{
delete mEditorDefaultBarcode;
}
}


Expand Down Expand Up @@ -260,7 +267,7 @@ namespace glabels
emit changed();
}
}


///
/// Barcode Style Property Getter
Expand Down Expand Up @@ -319,7 +326,7 @@ namespace glabels
// Barcodes don't support shadows.
}


///
/// Draw object itself
///
Expand Down Expand Up @@ -479,7 +486,7 @@ namespace glabels
const QString& text ) const
{
QString shortText = text.left( 32 ); // Don't let the text get out of hand

//
// Render box
//
Expand Down Expand Up @@ -517,7 +524,7 @@ namespace glabels
//
fm = QFontMetricsF( font );
textRect = fm.boundingRect( shortText );

QRectF holeRect( (mW.pt() - textRect.width())/2 - pad.pt(),
(mH.pt() - textRect.height())/2 - pad.pt(),
textRect.width() + 2*pad.pt(),
Expand All @@ -535,6 +542,6 @@ namespace glabels
painter->drawText( QRectF( 0, 0, mW.pt(), mH.pt() ), Qt::AlignCenter, shortText );
}


}
}