Have you tried to use QTextBlockFormat::setLeftMargin()/QTextBlockFormat::setTopMargin()/...