Commit 7d609bc3 authored by lm's avatar lm

Fixed minor bug in QGCToolWidget

parent 1523f3a4
...@@ -208,7 +208,10 @@ QList<QGCToolWidgetItem*>* QGCToolWidget::itemList() ...@@ -208,7 +208,10 @@ QList<QGCToolWidgetItem*>* QGCToolWidget::itemList()
void QGCToolWidget::addParam() void QGCToolWidget::addParam()
{ {
QGCParamSlider* slider = new QGCParamSlider(this); QGCParamSlider* slider = new QGCParamSlider(this);
if (ui->hintLabel) delete ui->hintLabel; if (ui->hintLabel)
{
ui->hintLabel->deleteLater();
}
toolLayout->addWidget(slider); toolLayout->addWidget(slider);
slider->startEditMode(); slider->startEditMode();
} }
...@@ -216,14 +219,20 @@ void QGCToolWidget::addParam() ...@@ -216,14 +219,20 @@ void QGCToolWidget::addParam()
void QGCToolWidget::addAction() void QGCToolWidget::addAction()
{ {
QGCActionButton* button = new QGCActionButton(this); QGCActionButton* button = new QGCActionButton(this);
if (ui->hintLabel) delete ui->hintLabel; if (ui->hintLabel)
{
ui->hintLabel->deleteLater();
}
toolLayout->addWidget(button); toolLayout->addWidget(button);
button->startEditMode(); button->startEditMode();
} }
void QGCToolWidget::addToolWidget(QGCToolWidgetItem* widget) void QGCToolWidget::addToolWidget(QGCToolWidgetItem* widget)
{ {
if (ui->hintLabel) delete ui->hintLabel; if (ui->hintLabel)
{
ui->hintLabel->deleteLater();
}
toolLayout->addWidget(widget); toolLayout->addWidget(widget);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment