When you get a list of items, u can check to which class it belongs using dynamic cast,,, or u can use a extra variable in the class.
For the graphics item inherit the class something like -
{
Q_OBJECT; // in case you need signal slots...
enum itemType {type1 = UserType+1,type2,...};
itemType m_type;
int type() const /// this is a virtual function of QGraphicsItem ,,, refer documention.
{
return m_type;
}
};
class MyGraphicsItem: public QGraphicsItem
{
Q_OBJECT; // in case you need signal slots...
enum itemType {type1 = UserType+1,type2,...};
itemType m_type;
int type() const /// this is a virtual function of QGraphicsItem ,,, refer documention.
{
return m_type;
}
};
To copy to clipboard, switch view to plain text mode
hope this helps
Bookmarks