Handling invalid size hints in qt layer