replacement of qsize due to it's fails on MacOS

qsize function doesn't work at MacOS, so I replaced it.