Use Qt4 or Qt5 plugin architecture

Change-Id: Ifca120a2936b2df7b1844afaa0b61d71c3ce245c