git-svn-id: svn://db.shs.com.ru/libs@605 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -34,6 +34,10 @@ QGLViewWindow::QGLViewWindow(QWidget * parent): QMainWindow(parent), Ui::QGLView
|
||||
icon_geo = QIcon(":/icons/type-geo.png");
|
||||
icon_camera = QIcon(":/icons/type-camera.png");
|
||||
icon_light = QIcon(":/icons/type-light.png");
|
||||
QAction * a = new QAction(QIcon(":/icons/edit-delete.png"), "Remove");
|
||||
connect(a, SIGNAL(triggered()), this, SLOT(removeObjects()));
|
||||
treeObjects->addAction(a);
|
||||
spinViewLineWidth->setValue(lineThickness()*2);
|
||||
|
||||
sel_obj = nullptr;
|
||||
view->view()->camera()->setAim(QVector3D());
|
||||
@@ -311,6 +315,16 @@ void QGLViewWindow::on_treeObjects_itemClicked(QTreeWidgetItem * ti, int) {
|
||||
}
|
||||
|
||||
|
||||
void QGLViewWindow::removeObjects() {
|
||||
QList<QTreeWidgetItem*> sil = treeObjects->selectedItems();
|
||||
foreach (QTreeWidgetItem * i, sil) {
|
||||
GLObjectBase * o = (GLObjectBase*)(i->data(0, Qt::UserRole).toULongLong());
|
||||
delete o;
|
||||
}
|
||||
qDeleteAll(sil);
|
||||
}
|
||||
|
||||
|
||||
void QGLViewWindow::objectsTreeChanged() {
|
||||
treeObjects->clear();
|
||||
makeObjetTree(&(view->view()->rootObject()), treeObjects->invisibleRootItem());
|
||||
|
||||
Reference in New Issue
Block a user