Update QtPath.py

fixed cost calculation