There is not much detail in the question, but if you are using a QDeclarativeView to show the QML, have a look at its setResizeMode() member. Setting this to QDeclarativeView::SizeRootObjectToView might just do what you are looking for: it resizes QML's root object automatically to the size of the view.
Static blocks are initialised in the order they appear in the source file.
There are several questions relating to this on stack overflow already...
This one has a good answer for you: Java : in what order are static final fields initialized?
Best Answer