Trying to make it more compatible with Qt5