if(m_img.width() > width() - 2 * m_nMargin || m_img.height() > height() - 2 * m_nMargin)
{
QImage oImage = m_img.scaled(width() - 2 * m_nMargin, height() - 2 * m_nMargin, Qt::KeepAspectRatio);
oPainter.drawPixmap((width() - oImage.width()) / 2 , (height() - oImage.height()) / 2, oImage.width(), oImage.height(), QPixmap::fromImage(oImage));
}
else
{
oPainter.drawPixmap((width() - m_img.width()) / 2, (height() - m_img.height()) / 2, m_img.width(), m_img.height(), QPixmap::fromImage(m_img));
}