38 #include <MemoryX/gui-plugins/SceneEditor/ui_ObjectExplorerWidget.h>
49 ui->objectExplorerTreeView->setModel(sourceModel);
51 std::shared_ptr<gui::ShortcutController> shortcutController =
control->getShortcutController();
52 QPointer<QAction> searchAction(
53 new OverrideAction(
"Object Explorer: Set Focus on Search Field",
this));
54 this->addAction(searchAction);
55 shortcutController->registerAction(searchAction->text(), searchAction);
59 connect(searchAction, SIGNAL(triggered()), ui->filterObjectClassesLineEdit, SLOT(setFocus()));
60 connect(ui->filterObjectClassesLineEdit,
61 SIGNAL(textChanged(QString)),
63 SLOT(filterFixedString()));
64 connect(ui->objectExplorerTreeView,
65 SIGNAL(clicked(QModelIndex)),
67 SLOT(getSelectedObject(QModelIndex)));
71 gui::ObjectExplorerWidget::filterFixedString()
73 QString searchPattern(ui->filterObjectClassesLineEdit->text());
74 sourceModel->setFilterFixedString(searchPattern);
76 if (searchPattern.isEmpty())
78 ui->objectExplorerTreeView->collapseAll();
82 ui->objectExplorerTreeView->expandAll();
87 gui::ObjectExplorerWidget::getSelectedObject(
const QModelIndex&
index)
89 std::pair<std::string, std::string>
object = sourceModel->getItemInformation(
index);
91 if (!
object.first.empty() && !
object.second.empty())
95 controller->triggerObjectClassSelected(
object.first,
object.second);
103 sourceModel->onConnect();
104 ui->objectExplorerTreeView->setModel(sourceModel);
115 ui->retranslateUi(
this);