mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-12 08:16:16 -07:00
Fix crash caused by AdvancedSettings::addRow()
This commit is contained in:
parent
958b70e4ac
commit
9a393bbcea
1 changed files with 4 additions and 6 deletions
|
@ -312,14 +312,12 @@ void AdvancedSettings::addRow(int row, const QString &rowText, T* widget)
|
||||||
setItem(row, PROPERTY, new QTableWidgetItem(rowText));
|
setItem(row, PROPERTY, new QTableWidgetItem(rowText));
|
||||||
setCellWidget(row, VALUE, widget);
|
setCellWidget(row, VALUE, widget);
|
||||||
|
|
||||||
bool ok;
|
|
||||||
if (std::is_same<T, QCheckBox>::value)
|
if (std::is_same<T, QCheckBox>::value)
|
||||||
ok = connect(widget, SIGNAL(stateChanged(int)), SIGNAL(settingsChanged()));
|
connect(widget, SIGNAL(stateChanged(int)), SIGNAL(settingsChanged()));
|
||||||
else if (std::is_same<T, QSpinBox>::value)
|
else if (std::is_same<T, QSpinBox>::value)
|
||||||
ok = connect(widget, SIGNAL(valueChanged(int)), SIGNAL(settingsChanged()));
|
connect(widget, SIGNAL(valueChanged(int)), SIGNAL(settingsChanged()));
|
||||||
else if (std::is_same<T, QComboBox>::value)
|
else if (std::is_same<T, QComboBox>::value)
|
||||||
ok = connect(widget, SIGNAL(currentIndexChanged(int)), SIGNAL(settingsChanged()));
|
connect(widget, SIGNAL(currentIndexChanged(int)), SIGNAL(settingsChanged()));
|
||||||
else if (std::is_same<T, QLineEdit>::value)
|
else if (std::is_same<T, QLineEdit>::value)
|
||||||
ok = connect(widget, SIGNAL(textChanged(QString)), SIGNAL(settingsChanged()));
|
connect(widget, SIGNAL(textChanged(QString)), SIGNAL(settingsChanged()));
|
||||||
Q_ASSERT(ok);
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue