1.1 --- a/vymview.cpp Tue Nov 17 08:24:59 2009 +0000
1.2 +++ b/vymview.cpp Wed Nov 25 10:58:21 2009 +0000
1.3 @@ -49,9 +49,11 @@
1.4 this,SLOT (changeSelection(const QItemSelection &,const QItemSelection &)));
1.5
1.6 // Tell MapEditor to update selection
1.7 + /* FIXME-3 done implicit here in VymView
1.8 connect (
1.9 selModel, SIGNAL (selectionChanged(const QItemSelection &, const QItemSelection &)),
1.10 mapEditor,SLOT (updateSelection(const QItemSelection &,const QItemSelection &)));
1.11 + */
1.12
1.13 // FIXME-2 testing, if that reenables updating selbox during animation
1.14 connect (
1.15 @@ -121,13 +123,12 @@
1.16 mapEditor->setFocus();
1.17 }
1.18
1.19 -void VymView::changeSelection (const QItemSelection &newsel, const QItemSelection &oldsel)
1.20 +void VymView::changeSelection (const QItemSelection &newsel, const QItemSelection &oldsel)
1.21 {
1.22 - // Notify mainwindow to update satellites like NoteEditor, if needed (model==currenModel...)
1.23 - mainWindow->changeSelection (model,newsel,oldsel); // FIXME-5 maybe connect VymModel <-> MainWindow directly?
1.24 - // would require to also get current model in mainWindow
1.25 + //cout << "VV::changeSelection newsel.count="<<newsel.indexes().count()<<endl;
1.26
1.27 - //cout << "VV::changeSelection newsel.count="<<newsel.indexes().count()<<endl;
1.28 + mainWindow->changeSelection (model,newsel,oldsel);
1.29 + mapEditor->updateSelection (newsel,oldsel);
1.30
1.31 if (newsel.indexes().count()>0)
1.32 {
1.33 @@ -137,10 +138,12 @@
1.34 treeEditor->getProxyModel()->mapSelectionFromSource (newsel),
1.35 QItemSelectionModel::ClearAndSelect );
1.36 */
1.37 +
1.38 QModelIndex ix=newsel.indexes().first();
1.39 selModel->setCurrentIndex (ix,QItemSelectionModel::ClearAndSelect );
1.40 treeEditor->setCurrentIndex (ix);
1.41 showSelection();
1.42 +
1.43 }
1.44 }
1.45
1.46 @@ -256,6 +259,6 @@
1.47 {
1.48 QModelIndex ix=model->getSelectedIndex();
1.49 treeEditor->scrollTo( ix, QAbstractItemView::EnsureVisible);
1.50 - mapEditor->scrollTo ( ix);
1.51 + mapEditor->scrollTo ( ix); // FIXME-3 also called from MapEditor::updateSelection...
1.52 }
1.53