The following code generates a C4100 warning when compiling using MSVC. How is this possible? "appliation" is clearly being referenced.
class ApplicationInfo : public QObject
{
Q_OBJECT
public:
...
static void initialize(QApplication &application);
...
...
}
void ApplicationInfo::initialize(QApplication &application)
{
application.setOrganizationName(ApplicationInfo::organizationName());
application.setOrganizationDomain(ApplicationInfo::organizationName());
application.setApplicationName(ApplicationInfo::applicationName());
application.setApplicationVersion(ApplicationInfo::applicationVersion().toString());
}
The functions you are calling using the
application
object are static functions, so they aren't really referencing theapplication
object.Are all static members of
QCoreApplication
whichQApplication
derives from. Using theapplication
reference only resolves the name scoping for these functions, but the object isn't actually used.