diff --git a/src/frontend/netdetails/ipv4page.cpp b/src/frontend/netdetails/ipv4page.cpp index e03d4041..df031a82 100644 --- a/src/frontend/netdetails/ipv4page.cpp +++ b/src/frontend/netdetails/ipv4page.cpp @@ -291,13 +291,12 @@ void Ipv4Page::configChanged(int index) { void Ipv4Page::onAddressTextChanged() { + m_iconLabel->hide(); + m_textLabel->hide(); + if (!getTextEditState(ipv4addressEdit->text())) { - m_iconLabel->hide(); - m_textLabel->hide(); m_addressHintLabel->setText(tr("Invalid address")); } else { - m_iconLabel->hide(); - m_textLabel->hide(); m_addressHintLabel->clear(); } } @@ -406,7 +405,7 @@ void Ipv4Page::initConflictHintLable() m_iconLabel->setPixmap(icon.pixmap(ICON_SIZE)); m_textLabel = new QLabel(m_addressHintLabel); m_textLabel->setText(tr("Address conflict")); - QHBoxLayout *conflictHintLayout = new QHBoxLayout(); + QHBoxLayout *conflictHintLayout = new QHBoxLayout(m_addressHintLabel); conflictHintLayout->setContentsMargins(0, 0, 0, 0); conflictHintLayout->addWidget(m_iconLabel); conflictHintLayout->addWidget(m_textLabel); diff --git a/src/frontend/netdetails/ipv6page.cpp b/src/frontend/netdetails/ipv6page.cpp index 59dc59db..37c0aaea 100644 --- a/src/frontend/netdetails/ipv6page.cpp +++ b/src/frontend/netdetails/ipv6page.cpp @@ -270,13 +270,12 @@ void Ipv6Page::setEnableOfSaveBtn() void Ipv6Page::onAddressTextChanged() { + m_iconLabel->hide(); + m_textLabel->hide(); + if (!getIpv6EditState(ipv6AddressEdit->text())) { - m_iconLabel->hide(); - m_textLabel->hide(); m_addressHintLabel->setText(tr("Invalid address")); } else { - m_iconLabel->hide(); - m_textLabel->hide(); m_addressHintLabel->clear(); } } @@ -344,7 +343,7 @@ void Ipv6Page::initConflictHintLable() m_iconLabel->setPixmap(icon.pixmap(ICON_SIZE)); m_textLabel = new QLabel(m_addressHintLabel); m_textLabel->setText(tr("Address conflict")); - QHBoxLayout *conflictHintLayout = new QHBoxLayout(); + QHBoxLayout *conflictHintLayout = new QHBoxLayout(m_addressHintLabel); conflictHintLayout->setContentsMargins(0, 0, 0, 0); conflictHintLayout->addWidget(m_iconLabel); conflictHintLayout->addWidget(m_textLabel);