vymview.cpp
changeset 761 0301e6109702
parent 759 bf3ea1f1520b
child 763 8c028a5d9083
     1.1 --- a/vymview.cpp	Wed Apr 29 18:46:31 2009 +0000
     1.2 +++ b/vymview.cpp	Wed Apr 29 21:40:37 2009 +0000
     1.3 @@ -17,10 +17,7 @@
     1.4  	treeview=new QTreeView;
     1.5  	treeview->setModel ((QAbstractItemModel*)model);
     1.6  	//treeview->setMinimumWidth (50);
     1.7 -	QList <int> widths;
     1.8 -	widths<<30;
     1.9 -	widths<<150;
    1.10 -	setSizes(widths);
    1.11 +
    1.12  	treeview->setColumnWidth (0,350);
    1.13  
    1.14  	selModel=treeview->selectionModel();
    1.15 @@ -30,11 +27,11 @@
    1.16  		this,SLOT (changeSelection(const QItemSelection &,const QItemSelection &)));
    1.17  
    1.18  	// Create good old MapEditor
    1.19 -	MapEditor* me=model->getMapEditor();
    1.20 -	if (!me) me=new MapEditor (model);
    1.21 +	mapEditor=model->getMapEditor();
    1.22 +	if (!mapEditor) mapEditor=new MapEditor (model);
    1.23  	connect (
    1.24  		selModel, SIGNAL (selectionChanged(const QItemSelection &, const QItemSelection &)), 
    1.25 -		me,SLOT (updateSelection(const QItemSelection &,const QItemSelection &)));
    1.26 +		mapEditor,SLOT (updateSelection(const QItemSelection &,const QItemSelection &)));
    1.27  		/*
    1.28  	connect (
    1.29  		selModel, SIGNAL (currentChanged(const QModelIndex &, const QModelIndex &)), 
    1.30 @@ -44,32 +41,36 @@
    1.31  */
    1.32  	connect (
    1.33  		model, SIGNAL (dataChanged(const QModelIndex &, const QModelIndex &)), 
    1.34 -		me,SLOT (updateData(const QModelIndex &) ) );
    1.35 +		mapEditor,SLOT (updateData(const QModelIndex &) ) );
    1.36  
    1.37  	// VymModel may want to update selection or other data, e.g. during animation
    1.38  	connect (
    1.39  		model, SIGNAL (selectionChanged(const QItemSelection &, const QItemSelection &)), 
    1.40 -		me,SLOT (updateSelection(const QItemSelection &,const QItemSelection &)));
    1.41 +		mapEditor,SLOT (updateSelection(const QItemSelection &,const QItemSelection &)));
    1.42 +
    1.43 +		/*
    1.44  	connect (
    1.45  		model, SIGNAL (newChildObject(QModelIndex) ),
    1.46  		this,SLOT (updateChilds (QModelIndex) ) );
    1.47 +*/
    1.48 +
    1.49  	connect (
    1.50  		model, SIGNAL (noteHasChanged(QModelIndex) ),
    1.51  		mainWindow, SLOT (updateNoteEditor (QModelIndex) ) );
    1.52  		
    1.53  
    1.54 -	//me->viewport()->setFocus();	//FIXME-3 needed?
    1.55 -	me->setAntiAlias (mainWindow->isAliased());
    1.56 -	me->setSmoothPixmap(mainWindow->hasSmoothPixmapTransform());
    1.57 +	//mapEditor->viewport()->setFocus();	//FIXmapEditor-3 needed?
    1.58 +	mapEditor->setAntiAlias (mainWindow->isAliased());
    1.59 +	mapEditor->setSmoothPixmap(mainWindow->hasSmoothPixmapTransform());
    1.60  
    1.61  	addWidget (treeview);
    1.62 -	addWidget (me);
    1.63 +	addWidget (mapEditor);
    1.64  
    1.65  	// Set geometry
    1.66 -	QList <int> sizes;
    1.67 -	sizes.append (120);
    1.68 -	sizes.append (600);
    1.69 -	setSizes (sizes);
    1.70 +	QList <int> widths;
    1.71 +	widths<<120;
    1.72 +	widths<<600;
    1.73 +	setSizes(widths);
    1.74  }
    1.75  
    1.76  QItemSelectionModel* VymView::selectionModel() 
    1.77 @@ -82,9 +83,10 @@
    1.78  }
    1.79  
    1.80  
    1.81 -void VymView::updateChilds (QModelIndex ix)
    1.82 +void VymView::updateChilds (QModelIndex ix)		//FIXME-4 not needed?
    1.83  {
    1.84 -	treeview->setExpanded (ix,true);
    1.85 +	cout << "VV::updateChilds \n";
    1.86 +	//treeview->setExpanded (ix,true);	// This is expensive...
    1.87  }
    1.88  
    1.89  void VymView::changeSelection (const QItemSelection &newsel, const QItemSelection &oldsel)