If your residence (where you live) is in Quebec and you only go to Ontario to work during the day - and then return home to Quebec each night to live and sleep - then you should be fine.
If you have two residences (Quebec and Ontario) - then you are an Ontario resident.