slight refactoring;
added Qt 5 support.