mirror of https://github.com/mgba-emu/mgba.git
Qt: Reduce duplicated lines
This commit is contained in:
parent
a08f092913
commit
e9436e43db
|
@ -68,28 +68,6 @@ GBAKeyEditor::GBAKeyEditor(InputController* controller, int type, const QString&
|
||||||
}
|
}
|
||||||
#endif
|
#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);
|
m_buttons = new QWidget(this);
|
||||||
QVBoxLayout* layout = new QVBoxLayout;
|
QVBoxLayout* layout = new QVBoxLayout;
|
||||||
m_buttons->setLayout(layout);
|
m_buttons->setLayout(layout);
|
||||||
|
@ -116,6 +94,11 @@ GBAKeyEditor::GBAKeyEditor(InputController* controller, int type, const QString&
|
||||||
m_keyR
|
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_currentKey = m_keyOrder.end();
|
||||||
|
|
||||||
m_background.load(":/res/keymap.qpic");
|
m_background.load(":/res/keymap.qpic");
|
||||||
|
|
Loading…
Reference in New Issue