I found a way to calculate the height in my case:
height: (standardButtons != Dialog.NoButton) ? header.height + footer.height + dialogText.height + 35 : header.height + dialogText.height + 35
The value of 35 comes from this equation (when you did not specify the dialog height):
Component.onCompleted: console.log(height - dialogText.height)
Visually it looks exactly the same, even if I change the font size