selection.h
changeset 728 a8a98a94899a
parent 726 7f43b93242aa
child 729 7ddbe3fa34a1
     1.1 --- a/selection.h	Wed Oct 29 17:42:34 2008 +0000
     1.2 +++ b/selection.h	Tue Nov 04 12:09:10 2008 +0000
     1.3 @@ -4,6 +4,7 @@
     1.4  #include <QString>
     1.5  #include <QList>
     1.6  #include <QGraphicsScene>
     1.7 +#include <QItemSelectionModel>
     1.8  
     1.9  #include "treeitem.h"
    1.10  
    1.11 @@ -24,8 +25,6 @@
    1.12  	void clear();
    1.13  	void setModel (VymModel *);
    1.14  	void update();
    1.15 -	void setColor (QColor c);
    1.16 -	QColor getColor ();
    1.17  	bool select (LinkableMapObj*);
    1.18  	bool select (const QString &);
    1.19  	bool reselect ();
    1.20 @@ -40,17 +39,18 @@
    1.21  	LinkableMapObj * single();		// NULL, if multiple selected
    1.22  	BranchObj* getBranch();
    1.23  	TreeItem* getBranchItem();		
    1.24 +	QModelIndex getBranchIndex();	//!< Returns index of first selected branch or mapcenter
    1.25  	FloatImageObj* getFloatImage();
    1.26  
    1.27  	QString getSelectString();
    1.28  
    1.29  private:
    1.30 -	void init();
    1.31  	QList <LinkableMapObj*> selectList;
    1.32  	QList <LinkableMapObj*> lastSelectList;
    1.33 -	QList <QGraphicsRectItem*> selboxList;
    1.34 +
    1.35  	VymModel *model;
    1.36 -	QGraphicsScene *scene;
    1.37 +
    1.38 +	QItemSelectionModel *selModel;	//!< QSelectionModel is shared across views and initialized in setModel
    1.39  
    1.40  	QColor color;
    1.41  	bool blocked;					//!< if true, no new selection possible