All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger.
What those two men claimed is incorrect. The fetus whose father died inherits like all other children, but the inheritance should not be divided until the situation of this fetus becomes clear, i.e. whether it is born alive or dead and if it is born alive, is it a male or a female?
Al-Qurtubi said in Jaami’ Ahkaam Al-Quran: “If a man dies and leaves behind his wife pregnant, then the inheritance should not be divided until it becomes clear what she gives birth to. He said: The scholars agreed in a consensus that if a man dies while his wife is pregnant, the child that is in her womb inherits and his relatives inherit from him if it is born alive and shouted or cried at the moment of birth.”
As regards how the inheritance of the deceased should be divided, then if the heirs are only the widow (his wife), his daughter and his two brothers, then the wife gets one-eighth of the inheritance, his daughter gets one half and the remainder will be for his brothers by Ta’seeb (by virtue of having a paternal relation with the deceased and not having an allotted share, so they get what is left after the allotted shares have been distributed) in equal shares.
Allaah Knows best.