Sayyiduna Abdullah bin Abbas (may Allah be pleased with them both) said concerning this very verse: When a man died and left his wife, she would observe her waiting period for a year in his house, and they would spend on her from his wealth. Then Allah Almighty revealed this verse: 'And those of you who die and leave behind wives, they shall wait concerning themselves for four months and ten days.' [Surah al-Baqarah: 234]
This became the waiting period of the woman whose husband dies, except the pregnant woman, whose waiting period is until she gives birth to what is in her womb.
And concerning her inheritance He said: 'And for them is a quarter of what you leave if you have no child; but if you have a child, then for them is an eighth.' [Surah al-Nisa: 12] Allah Almighty made clear the inheritance of the woman and left out the bequest and the maintenance.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب العدد / 15462