29 : QWidget(parent, f), m_AutomaticallySelectFirstEntry(false), m_Controls(nullptr)
41 m_AutomaticallySelectFirstEntry = automaticallySelectFirstEntry;
51 m_Controls =
new Ui::QmitkServiceListWidgetControls;
63 SIGNAL(currentItemChanged(QListWidgetItem *, QListWidgetItem *)),
75 m_NamingProperty = namingProperty;
85 for (std::vector<us::ServiceReferenceU>::iterator it = services.begin(); it != services.end(); ++it)
93 return (this->
m_Controls->m_ServiceList->currentItem() !=
nullptr);
115 std::vector<us::ServiceReferenceU> result;
158 QListWidgetItem *newItem =
new QListWidgetItem;
174 if (m_AutomaticallySelectFirstEntry &&
m_Controls->m_ServiceList->selectedItems().isEmpty())
185 for (std::vector<QmitkServiceListWidget::ServiceListLink>::iterator it =
m_ListContent.begin();
189 if (serviceRef == it->service)
191 int row =
m_Controls->m_ServiceList->row(it->item);
192 QListWidgetItem *oldItem =
m_Controls->m_ServiceList->takeItem(row);
203 for (std::vector<QmitkServiceListWidget::ServiceListLink>::iterator it =
m_ListContent.begin();
207 if (serviceRef == it->service)
218 for (std::vector<QmitkServiceListWidget::ServiceListLink>::iterator it =
m_ListContent.begin();
221 if (item == it->item)
230 return m_Context->GetServiceReferences(m_Interface, m_Filter);
237 if (m_NamingProperty.empty())
238 caption = m_Interface;
241 us::Any prop = serviceRef.GetProperty(m_NamingProperty);
244 MITK_WARN <<
"QmitkServiceListWidget tried to resolve property '" + m_NamingProperty +
245 "' but failed. Resorting to interface name for display.";
246 caption = m_Interface;
252 return QString::fromStdString(caption);
ServiceReference< void > ServiceReferenceU
std::string ToString() const
ServiceReferenceU GetServiceReference() const
US_Core_EXPORT const std::string & OBJECTCLASS()
static ModuleContext * GetModuleContext()
Returns the module context of the calling module.