summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorDenis Shienkov <denis.shienkov@gmail.com>2013-03-22 22:35:56 +0400
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-03-25 10:27:50 +0100
commit48670b8437902548f1aec7f4f973fc84dcd12349 (patch)
tree3f9ae19628d76940d07f8b82560c974786cf7e5e /examples
parent23f8a58652e3ac4398d508691d227b3c75811e8f (diff)
downloadqtserialport-48670b8437902548f1aec7f4f973fc84dcd12349.tar.gz
Fix crash the Terminal example when trying to select the custom baud rate
Attempting to choose from QComboBox the custom baud rate leads to crash because the null pointer is returned to the QLineEdit and call the method for setup the validator by null pointer. Only editable combo boxes have a line edit, so trying to set a non-editable is dereferencing a null ptr. Change-Id: Ia9aaef64ef908b1b2d95090a203dc223d12f0b76 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Laszlo Papp <lpapp@kde.org>
Diffstat (limited to 'examples')
-rw-r--r--examples/terminal/settingsdialog.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/terminal/settingsdialog.cpp b/examples/terminal/settingsdialog.cpp
index c516a75..57370d2 100644
--- a/examples/terminal/settingsdialog.cpp
+++ b/examples/terminal/settingsdialog.cpp
@@ -103,12 +103,12 @@ void SettingsDialog::apply()
void SettingsDialog::checkCustomBaudRatePolicy(int idx)
{
bool isCustomBaudRate = !ui->baudRateBox->itemData(idx).isValid();
+ ui->baudRateBox->setEditable(isCustomBaudRate);
if (isCustomBaudRate) {
ui->baudRateBox->clearEditText();
QLineEdit *edit = ui->baudRateBox->lineEdit();
edit->setValidator(intValidator);
}
- ui->baudRateBox->setEditable(isCustomBaudRate);
}
void SettingsDialog::fillPortsParameters()