This paper proposes a quadratic programming (QP)-based variable impedance control (VIC) algorithm to solve contact-rich trajectory tracking problems with impedance, position and velocity constraints. To the best of our knowledge, the impedance constraints which are significant to ensure the worst contact compliance have never been considered in other previous works. To handle the impedance constraints of the VIC algorithm, a novel impedance model where the impedance parameters are directly served as the control input is established. The impedance-constrained VIC design problem is then formulated as a QP problem which can be efficiently solved. To handle the position and velocity constraints, a complementary force is introduced into the novel impedance model. The complementary force will appear to prevent the constraints violation when the robot approaches the constrained area. The design problem of the complementary force is also transformed into a QP problem. Combing these two QP solutions, the VIC algorithm with both impedance, position and velocity constraints can be obtained. Finally, various experiments are conducted to show the effectiveness of the proposed QP-based constrained VIC algorithm.