  For an acyclic quiver, we establish a connection between the cohomology of
quiver Grassmannians and the dual canonical bases of the algebra
$U_q^-(\mathfrak{g})$, where $U_q^-(\mathfrak{g})$ is the negative half of the
quantized enveloping algebra associated with the quiver. In order to achieve
this goal, we study the cohomology of quiver Grassmannians by Lusztig's
category. As a consequence, we describe explicitly the Poincar\'e polynomials
of rigid quiver Grassmannians in terms of the coefficients of dual canonical
bases, which are viewed as elements of quantum shuffle algebras. By this
result, we give another proof of the odd cohomology vanishing theorem for
quiver Grassmanians. Meanwhile, for Dynkin quivers, we show that the Poincar\'e
polynomials of rigid quiver Grassmannians are the coefficients of dual PBW
bases of the algebra $U_q^-(\mathfrak{g})$.
