62 layout->addWidget(newWidget);
67 while ((child = layout->takeAt(0)) != 0)
69 QWidget* widget = child->widget();
81 BaseWidget(parent,
"network_connections_widget",
"Network Connections"),
82 mConnections(connections)
85 "Selected Network Connection",
89 this, &NetworkConnectionsWidget::onConnectionSelected);
92 this, &NetworkConnectionsWidget::onNetworkManagerChanged);
95 QVBoxLayout* topLayout =
new QVBoxLayout(
this);
96 topLayout->addWidget(mConnectionSelectionWidget);
98 topLayout->addStretch();
100 this->onNetworkManagerChanged();
103 void NetworkConnectionsWidget::onNetworkManagerChanged()
105 QString value = mConnectionSelector->getValue();
106 QStringList connectionUids = mConnections->getConnectionUids();
108 if (!connectionUids.count(value))
109 value = connectionUids.empty() ?
"" : connectionUids.front();
111 mConnectionSelector->setValueRange(connectionUids);
112 mConnectionSelector->setValue(value);
114 this->updateConnectionWidget();
117 void NetworkConnectionsWidget::onConnectionSelected()
119 this->updateConnectionWidget();
122 void NetworkConnectionsWidget::updateConnectionWidget()
129 mOptionsWidget->
groupBox->setTitle(connection->getNetworkConnection()->getUid());
QDomElement getElement()
return the current element
void changed()
emit when the underlying data value is changed: The user interface will be updated.
static StringPropertyPtr initialize(const QString &uid, QString name, QString help, QString value, QStringList range, QDomNode root=QDomNode())
boost::shared_ptr< class NetworkConnectionHandle > NetworkConnectionHandlePtr
boost::shared_ptr< class NetworkServiceImpl > NetworkServiceImplPtr
void connectionsChanged()
Namespace for all CustusX production code.