Updated for Qt5