如何在 QT 中获取电话信息? (运营商、设备型号、设备制造商)

发布于 2024-10-01 03:51:25 字数 861 浏览 3 评论 0原文

我在网上找到了类似下面的内容

//Get S60 version and display it on label
switch (QSysInfo::s60Version ())
{
    case QSysInfo::SV_S60_3_1: return "S60 version: S60 3.1";
    case QSysInfo::SV_S60_3_2: return "S60 version: S60 3.2";
    case QSysInfo::SV_S60_5_0: return "S60 version: S60 5.0";
    case QSysInfo::SV_S60_Unknown: return "S60 version: S60 Unknown";
    default:
    break;
}

//Get OS version and display it on label
switch (QSysInfo::symbianVersion ())
{
    case QSysInfo::QSysInfo::SV_9_2: return "Symbian OS version: 9.2";
    case QSysInfo::SV_9_3: return "Symbian OS version: 9.3";
    case QSysInfo::SV_9_4: return "Symbian OS version: 9.4";
    case QSysInfo::SV_Unknown: return "Symbian OS version: Unknown";
    default:
    break;
}

,但这无法编译,因为 QSysInfo 类没有 s60Version 方法,也没有 symbian 版本 - 我只得到 windowsVersion...

I've found something like below on the net

//Get S60 version and display it on label
switch (QSysInfo::s60Version ())
{
    case QSysInfo::SV_S60_3_1: return "S60 version: S60 3.1";
    case QSysInfo::SV_S60_3_2: return "S60 version: S60 3.2";
    case QSysInfo::SV_S60_5_0: return "S60 version: S60 5.0";
    case QSysInfo::SV_S60_Unknown: return "S60 version: S60 Unknown";
    default:
    break;
}

//Get OS version and display it on label
switch (QSysInfo::symbianVersion ())
{
    case QSysInfo::QSysInfo::SV_9_2: return "Symbian OS version: 9.2";
    case QSysInfo::SV_9_3: return "Symbian OS version: 9.3";
    case QSysInfo::SV_9_4: return "Symbian OS version: 9.4";
    case QSysInfo::SV_Unknown: return "Symbian OS version: Unknown";
    default:
    break;
}

BUT this doesn't compile as the QSysInfo class doesn't have s60Version method nor the symbian Version - I only get windowsVersion...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

﹂绝世的画 2024-10-08 03:51:25

好的,找到了 - 对于每个需要这些东西的人:

QString carrierName = QSystemNetworkInfo::networkName(QSystemNetworkInfo::GsmMode);

QtMobility::QSystemDeviceInfo* d = new QtMobility::QSystemDeviceInfo(this);
QString imei = d->imei();
QString manufacturer = d->manufacturer();
QString model = d->model();
delete d;

QtMobility::QSystemInfo* s = new QtMobility::QSystemInfo(this);
QString osVer = s->version(QSystemInfo::Os);
delete s;

希望这对某人有帮助:)
干杯!

Ok, found it - for everybody that needs that stuff:

QString carrierName = QSystemNetworkInfo::networkName(QSystemNetworkInfo::GsmMode);

QtMobility::QSystemDeviceInfo* d = new QtMobility::QSystemDeviceInfo(this);
QString imei = d->imei();
QString manufacturer = d->manufacturer();
QString model = d->model();
delete d;

QtMobility::QSystemInfo* s = new QtMobility::QSystemInfo(this);
QString osVer = s->version(QSystemInfo::Os);
delete s;

hope this helps someone :)
cheers!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文