Following are the steps to change the passport number (after obtaining the new passport following renewal) in QID:
1 ) Go to gharaffa immigration office - Mrng 7 -12 and evng
1 pm - 4 pm
2) Go to gate 2- get a token
3) carry your old passport, new passport, Old QID and a debit card/ credit card with you
4) when your token number comes, give the passport and QID and tel them that you have come to change the passport number in QID- pay 100 QR via debit / credit card and wait for 5 minutes
5 ) you may collect the card from the same counter after 5 minutes.
Please bear in mind that the new QID will have only a new passport number but the QID expiry date will be same as the previous QID.

Its not mandatory for the corresponding person to go to immigration office. Husband can do it for their wife also.