Skip to content

Commit

Permalink
Editor: Right-click on an item in the hierarchy must select item #424
Browse files Browse the repository at this point in the history
  • Loading branch information
eprikazchikov committed Oct 23, 2021
1 parent 1725265 commit 67607b4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion worldeditor/src/editors/objecthierarchy/hierarchybrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ void HierarchyBrowser::on_treeView_clicked(const QModelIndex &index) {
}

if(index.column() == 2) {
Actor *object = static_cast<Actor *>(m_filter->mapToSource(index).internalPointer());
Actor *object = static_cast<Actor *>(m_filter->mapToSource(index).internalPointer());
object->setEnabled(!object->isEnabled());
}
emit selected(list);
Expand All @@ -284,6 +284,13 @@ void HierarchyBrowser::on_lineEdit_textChanged(const QString &arg1) {
}

void HierarchyBrowser::on_treeView_customContextMenuRequested(const QPoint &pos) {
QItemSelectionModel *select = ui->treeView->selectionModel();
Object::ObjectList list;
foreach(QModelIndex it, select->selectedRows()) {
list.push_back(static_cast<Object *>(m_filter->mapToSource(it).internalPointer()));
}
emit selected(list);

if(m_contentMenu) {
m_contentMenu->exec(static_cast<QWidget*>(QObject::sender())->mapToGlobal(pos));
}
Expand Down

0 comments on commit 67607b4

Please sign in to comment.