Skip to content

Commit 616b184

Browse files
author
Time Markov
committed
Hide result group box in case of void abi function
1 parent 8f586bb commit 616b184

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/qt/contractresult.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,13 @@ void ContractResult::updateCallResult(QVariant result, FunctionABI function, QSt
141141
std::vector<ParameterABI::ErrorType> errors;
142142
if(function.abiOut(rawData, values, errors))
143143
{
144+
// Remove previous widget from scroll area
145+
QWidget *scrollWidget = ui->scrollAreaResult->widget();
146+
if(scrollWidget)
147+
scrollWidget->deleteLater();
148+
144149
if(values.size() > 0)
145150
{
146-
// Remove previous widget from scroll area
147-
QWidget *scrollWidget = ui->scrollAreaResult->widget();
148-
if(scrollWidget)
149-
scrollWidget->deleteLater();
150-
151151
QWidget *widgetResults = new QWidget(this);
152152
QVBoxLayout *vLayout = new QVBoxLayout(widgetResults);
153153
vLayout->setSpacing(6);
@@ -182,6 +182,11 @@ void ContractResult::updateCallResult(QVariant result, FunctionABI function, QSt
182182
widgetResults->adjustSize();
183183
ui->scrollAreaResult->setMaximumHeight(widgetResults->sizeHint().height() + 2);
184184
ui->scrollAreaResult->setWidget(widgetResults);
185+
ui->groupBoxResult->setVisible(true);
186+
}
187+
else
188+
{
189+
ui->groupBoxResult->setVisible(false);
185190
}
186191
}
187192
else

0 commit comments

Comments
 (0)