On the Q-index and index of triangle-free quasi-tree graphs