版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/weixin_42449444/article/details/97289488
我还在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();
}