fix connection check for Qt 5