1 #include "treeeditor.h"
9 ///////////////////////////////////////////////////////////////////////
10 ///////////////////////////////////////////////////////////////////////
11 TreeEditor::TreeEditor(VymModel *m)
13 //cout << "Constructor TreeEditor "<<this<<endl;
18 // Shortcuts for navigating with cursor:
19 a = new QAction(tr( "Select upper object","Tree Editor" ), this);
20 a->setStatusTip ( tr( "Select upper object" ));
21 a->setShortcut (Qt::Key_Up );
22 // a->setShortcutContext (Qt::WindowShortcut);
23 a->setShortcutContext (Qt::WidgetShortcut);
24 // a->setShortcutContext (Qt::WidgetWithChildrenShortcut);
26 connect( a, SIGNAL( triggered() ), this, SLOT( cursorUp() ) );
28 a = new QAction( tr( "Select lower object","Tree Editor" ),this);
29 a->setStatusTip (tr( "Select lower object" ));
30 a->setShortcut ( Qt::Key_Down );
31 // a->setShortcutContext (Qt::WindowShortcut);
32 // a->setShortcutContext (Qt::WidgetWithChildrenShortcut);
33 a->setShortcutContext (Qt::WidgetShortcut);
35 connect( a, SIGNAL( triggered() ), this, SLOT( cursorDown() ) );
38 TreeEditor::~TreeEditor()
40 //cout <<"Destructor TreeEditor for "<<model->getMapName().toStdString()<<endl;
43 void TreeEditor::cursorUp()
45 model->select (indexAbove (model->getSelectedIndex() ));
48 void TreeEditor::cursorDown()
50 model->select (indexBelow (model->getSelectedIndex() ));