First obtain a valid residence permit, then get your eye tested (it can be done in authorized optic shops in Lulu hyper), then directly go to Madinath Khalifa traffic dept. submit your original license and the eye test form along with 200 riyals. You will get Qatari Driving license.
Keep colour photo with you, if you did not obtain residence permit you will get 3 months temporary license only.