MCPcopy Create free account
hub / github.com/MITK/MITK / CreateCaptionForService

Method CreateCaptionForService

Modules/QtWidgets/src/QmitkServiceListWidget.cpp:236–256  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

234}
235
236QString QmitkServiceListWidget::CreateCaptionForService(const us::ServiceReferenceU &serviceRef)
237{
238 std::string caption;
239 // TODO allow more complex formatting
240 if (m_NamingProperty.empty())
241 caption = m_Interface;
242 else
243 {
244 us::Any prop = serviceRef.GetProperty(m_NamingProperty);
245 if (prop.Empty())
246 {
247 MITK_WARN << "QmitkServiceListWidget tried to resolve property '" + m_NamingProperty +
248 "' but failed. Resorting to interface name for display.";
249 caption = m_Interface;
250 }
251 else
252 caption = prop.ToString();
253 }
254
255 return QString::fromStdString(caption);
256}

Callers 2

AddServiceToListMethod · 0.95
ChangeServiceOnListMethod · 0.95

Calls 4

EmptyMethod · 0.80
emptyMethod · 0.45
GetPropertyMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected