: A trace formula for quasi-cyclic codes over rings of characteristic not co-prime with the co-index of the codes is derived. This is done by using the Generalized Discrete Fourier Transform (GDFT), which depends itself on the Hasse derivatives. Applying the trace formula, we introduce a characterization of Type II self-dual quasi-cyclic codes of singly even co-index over finite fields of even characteristic. Using the trace formula, we also study quasi-cyclic codes from generator theory perspective.