In this paper we investigate an implementation of a quantum gate for quantum information processing in a system of quantum dots in an optical cavity manipulated by collinear laser fields. For simplicity we give theoretical and numerical results only for simulations of two quantum dots in a cavity interacting with two collinear fields. Extension to the system of many quantum dots in a cavity can be done in similar manner as the two dots system. It is shown that due to the collinear fields are used, a two qubit gate operation can be acheived by choosing properly detunings and amplitudes of the collinear fields.