mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 15:25:35 +08:00
CJoystickButton fixes
This commit is contained in:
committed by
Klaus Basan
parent
832082c5bc
commit
f90ad72d9e
@@ -32,7 +32,8 @@ namespace BlackMisc
|
||||
|
||||
void CJoystickButton::setButtonObject(CJoystickButton button)
|
||||
{
|
||||
this->m_buttonIndex = button.m_buttonIndex;
|
||||
m_deviceName = button.m_deviceName;
|
||||
m_buttonIndex = button.m_buttonIndex;
|
||||
}
|
||||
|
||||
void CJoystickButton::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
|
||||
@@ -48,7 +49,7 @@ namespace BlackMisc
|
||||
case IndexButtonAsString:
|
||||
this->setButtonIndex(buttonIndexFromString(variant.value<QString>()));
|
||||
break;
|
||||
case IndeButtonObject:
|
||||
case IndexButtonObject:
|
||||
this->setButtonObject(variant.value<BlackMisc::Input::CJoystickButton>());
|
||||
break;
|
||||
default:
|
||||
@@ -63,14 +64,10 @@ namespace BlackMisc
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
case IndexDeviceName:
|
||||
return CVariant::from(this->getDeviceName());
|
||||
case IndexButton:
|
||||
return CVariant::from(this->getButtonIndex());
|
||||
case IndexButtonAsString:
|
||||
return CVariant::from(this->getButtonAsString());
|
||||
default:
|
||||
break;
|
||||
case IndexDeviceName: return CVariant::from(this->getDeviceName());
|
||||
case IndexButton: return CVariant::from(this->getButtonIndex());
|
||||
case IndexButtonAsString: return CVariant::from(this->getButtonAsString());
|
||||
case IndexButtonObject: return CVariant::from(*this);
|
||||
}
|
||||
|
||||
Q_ASSERT_X(false, "CJoystickButton", "index unknown");
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace BlackMisc
|
||||
IndexDeviceName = CPropertyIndex::GlobalIndexCJoystickButton,
|
||||
IndexButton,
|
||||
IndexButtonAsString,
|
||||
IndeButtonObject, // just for updates
|
||||
IndexButtonObject, // just for updates
|
||||
};
|
||||
|
||||
//! Default constructor
|
||||
|
||||
Reference in New Issue
Block a user