100 break; |
100 break; |
101 case Qt::DisplayRole: |
101 case Qt::DisplayRole: |
102 { |
102 { |
103 QStringList displayText; |
103 QStringList displayText; |
104 QStringList adressDetail = mProxyModel->data(proxyModelIndex,Qt::DisplayRole).toStringList(); |
104 QStringList adressDetail = mProxyModel->data(proxyModelIndex,Qt::DisplayRole).toStringList(); |
105 QString displayString = adressDetail[0]+KSeparator+KSpace+adressDetail[1]; |
105 QString displayString; |
|
106 if(!adressDetail[0].isEmpty()) |
|
107 { |
|
108 displayString = adressDetail[0]+KSeparator+KSpace+adressDetail[1]; |
|
109 } |
|
110 else |
|
111 { |
|
112 displayString = adressDetail[1]; |
|
113 } |
106 QString text(""); |
114 QString text(""); |
107 displayText <<displayString<<text; |
115 displayText <<displayString<<text; |
108 returnValue = displayText; |
116 returnValue = displayText; |
109 break; |
117 break; |
110 } |
118 } |
125 QBrush brush(Qt::black,Qt::SolidPattern); |
133 QBrush brush(Qt::black,Qt::SolidPattern); |
126 QPainter painter; |
134 QPainter painter; |
127 painter.begin(&mapPixmap); |
135 painter.begin(&mapPixmap); |
128 HbIcon adressTypeIcon(adressType); |
136 HbIcon adressTypeIcon(adressType); |
129 //draw the adressType Icon over mapTile Icon |
137 //draw the adressType Icon over mapTile Icon |
130 QPixmap adressTypePixmap = adressTypeIcon.pixmap(); |
138 adressTypeIcon.paint(&painter,QRectF((mapPixmap.width()-adressTypeIcon.width()),0,adressTypeIcon.width(),adressTypeIcon.height())); |
131 painter.drawPixmap( (mapPixmap.width()-adressTypePixmap.width()),0,adressTypePixmap ); |
|
132 painter.fillRect(QRect(0,0,mapWidth,MAPSTROKE),brush); |
139 painter.fillRect(QRect(0,0,mapWidth,MAPSTROKE),brush); |
133 painter.fillRect(QRect(0,mapHeight-MAPSTROKE,mapWidth,(mapHeight-MAPSTROKE)),brush); |
140 painter.fillRect(QRect(0,mapHeight-MAPSTROKE,mapWidth,(mapHeight-MAPSTROKE)),brush); |
134 painter.fillRect(QRect(0,0,MAPSTROKE,mapPixmap.height()),brush); |
141 painter.fillRect(QRect(0,0,MAPSTROKE,mapPixmap.height()),brush); |
135 painter.fillRect(QRect((mapWidth-MAPSTROKE),0,mapWidth,mapHeight),brush); |
142 painter.fillRect(QRect((mapWidth-MAPSTROKE),0,mapWidth,mapHeight),brush); |
136 painter.end(); |
143 painter.end(); |