7 VymView::VymView(VymModel *model)
10 treeview=new QTreeView;
11 treeview->setModel ((QAbstractItemModel*)model);
12 treeview->setMinimumWidth (350);
13 treeview->setColumnWidth (0,350);
15 selModel=treeview->selectionModel();
16 model->setSelectionModel (selModel);
18 selModel, SIGNAL (selectionChanged(const QItemSelection &, const QItemSelection &)),
19 this,SLOT (changeSelection(const QItemSelection &,const QItemSelection &)));
21 // Create good old MapEditor
22 MapEditor* me=model->getMapEditor();
23 if (!me) me=new MapEditor (model);
25 selModel, SIGNAL (selectionChanged(const QItemSelection &, const QItemSelection &)),
26 me,SLOT (updateSelection(const QItemSelection &,const QItemSelection &)));
28 // VymModel may want to update selection, e.g. during animation
30 model, SIGNAL (selectionChanged(const QItemSelection &, const QItemSelection &)),
31 me,SLOT (updateSelection(const QItemSelection &,const QItemSelection &)));
34 //me->viewport()->setFocus();
35 //FIXME me->setAntiAlias (actionViewToggleAntiAlias->isOn());
36 //FIXME me->setSmoothPixmap(actionViewToggleSmoothPixmapTransform->isOn());
48 QItemSelectionModel* VymView::selectionModel()
53 std::cout <<"VymView::selectionModel: hey, no treeview so far???\n";
58 void VymView::changeSelection (const QItemSelection &newSel, const QItemSelection &delSel)
60 // FIXME Currently this works only from treeview->ME
61 treeview->expandAll(); //FIXME only for testing
63 ((VymModel*)treeview->model())->select ();