Transpose code to Qt5