mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-10 22:15:34 +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)
|
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)
|
void CJoystickButton::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
|
||||||
@@ -48,7 +49,7 @@ namespace BlackMisc
|
|||||||
case IndexButtonAsString:
|
case IndexButtonAsString:
|
||||||
this->setButtonIndex(buttonIndexFromString(variant.value<QString>()));
|
this->setButtonIndex(buttonIndexFromString(variant.value<QString>()));
|
||||||
break;
|
break;
|
||||||
case IndeButtonObject:
|
case IndexButtonObject:
|
||||||
this->setButtonObject(variant.value<BlackMisc::Input::CJoystickButton>());
|
this->setButtonObject(variant.value<BlackMisc::Input::CJoystickButton>());
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -63,14 +64,10 @@ namespace BlackMisc
|
|||||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||||
switch (i)
|
switch (i)
|
||||||
{
|
{
|
||||||
case IndexDeviceName:
|
case IndexDeviceName: return CVariant::from(this->getDeviceName());
|
||||||
return CVariant::from(this->getDeviceName());
|
case IndexButton: return CVariant::from(this->getButtonIndex());
|
||||||
case IndexButton:
|
case IndexButtonAsString: return CVariant::from(this->getButtonAsString());
|
||||||
return CVariant::from(this->getButtonIndex());
|
case IndexButtonObject: return CVariant::from(*this);
|
||||||
case IndexButtonAsString:
|
|
||||||
return CVariant::from(this->getButtonAsString());
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_ASSERT_X(false, "CJoystickButton", "index unknown");
|
Q_ASSERT_X(false, "CJoystickButton", "index unknown");
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ namespace BlackMisc
|
|||||||
IndexDeviceName = CPropertyIndex::GlobalIndexCJoystickButton,
|
IndexDeviceName = CPropertyIndex::GlobalIndexCJoystickButton,
|
||||||
IndexButton,
|
IndexButton,
|
||||||
IndexButtonAsString,
|
IndexButtonAsString,
|
||||||
IndeButtonObject, // just for updates
|
IndexButtonObject, // just for updates
|
||||||
};
|
};
|
||||||
|
|
||||||
//! Default constructor
|
//! Default constructor
|
||||||
|
|||||||
Reference in New Issue
Block a user