A q-analogue of the distance matrix (called the q-distance matrix) of a tree was introduced in [Bapat et al. A q-analogue of the distance matrix of a tree. Linear Algebra Appl. 2006;416(2-3):799-814]. It was formed from the distance matrix D by substituting each entry $ d(i,j) $ d(i,j) of D by $ 1+q+\cdots +q<^>{d(i,j)-1} $ 1+q+& ctdot;+qd(i,j)-1. In this article, we consider the q-distance matrix of a weighted tree, where the edge weights are matrices of the same size. We deduce a formula for the determinant of the q-distance matrix of a tree. Subsequently, we present a necessary and sufficient condition for the q-distance matrix to be invertible and derive an expression for the inverse whenever it exists. The expression for the inverse of the q-distance matrix leads us to introduce the q-analogue of the Laplacian matrix (named as the q-Laplacian matrix) for a tree with matrix weights. A formula for the determinant of the q-Laplacian matrix is also provided. Our results extend the existing results for the q-distance matrix of a weighted tree when the weights are real numbers, as well as the distance matrix of a tree with matrix weights (that can be obtained by setting q = 1).