Carlitz firstly defined the $q$-Bernoulli and $q$-Euler polynomials [Duke Math. J., 15 (1948), 987--1000]. Recently, M. Cenkci and M. Can[Adv. Stud. Contemp. Math., 12 (2006),213--223], J. Choi, P. J. Anderson and H. M. Srivastava [Appl. Math. Comput., 199 (2008), 723--737] further defined the $q$-Apostol--Bernoulli and $q$-Apostol--Euler polynomials. In this paper, we show the generating functions and basic properties of the $q$-Apostol--Bernoulli and $q$-Apostol--Euler polynomials, and obtain some relationships between the $q$-Apostol--Bernoulli and $q$-Apostol--Euler polynomials which are the corresponding $q$-extensions of some known results. Some formulas in series of $q$-Stirling numbers of the second kind are also considered.