replace setMargin(0) by setContentsMargins(0, 0, 0, 0)