Modified and tested with Qt 5.3.2