OK, got the headerView->length(). What about the other 3 parameters you mentioned (add the frame of the view to the result, add the margin between the dialog border and the view, add the width of the dialog border)?