本文整理汇总了C++中CGuestOSType::GetRecommendedUsbHid方法的典型用法代码示例。如果您正苦于以下问题:C++ CGuestOSType::GetRecommendedUsbHid方法的具体用法?C++ CGuestOSType::GetRecommendedUsbHid怎么用?C++ CGuestOSType::GetRecommendedUsbHid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGuestOSType
的用法示例。
在下文中一共展示了CGuestOSType::GetRecommendedUsbHid方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: vboxGlobal
//.........这里部分代码省略.........
dvdCtr.SetControllerType(dvdStorageControllerType);
/* Create recommended HD storage controller if it's not the same as the DVD controller */
KStorageBus ctrHdBus = type.GetRecommendedHdStorageBus();
KStorageControllerType hdStorageControllerType = type.GetRecommendedHdStorageController();
CStorageController hdCtr;
QString ctrHdName;
if (ctrHdBus != ctrDvdBus || hdStorageControllerType != dvdStorageControllerType)
{
ctrHdName = getNextControllerName(ctrHdBus);
m_Machine.AddStorageController(ctrHdName, ctrHdBus);
hdCtr = m_Machine.GetStorageControllerByName(ctrHdName);
hdCtr.SetControllerType(hdStorageControllerType);
/* Set the port count to 1 if SATA is used. */
if (hdStorageControllerType == KStorageControllerType_IntelAhci)
hdCtr.SetPortCount(1);
}
else
{
/* The HD controller is the same as DVD */
hdCtr = dvdCtr;
ctrHdName = ctrDvdName;
}
/* Turn on PAE, if recommended */
m_Machine.SetCPUProperty(KCPUPropertyType_PAE, type.GetRecommendedPae());
/* Set recommended firmware type */
KFirmwareType fwType = type.GetRecommendedFirmware();
m_Machine.SetFirmwareType(fwType);
/* Set recommended human interface device types */
if (type.GetRecommendedUsbHid())
{
m_Machine.SetKeyboardHidType(KKeyboardHidType_USBKeyboard);
m_Machine.SetPointingHidType(KPointingHidType_USBMouse);
if (!usbController.isNull())
usbController.SetEnabled(true);
}
if (type.GetRecommendedUsbTablet())
{
m_Machine.SetPointingHidType(KPointingHidType_USBTablet);
if (!usbController.isNull())
usbController.SetEnabled(true);
}
/* Set HPET flag */
m_Machine.SetHpetEnabled(type.GetRecommendedHpet());
/* Set UTC flags */
m_Machine.SetRTCUseUTC(type.GetRecommendedRtcUseUtc());
/* Register the VM prior to attaching hard disks */
vbox.RegisterMachine(m_Machine);
if (!vbox.isOk())
{
msgCenter().cannotCreateMachine(vbox, m_Machine, this);
return false;
}
/* Attach default devices */
{
bool success = false;
QString machineId = m_Machine.GetId();