diff options
author | Thiago A. Correa <thiago.correa@gmail.com> | 2013-01-24 01:14:11 -0200 |
---|---|---|
committer | Denis Shienkov <denis.shienkov@gmail.com> | 2013-01-28 15:41:46 +0100 |
commit | 51f6c3ee7fcd26fe7a5071a1d41d8f938c6ccb82 (patch) | |
tree | 7da08af26659c35a8556d5da2af3c38af4af0c71 /examples | |
parent | b14419104e2ebbc4ec545fe6e43c8512ff24ab76 (diff) |
Improve terminal example handling of custom baud rate.
This makes the custom baud rate handling independent on
the index of the last entry in the QComboBox.
Change-Id: I5f0bfa148595e4312a8721a690e87e2fc36906d9
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/terminal/settingsdialog.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/terminal/settingsdialog.cpp b/examples/terminal/settingsdialog.cpp index 63044f96..1abc591d 100644 --- a/examples/terminal/settingsdialog.cpp +++ b/examples/terminal/settingsdialog.cpp @@ -100,12 +100,13 @@ void SettingsDialog::apply() void SettingsDialog::checkCustomBaudRatePolicy(int idx) { - ui->baudRateBox->setEditable(idx == 4); - if (idx == 4) { + bool isCustomBaudRate = !ui->baudRateBox->itemData(idx).isValid(); + if (isCustomBaudRate) { ui->baudRateBox->clearEditText(); QLineEdit *edit = ui->baudRateBox->lineEdit(); edit->setValidator(intValidator); } + ui->baudRateBox->setEditable(isCustomBaudRate); } void SettingsDialog::fillPortsParameters() |