QTBUG-26956 related fix: use QObject::deleteLater instead of delete.