Fix detection of Qt major version