Added new classes, ExtendedListItem, -Delegate and -Store.
[situare] / src / ui / locationlistitem.cpp
1 #include <QDebug>
2
3 #include "../common.h"
4 #include "listcommon.h"
5
6 #include "locationlistitem.h"
7
8 const int LOCATION_SUBITEM_TEXT_MAX_WIDTH = SUBITEM_TEXT_MAX_WIDTH + MARGIN + IMAGE_WIDTH;
9
10 LocationListItem::LocationListItem()
11 {
12     qDebug() << __PRETTY_FUNCTION__;
13
14     setSubitemTextWidth(LOCATION_SUBITEM_TEXT_MAX_WIDTH);
15     addSubItem(QString("Hei pitka teksti hep hep hep hep hep hep hep hep hep hep hep hep"),
16                QPixmap(":/res/images/clock.png"));
17     addSubItem(QString("Hep"));
18     addSubItem(QString("Jep"), QPixmap(":/res/images/compass.png"));
19 }
20
21 GeoCoordinate LocationListItem::coordinates()
22 {
23     qDebug() << __PRETTY_FUNCTION__;
24
25     return m_location.coordinates();
26 }
27
28 QString LocationListItem::id() const
29 {
30     qDebug() << __PRETTY_FUNCTION__;
31
32     return QString();
33 }
34
35 void LocationListItem::setLocationData(const Location &location)
36 {
37     m_location = location;
38
39     setName(shortenText("blaah bavlsdfasdfhldsaf dsafldsaf ldsa lfadsl fl sadf",
40                         ITEM_WIDTH - 3*MARGIN, ListItem::TEXT_SIZE_NORMAL));
41 }