7 #include "monitorQt/action/ClassFactoryRegistryInfo.hpp" 9 #include <fwCore/base.hpp> 11 #include <fwServices/macros.hpp> 12 #include <fwServices/registry/ServiceFactory.hpp> 14 #include <QHBoxLayout> 39 m_tree->clearSelection();
42 typedef ::fwServices::registry::ServiceFactory ServiceRegistry;
43 const ServiceRegistry::KeyVectorType& factoryKeys = ServiceRegistry::getDefault()->getFactoryKeys();
45 for( ServiceRegistry::KeyVectorType::value_type key : factoryKeys )
47 const auto objImpl = ServiceRegistry::getDefault()->getServiceObjects(key);
48 QTreeWidgetItem* srvItem =
new QTreeWidgetItem();
49 srvItem->setText(0, QString::fromStdString(key));
50 srvItem->setText(1, QString::fromStdString(objImpl[0]));
51 m_tree->addTopLevelItem( srvItem );
69 QWidget* parent = qApp->activeWindow();
70 m_dialog =
new QDialog(parent);
71 m_dialog->setWindowTitle(
"ServiceFactoryRegistry");
72 m_dialog->setMinimumSize(800, 600);
74 QHBoxLayout* sizer =
new QHBoxLayout();
75 m_tree =
new QTreeWidget( m_dialog );
76 QStringList headerList = (QStringList() <<
"Service" <<
"Object");
77 m_tree->setColumnCount(2);
78 m_tree->setHeaderLabels(headerList);
79 m_tree->setColumnWidth(0, 300);
80 m_tree->setColumnWidth(1, 460);
81 m_tree->setSelectionMode(QAbstractItemView::SingleSelection);
82 m_tree->setAlternatingRowColors(
true );
84 sizer->addWidget( m_tree );
85 m_dialog->setLayout( sizer );
FWGUI_API void actionServiceStarting()
Method called when the action service is starting.
FWGUI_API void actionServiceStopping()
Method called when the action service is stopping.
Defines the service interface managing the menu items.
void stopping() override
Delete dialog box.
virtual MONITORQT_API ~ClassFactoryRegistryInfo() noexcept
Does nothing.
MONITORQT_API ClassFactoryRegistryInfo() noexcept
Does nothing.
FWGUI_API void initialize()
Initialize the action.
Base class for each data object.
Implements an action to show services registered in factory.
void updating() override
Fill factory information in m_tree and show the dialog.
void configuring() override
Calls classic IAction methods to configure.
void starting() override
Prepare dialog box.