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 selModel, SIGNAL (currentChanged(const QModelIndex &, const QModelIndex &)),
29 me,SLOT (updateCurrent(const QModelIndex &,const QModelIndex &)));
31 // VymModel may want to update selection, e.g. during animation
33 model, SIGNAL (selectionChanged(const QItemSelection &, const QItemSelection &)),
34 me,SLOT (updateSelection(const QItemSelection &,const QItemSelection &)));
36 //me->viewport()->setFocus();
37 //FIXME me->setAntiAlias (actionViewToggleAntiAlias->isOn());
38 //FIXME me->setSmoothPixmap(actionViewToggleSmoothPixmapTransform->isOn());
50 QItemSelectionModel* VymView::selectionModel()
55 std::cout <<"VymView::selectionModel: hey, no treeview so far???\n";
60 void VymView::changeSelection (const QItemSelection &newSel, const QItemSelection &delSel)
62 // FIXME Currently this works only from treeview->ME
63 treeview->expandAll(); //FIXME only for testing
65 ((VymModel*)treeview->model())->select ();