void IP_Widget::addTab() { int i = ipSet->addTab(new _IP_Widget(this, &IPv4HasDHCP, &IPv6HasDHCP), "IP Element"); _IP_Widget *wdg = static_cast<_IP_Widget*>(ipSet->widget(i)); if ( NULL!=wdg ) { connect(wdg, SIGNAL(dhcpUsageChanged()), this, SLOT(updateDHCPUsage())); }; }
void IP_Widget::closeTab(int i) { if ( ipSet->count()<2 ) return; _IP_Widget *wdg = static_cast<_IP_Widget*>(ipSet->widget(i)); if ( nullptr!=wdg ) { wdg->ipv6->click(); wdg->updateDHCPUsage(); disconnect(wdg, SIGNAL(dhcpUsageChanged()), this, SLOT(updateDHCPUsage())); ipSet->removeTab(i); wdg->deleteLater(); }; }