FriendLocationItem Class Reference
Class that shows friends location icons on the map.
More...
#include "map/friendlocationitem.h"
List of all members.
Signals |
void | locationItemClicked (const QList< QString > &userIDs) |
| Signal is emitted when l item is clicked.
|
Public Member Functions |
| FriendLocationItem (const QString &userId, QObject *parent=0) |
| Constructor of FriendLocationItem.
|
void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) |
| Paints item pixmap.
|
bool | isPartOfGroup () const |
| Is item part of any group.
|
QUrl | profileImageUrl () const |
| getter for friends profile image URL
|
void | setProfileImage (const QPixmap image, const QUrl &url) |
| Set profile image and it's URL for friend.
|
void | setPartOfGroup (bool value) |
| Set value for m_partOfGroup flag.
|
QString | userId () const |
| getter for m_userId
|
Protected Member Functions |
void | mouseMoveEvent (QGraphicsSceneMouseEvent *event) |
| method that detects when friend icon is moved
|
void | mousePressEvent (QGraphicsSceneMouseEvent *event) |
| method that detects when friend icon is clicked
|
void | mouseReleaseEvent (QGraphicsSceneMouseEvent *event) |
| method that detects when friend icon press is released
|
Private Attributes |
bool | m_partOfGroup |
| Flag to mark if item is part of any group.
|
const QString | m_userId |
| Friends user ID. Can't be changed afterwards.
|
QUrl | m_profileImageUrl |
| Friends Facebook profile image URL.
|
QPointF | m_mousePressPosition |
| Mouse press position.
|
bool | m_clickEvent |
| Flag to mark click event.
|
Detailed Description
Class that shows friends location icons on the map.
- Author:
- Ville Tiensuu.
-
Sami Rämö - sami.ramo@ixonos.com
Constructor & Destructor Documentation
FriendLocationItem::FriendLocationItem |
( |
const QString & |
userId, |
|
|
QObject * |
parent = 0 | |
|
) |
| | |
Constructor of FriendLocationItem.
Sets user ID Sets position to UNDEFINED. Sets default Z-value. Sets item to ignore transformations. this feature is needed to make icon on the map immune to scaling
- Parameters:
-
| userId | Used ID of the friend |
| parent | Parent |
Member Function Documentation
bool FriendLocationItem::isPartOfGroup |
( |
|
) |
const |
Is item part of any group.
- Returns:
- True if item is part of group, otherwise false.
void FriendLocationItem::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 FriendLocationItem::mouseMoveEvent |
( |
QGraphicsSceneMouseEvent * |
event |
) |
[protected] |
method that detects when friend icon is moved
Disables m_clickEvent flag if press and release where not in same area.
- Parameters:
-
| event | detects the mouse move (or touch in Maemo) |
void FriendLocationItem::mousePressEvent |
( |
QGraphicsSceneMouseEvent * |
event |
) |
[protected] |
method that detects when friend icon is clicked
- Parameters:
-
| event | detects the mouse click (or touch in Maemo) |
void FriendLocationItem::mouseReleaseEvent |
( |
QGraphicsSceneMouseEvent * |
event |
) |
[protected] |
method that detects when friend icon press is released
- Parameters:
-
| event | detects the mouse release event (or touch in Maemo) |
void FriendLocationItem::paint |
( |
QPainter * |
painter, |
|
|
const QStyleOptionGraphicsItem * |
option, |
|
|
QWidget * |
widget | |
|
) |
| | |
Paints item pixmap.
Paints normal or highlighted pixmap image.
- Parameters:
-
| painter | QPainter |
| option | QStyleOptionGraphicsItem |
| widget | QWidget |
QUrl FriendLocationItem::profileImageUrl |
( |
|
) |
const |
getter for friends profile image URL
- Returns:
- QUrl friends profile images URL
void FriendLocationItem::setPartOfGroup |
( |
bool |
value |
) |
|
Set value for m_partOfGroup flag.
- Parameters:
-
void FriendLocationItem::setProfileImage |
( |
const QPixmap |
image, |
|
|
const QUrl & |
url | |
|
) |
| | |
Set profile image and it's URL for friend.
Also offset is set matching new image dimensions.
- Parameters:
-
| image | New profile image |
| url | URL of the new profile image |
QString FriendLocationItem::userId |
( |
|
) |
const |
getter for m_userId
- Returns:
- QString friends user identity
The documentation for this class was generated from the following files: