33 : QWidget(parent, f), m_AutomaticallySelectFirstEntry(false), m_Controls(NULL)
45 m_AutomaticallySelectFirstEntry = automaticallySelectFirstEntry;
55 m_Controls =
new Ui::QmitkServiceListWidgetControls;
67 SIGNAL(currentItemChanged(QListWidgetItem *, QListWidgetItem *)),
79 m_NamingProperty = namingProperty;
89 for (std::vector<us::ServiceReferenceU>::iterator it = services.begin(); it != services.end(); ++it)
97 return (this->
m_Controls->m_ServiceList->currentItem() != 0);
119 std::vector<us::ServiceReferenceU> result;
162 QListWidgetItem *newItem =
new QListWidgetItem;
178 if (m_AutomaticallySelectFirstEntry &&
m_Controls->m_ServiceList->selectedItems().isEmpty())
189 for (std::vector<QmitkServiceListWidget::ServiceListLink>::iterator it =
m_ListContent.begin();
193 if (serviceRef == it->service)
195 int row =
m_Controls->m_ServiceList->row(it->item);
196 QListWidgetItem *oldItem =
m_Controls->m_ServiceList->takeItem(row);
207 for (std::vector<QmitkServiceListWidget::ServiceListLink>::iterator it =
m_ListContent.begin();
211 if (serviceRef == it->service)
222 for (std::vector<QmitkServiceListWidget::ServiceListLink>::iterator it =
m_ListContent.begin();
225 if (item == it->item)
234 return m_Context->GetServiceReferences(m_Interface, m_Filter);
241 if (m_NamingProperty.empty())
242 caption = m_Interface;
245 us::Any prop = serviceRef.GetProperty(m_NamingProperty);
248 MITK_WARN <<
"QmitkServiceListWidget tried to resolve property '" + m_NamingProperty +
249 "' but failed. Resorting to interface name for display.";
250 caption = m_Interface;
256 return QString::fromStdString(caption);
ServiceReference< void > ServiceReferenceU
ServiceReferenceU GetServiceReference() const
US_Core_EXPORT const std::string & OBJECTCLASS()
std::string ToString() const
static ModuleContext * GetModuleContext()
Returns the module context of the calling module.