void RightPaneWidget::objectAdded(QObject *obj) { BaseRightPaneWidget *rpw = qobject_cast<BaseRightPaneWidget *>(obj); if (rpw) { layout()->addWidget(rpw->widget()); setFocusProxy(rpw->widget()); } }
void RightPaneWidget::aboutToRemoveObject(QObject *obj) { BaseRightPaneWidget *rpw = qobject_cast<BaseRightPaneWidget *>(obj); if (rpw) { delete rpw->widget(); } }
RightPaneWidget::RightPaneWidget() : m_shown(true), m_width(0) { m_instance = this; QVBoxLayout *layout = new QVBoxLayout; layout->setMargin(0); setLayout(layout); ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); BaseRightPaneWidget *rpw = pm->getObject<BaseRightPaneWidget>(); if (rpw) { layout->addWidget(rpw->widget()); } connect(pm, SIGNAL(objectAdded(QObject *)), this, SLOT(objectAdded(QObject *))); connect(pm, SIGNAL(aboutToRemoveObject(QObject *)), this, SLOT(aboutToRemoveObject(QObject *))); }