diff -r 59614eaf5fbb -r 0301e6109702 vymview.cpp --- a/vymview.cpp Wed Apr 29 18:46:31 2009 +0000 +++ b/vymview.cpp Wed Apr 29 21:40:37 2009 +0000 @@ -17,10 +17,7 @@ treeview=new QTreeView; treeview->setModel ((QAbstractItemModel*)model); //treeview->setMinimumWidth (50); - QList widths; - widths<<30; - widths<<150; - setSizes(widths); + treeview->setColumnWidth (0,350); selModel=treeview->selectionModel(); @@ -30,11 +27,11 @@ this,SLOT (changeSelection(const QItemSelection &,const QItemSelection &))); // Create good old MapEditor - MapEditor* me=model->getMapEditor(); - if (!me) me=new MapEditor (model); + mapEditor=model->getMapEditor(); + if (!mapEditor) mapEditor=new MapEditor (model); connect ( selModel, SIGNAL (selectionChanged(const QItemSelection &, const QItemSelection &)), - me,SLOT (updateSelection(const QItemSelection &,const QItemSelection &))); + mapEditor,SLOT (updateSelection(const QItemSelection &,const QItemSelection &))); /* connect ( selModel, SIGNAL (currentChanged(const QModelIndex &, const QModelIndex &)), @@ -44,32 +41,36 @@ */ connect ( model, SIGNAL (dataChanged(const QModelIndex &, const QModelIndex &)), - me,SLOT (updateData(const QModelIndex &) ) ); + mapEditor,SLOT (updateData(const QModelIndex &) ) ); // VymModel may want to update selection or other data, e.g. during animation connect ( model, SIGNAL (selectionChanged(const QItemSelection &, const QItemSelection &)), - me,SLOT (updateSelection(const QItemSelection &,const QItemSelection &))); + mapEditor,SLOT (updateSelection(const QItemSelection &,const QItemSelection &))); + + /* connect ( model, SIGNAL (newChildObject(QModelIndex) ), this,SLOT (updateChilds (QModelIndex) ) ); +*/ + connect ( model, SIGNAL (noteHasChanged(QModelIndex) ), mainWindow, SLOT (updateNoteEditor (QModelIndex) ) ); - //me->viewport()->setFocus(); //FIXME-3 needed? - me->setAntiAlias (mainWindow->isAliased()); - me->setSmoothPixmap(mainWindow->hasSmoothPixmapTransform()); + //mapEditor->viewport()->setFocus(); //FIXmapEditor-3 needed? + mapEditor->setAntiAlias (mainWindow->isAliased()); + mapEditor->setSmoothPixmap(mainWindow->hasSmoothPixmapTransform()); addWidget (treeview); - addWidget (me); + addWidget (mapEditor); // Set geometry - QList sizes; - sizes.append (120); - sizes.append (600); - setSizes (sizes); + QList widths; + widths<<120; + widths<<600; + setSizes(widths); } QItemSelectionModel* VymView::selectionModel() @@ -82,9 +83,10 @@ } -void VymView::updateChilds (QModelIndex ix) +void VymView::updateChilds (QModelIndex ix) //FIXME-4 not needed? { - treeview->setExpanded (ix,true); + cout << "VV::updateChilds \n"; + //treeview->setExpanded (ix,true); // This is expensive... } void VymView::changeSelection (const QItemSelection &newsel, const QItemSelection &oldsel)