[Hotkey] Display hotkey name plus device name in hotkey model, resize view if new key has been added or removed

This commit is contained in:
Klaus Basan
2019-11-24 21:06:40 +01:00
committed by Mat Sutcliffe
parent ef4640e66f
commit 2a34786039
3 changed files with 20 additions and 8 deletions

View File

@@ -43,17 +43,19 @@ namespace BlackGui
if (role == Qt::DisplayRole)
{
if (index.column() == 0)
const int col = index.column();
if (col == 0)
{
const CIdentifier identifier = m_actionHotkeys[index.row()].getApplicableMachine();
return identifier.getMachineName();
}
if (index.column() == 1)
if (col == 1)
{
CHotkeyCombination combination = m_actionHotkeys[index.row()].getCombination();
return combination.toQString();
const CHotkeyCombination combination = m_actionHotkeys[index.row()].getCombination();
return combination.asStringWithDeviceNames();
// return combination.toQString();
}
if (index.column() == 2)
if (col == 2)
{
return m_actionHotkeys[index.row()].getAction();
}