Abstract: We obtain a criterion for quasiconvexity of a subgroup of an amalgamated free product of two word hyperbolic groups along a virtually cyclic subgroup. The result provides a method of constructing new word hyperbolic group in class (Q), that is such that all their finitely generated subgroups are quasiconvex. It is known that free groups, hyperbolic surface groups and most 3-dimensional Kleinian groups have property (Q). We also give some applications of our results to one-relator groups and exponential groups.