FriendGroupItem Class Reference

Friend group map item. More...

#include <friendgroupitem.h>

Inheritance diagram for FriendGroupItem:
Inheritance graph
[legend]
Collaboration diagram for FriendGroupItem:
Collaboration graph
[legend]

List of all members.

Signals

void locationItemClicked (const QList< QString > &userIDs)
 Signal is emitted when l item is clicked.

Public Member Functions

 FriendGroupItem (FriendLocationItem *item)
 Constructor.
void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
 Paint event.
bool dropFriends (int zoomLevel)
 Drop all FriendLocationItem items which bounding rect is not colliding with this group anymore.
void dropFriend (FriendLocationItem *item)
 Drop single FriendLocationItem from this group.
void joinFriend (FriendLocationItem *item)
 Join new FriendLocationItem to this group.
void mergeWithGroup (FriendGroupItem *group)
 Merge this group to another FriendGroupItem.

Protected Member Functions

void mouseMoveEvent (QGraphicsSceneMouseEvent *event)
 Mouse move event.
void mousePressEvent (QGraphicsSceneMouseEvent *event)
 Mouse press event.
void mouseReleaseEvent (QGraphicsSceneMouseEvent *event)
 Mouse release event.

Private Attributes

QList< FriendLocationItem * > m_friends
 List of joined FriendLocationItem items.
QPoint m_mousePressPosition
 Mouse press position.
bool m_clickEvent
 Mouse click event flag.

Detailed Description

Friend group map item.

Contains grouped FriendLocationItem items and draws group image with number of grouped friends

Author:
Sami Rämö - sami.ramo@ixonos.com

Constructor & Destructor Documentation

FriendGroupItem::FriendGroupItem ( FriendLocationItem item  ) 

Constructor.

Create new group, set picture and join first FriendLocationItem to the group. Group position is set to be exactly same as item given as parameter.

Parameters:
item First FriendLocationItem to be joined to new group

Member Function Documentation

void FriendGroupItem::dropFriend ( FriendLocationItem item  ) 

Drop single FriendLocationItem from this group.

Parameters:
item FriendLocationItem to be dropped
bool FriendGroupItem::dropFriends ( int  zoomLevel  ) 

Drop all FriendLocationItem items which bounding rect is not colliding with this group anymore.

Dropped items are set to visible again.

void FriendGroupItem::joinFriend ( FriendLocationItem item  ) 

Join new FriendLocationItem to this group.

Given item is also hidden.

Parameters:
item FriendLocationItem to be joined
void FriendGroupItem::locationItemClicked ( const QList< QString > &  userIDs  )  [signal]

Signal is emitted when l item is clicked.

Parameters:
userIDs list of friends user IDs in the group
void FriendGroupItem::mergeWithGroup ( FriendGroupItem group  ) 

Merge this group to another FriendGroupItem.

Removes all FrienLocationItem items from this group and joins then to given group. Group item is not deleted, so caller must delete group after merging.

Parameters:
group FriendGroupItem which takes all this group FriendLocationItem items
void FriendGroupItem::mouseMoveEvent ( QGraphicsSceneMouseEvent *  event  )  [protected]

Mouse move event.

Disables m_clickEvent flag if press and release where not in same area.

Parameters:
event QGraphicsSceneMouseEvent.
void FriendGroupItem::mousePressEvent ( QGraphicsSceneMouseEvent *  event  )  [protected]

Mouse press event.

Sets mouse press position.

Parameters:
event QGraphicsSceneMouseEvent.
void FriendGroupItem::mouseReleaseEvent ( QGraphicsSceneMouseEvent *  event  )  [protected]

Mouse release event.

Emits friendGroupItemClicked signal if press and release where in same area.

Parameters:
event QGraphicsSceneMouseEvent.
void FriendGroupItem::paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget 
)

Paint event.

Draw amount of joined FriendLocationItem items over the image.


The documentation for this class was generated from the following files:

Generated on Thu Jun 10 09:44:02 2010 for Situare client for Maemo by  doxygen 1.6.1