我还在Hello World......
#include <QCoreApplication>
#include <QDebug>
void printHello()
{
#ifdef Q_OS_WIN
qDebug("Hello Qt World on Windows!");
if(QSysInfo::windowsVersion() == QSysInfo::WV_10_0)
{
qDebug() << "Welcome to Windows 10!";
}
#elif defined(Q_OS_LINUX)
qDebug("Hello Qt World on Linux!");
#elif defined(Q_MV_OSX)
qDebug("Hello Qt World on MacOS!");
#else
qDebug() << "We don't support this platform yet!";
#endif
qDebug() << "当前系统版本:" << QSysInfo::prettyProductName();
}
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
printHello();
return a.exec();
}