Fix bug in Add increment tool button.
--HG-- branch : develop
This commit is contained in:
parent
1393be669b
commit
1f25b81f88
|
@ -750,14 +750,20 @@ void DialogIncrements::AddNewIncrement(IncrementType type)
|
|||
{
|
||||
qCDebug(vDialog, "Add new increment");
|
||||
|
||||
auto *action = qobject_cast<QAction *>(sender());
|
||||
if (action == nullptr)
|
||||
bool incrementMode = true;
|
||||
if (auto *action = qobject_cast<QAction *>(sender()))
|
||||
{
|
||||
incrementMode = action->data().toBool();
|
||||
}
|
||||
else if (auto *button = qobject_cast<QToolButton *>(sender()))
|
||||
{
|
||||
incrementMode = button == ui->toolButtonAdd;
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const bool incrementMode = action->data().toBool();
|
||||
|
||||
QTableWidget *table = incrementMode ? ui->tableWidgetIncrement : ui->tableWidgetPC;
|
||||
|
||||
const QString name = GetCustomName();
|
||||
|
|
Loading…
Reference in New Issue
Block a user