  Given a compact four-dimensional Riemannian manifold $(M, g)$ with boundary,
we study the problem of existence of Riemannian metrics on $M$ conformal to $g$
with prescribed $Q$-curvature in the interior $\mathring{M}$ of $M$, and zero
$T$-curvature and mean curvature on the boundary $\partial M$ of $M$. This
geometric problem is equivalent to solving a fourth-order elliptic boundary
value problem (BVP) involving the Paneitz operator with boundary conditions of
Chang-Qing and Neumann operators. The corresponding BVP has a variational
formulation but the corresponding variational problem, in the case under study,
is not compact. To overcome such a difficulty we perform a systematic study,
\`a la Bahri, of the so called {\it critical points at infinity}, compute their
Morse indices, determine their contribution to the difference of topology
between the sublevel sets of associated Euler-Lagrange functional and hence
extend the full Morse Theory to this noncompact variational problem. To
establish Morse inequalities we were led to investigate from the topological
viewpoint the space of boundary-weighted barycenters of the underlying
manifold, which arise in the description of the topology of very negative
sublevel sets of the related functional. As an application of our approach we
derive various existence results and provide a Poincar\'e-Hopf type criterium
for the prescribed $Q$-curvature problem on compact four dimensional Riemannian
manifolds with boundary.
