Qt: Reduce duplicated lines

This commit is contained in:
Jeffrey Pfau 2015-07-24 00:01:43 -07:00
parent a08f092913
commit e9436e43db
1 changed files with 5 additions and 22 deletions
src/platform/qt

View File

@ -68,28 +68,6 @@ GBAKeyEditor::GBAKeyEditor(InputController* controller, int type, const QString&
}
#endif
connect(m_keyDU, SIGNAL(valueChanged(int)), this, SLOT(setNext()));
connect(m_keyDD, SIGNAL(valueChanged(int)), this, SLOT(setNext()));
connect(m_keyDL, SIGNAL(valueChanged(int)), this, SLOT(setNext()));
connect(m_keyDR, SIGNAL(valueChanged(int)), this, SLOT(setNext()));
connect(m_keySelect, SIGNAL(valueChanged(int)), this, SLOT(setNext()));
connect(m_keyStart, SIGNAL(valueChanged(int)), this, SLOT(setNext()));
connect(m_keyA, SIGNAL(valueChanged(int)), this, SLOT(setNext()));
connect(m_keyB, SIGNAL(valueChanged(int)), this, SLOT(setNext()));
connect(m_keyL, SIGNAL(valueChanged(int)), this, SLOT(setNext()));
connect(m_keyR, SIGNAL(valueChanged(int)), this, SLOT(setNext()));
connect(m_keyDU, SIGNAL(axisChanged(int, int)), this, SLOT(setNext()));
connect(m_keyDD, SIGNAL(axisChanged(int, int)), this, SLOT(setNext()));
connect(m_keyDL, SIGNAL(axisChanged(int, int)), this, SLOT(setNext()));
connect(m_keyDR, SIGNAL(axisChanged(int, int)), this, SLOT(setNext()));
connect(m_keySelect, SIGNAL(axisChanged(int, int)), this, SLOT(setNext()));
connect(m_keyStart, SIGNAL(axisChanged(int, int)), this, SLOT(setNext()));
connect(m_keyA, SIGNAL(axisChanged(int, int)), this, SLOT(setNext()));
connect(m_keyB, SIGNAL(axisChanged(int, int)), this, SLOT(setNext()));
connect(m_keyL, SIGNAL(axisChanged(int, int)), this, SLOT(setNext()));
connect(m_keyR, SIGNAL(axisChanged(int, int)), this, SLOT(setNext()));
m_buttons = new QWidget(this);
QVBoxLayout* layout = new QVBoxLayout;
m_buttons->setLayout(layout);
@ -116,6 +94,11 @@ GBAKeyEditor::GBAKeyEditor(InputController* controller, int type, const QString&
m_keyR
};
for (auto& key : m_keyOrder) {
connect(key, SIGNAL(valueChanged(int)), this, SLOT(setNext()));
connect(key, SIGNAL(axisChanged(int, int)), this, SLOT(setNext()));
}
m_currentKey = m_keyOrder.end();
m_background.load(":/res/keymap.qpic");