mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 07:35:48 +08:00
Add deviceName attribute to CJoystickButton
ref T254
This commit is contained in:
committed by
Klaus Basan
parent
f62ab3266f
commit
fa74f28bca
@@ -15,8 +15,8 @@ namespace BlackMisc
|
||||
{
|
||||
namespace Input
|
||||
{
|
||||
CJoystickButton::CJoystickButton(int buttonIndex) :
|
||||
m_buttonIndex(buttonIndex)
|
||||
CJoystickButton::CJoystickButton(const QString deviceName, int index) :
|
||||
m_deviceName(deviceName), m_buttonIndex(index)
|
||||
{}
|
||||
|
||||
void CJoystickButton::setButtonIndex(int buttonIndex)
|
||||
@@ -35,6 +35,9 @@ namespace BlackMisc
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
case IndexDeviceName:
|
||||
this->setDeviceName(variant.value<QString>());
|
||||
break;
|
||||
case IndexButton:
|
||||
case IndexButtonAsString:
|
||||
this->setButtonIndex(buttonIndexFromString(variant.value<QString>()));
|
||||
@@ -54,6 +57,8 @@ 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:
|
||||
|
||||
Reference in New Issue
Block a user