Qt: Merge findFocus from master
Jeffrey Pfau jeffrey@endrift.com
Mon, 05 Jan 2015 04:21:56 -0800
2 files changed,
15 insertions(+),
0 deletions(-)
M
src/platform/qt/GBAKeyEditor.cpp
→
src/platform/qt/GBAKeyEditor.cpp
@@ -179,6 +179,20 @@ m_controller->bindKey(m_type, m_keyR->value(), GBA_KEY_R);
m_controller->saveConfiguration(m_type); } +bool GBAKeyEditor::findFocus() { + if (m_currentKey != m_keyOrder.end() && (*m_currentKey)->hasFocus()) { + return true; + } + + for (auto key = m_keyOrder.begin(); key != m_keyOrder.end(); ++key) { + if ((*key)->hasFocus()) { + m_currentKey = key; + return true; + } + } + return false; +} + #ifdef BUILD_SDL void GBAKeyEditor::testGamepad() { QSet<int> activeKeys = m_controller->activeGamepadButtons();
M
src/platform/qt/GBAKeyEditor.h
→
src/platform/qt/GBAKeyEditor.h
@@ -31,6 +31,7 @@
private slots: void setNext(); void save(); + bool findFocus(); #ifdef BUILD_SDL void testGamepad(); #endif