コード例 #1
0
ファイル: QtGameEngine.cpp プロジェクト: akashrando/epong
bool QtGameEngine::isProfileSilent() {
#if !defined(Q_OS_WIN32) && !defined(Q_WS_X11)
    QSystemDeviceInfo info;
    if (info.currentProfile() == QSystemDeviceInfo::SilentProfile) return true; else return false;
#else
    return false;
#endif
};
コード例 #2
0
/**********************************************
 * void DeviceInfoProvider::getSystemInfo
 *********************************************/
void DeviceInfoProvider::getSystemInfo()
{
    QSystemInfo *si = new QSystemInfo(this);
    QSystemDeviceInfo *di = new QSystemDeviceInfo(this);

    m_deviceVersion = si->version(QSystemInfo::Firmware).isEmpty() ? m_deviceVersion : si->version(QSystemInfo::Firmware);
    m_serialNo = di->imei().isEmpty() ? m_serialNo : di->imei();
    m_manufacturer = di->manufacturer().isEmpty() ? m_manufacturer : di->manufacturer();
    m_model = di->model().isEmpty() ? m_model : di->model();

    delete si;
    delete di;
}
コード例 #3
0
static void test_systemdeviceinfo(void)
{
  QSystemDeviceInfo deviceinfo;

  X(deviceinfo.batteryLevel());
  X(deviceinfo.batteryStatus());
  X(deviceinfo.currentBluetoothPowerState());
  X(deviceinfo.currentPowerState());
  X(deviceinfo.currentProfile());
  X(deviceinfo.imei());
  X(deviceinfo.imsi());
  X(deviceinfo.inputMethodType());
  X(deviceinfo.isDeviceLocked());
  X(deviceinfo.isKeyboardFlippedOpen());
  X(deviceinfo.isWirelessKeyboardConnected());
  X(deviceinfo.keyboardTypes());
  X(deviceinfo.manufacturer());
  X(deviceinfo.model());
  X(deviceinfo.productName());
  X(deviceinfo.simStatus());
  X(deviceinfo.lockStatus());
  X(deviceinfo.uniqueDeviceID());

  X(deviceinfo.keypadLightOn(QSystemDeviceInfo::PrimaryKeypad));
  X(deviceinfo.keypadLightOn(QSystemDeviceInfo::SecondaryKeypad));

  X(deviceinfo.activeProfileDetails().messageRingtoneVolume());
  X(deviceinfo.activeProfileDetails().voiceRingtoneVolume());
  X(deviceinfo.activeProfileDetails().vibrationActive());
}