initial working version in qt5