Fixup: Capture Tab for QLineEditKeyConfig, and don't enable Tab focus for it

This commit is contained in:
chinhodado 2015-08-05 20:36:58 -04:00
parent 7af2ea816f
commit 8cfb4b13f2
3 changed files with 6 additions and 1 deletions

View file

@ -27,3 +27,7 @@ void QLineEditKeyConfig::keyPressEvent(QKeyEvent* event) {
emit ValueChanged(button, event->key()); emit ValueChanged(button, event->key());
} }
bool QLineEditKeyConfig::focusNextPrevChild(bool next) {
return false;
}

View file

@ -22,7 +22,7 @@ public:
Settings::NativeInput::Values button; Settings::NativeInput::Values button;
QLineEditKeyConfig(Settings::NativeInput::Values button, QWidget* parent = nullptr); QLineEditKeyConfig(Settings::NativeInput::Values button, QWidget* parent = nullptr);
void keyPressEvent(QKeyEvent* event) override; void keyPressEvent(QKeyEvent* event) override;
bool focusNextPrevChild(bool next) override;
signals: signals:
void ValueChanged(Settings::NativeInput::Values, int); void ValueChanged(Settings::NativeInput::Values, int);
}; };

View file

@ -21,6 +21,7 @@ GInputsDialog::GInputsDialog(QWidget* parent) : QDialog(parent) {
// create the lineEdits // create the lineEdits
for (int i = 0; i < Settings::NativeInput::NUM_INPUTS; ++i) { for (int i = 0; i < Settings::NativeInput::NUM_INPUTS; ++i) {
lineEdits[i] = new QLineEditKeyConfig(Settings::NativeInput::All[i]); lineEdits[i] = new QLineEditKeyConfig(Settings::NativeInput::All[i]);
lineEdits[i]->setFocusPolicy(Qt::ClickFocus);
} }
// put the lineEdits and their labels into a grid // put the lineEdits and their labels into a grid