AM_CONDITIONAL(QT_DECLARATIVE_NEWAPI,test "x${gui_qml}" = "xoldapi")
AC_ARG_ENABLE(gui-qml, [ --disable-gui-qml disable gui type QML], gui_qml=$enableval;gui_qml_reason="configure parameter")
if test "x${gui_qml}" = "xyes" -a "x${QT_GUI_CFLAGS}" = "x" -a "x${QT_GUI_LIBS}" = "x"; then
- PKG_CHECK_MODULES(QT_GUI, [QtGui QtCore], ,gui_qml=no;gui_qml_reason="Packages QtGui and/or QtCore missing")
+ PKG_CHECK_MODULES(QT_GUI, [QtGui QtCore QtXml], ,gui_qml=no;gui_qml_reason="Packages QtGui and/or QtCore missing")
fi
if test "x${gui_qml}" = "xyes" -a "x${QT_DECLARATIVE_CFLAGS}" = "x" -a "x${QT_DECLARATIVE_LIBS}" = "x"; then
PKG_CHECK_MODULES(QT_DECLARATIVE, [QtDeclarative >= 4.6.0 ], ,gui_qml=no;gui_qml_reason="Packages QtDeclarative missing")
#ifndef NAVIT_GUI_QML_POINT_H
#define NAVIT_GUI_QML_POINT_H
-enum NGQPointTypes {MapPoint,Bookmark};
+enum NGQPointTypes {MapPoint,Bookmark,Position,Destination};
class NGQPoint : public QObject {
Q_OBJECT;
return QString("MapPoint");
case Bookmark:
return QString("Bookmark");
+ case Position:
+ return QString("Position");
+ case Destination:
+ return QString("Destination");
}
return QString("");
}
struct map *m;
int idist,dist;
struct coord center;
- QString retXml;
+ QDomDocument retDoc(attr_name);
+ QDomElement entries;
if (!gui_get_attr(this->object->gui,attr_radius,&attr,NULL)) {
return QString();
center.y=this->c.y;
h=mapset_open(navit_get_mapset(this->object->nav));
- retXml=QString("<%1>").arg(attr_name);
+ entries=retDoc.createElement(attr_name);
+ retDoc.appendChild(entries);
while ((m=mapset_next(h, 1))) {
selm=map_selection_dup_pro(sel, this->c.pro, map_projection(m));
if (mr) {
while ((item=map_rect_get_item(mr))) {
struct coord c;
- if ( item_coord_get_pro(item, &c, 1, this->c.pro) && coord_rect_contains(&sel->u.c_rect, &c) && (idist=transform_distance(this->c.pro, ¢er, &c)) < dist ) {
+ if ( item_coord_get_pro(item, &c, 1, this->c.pro) && coord_rect_contains(&sel->u.c_rect, &c) && (idist=transform_distance(this->c.pro, ¢er, &c)) < dist && item->type<type_line) {
char* label;
QString rs;
if (item_attr_get(item, attr_label, &attr)) {
} else
rs=item_to_name(item->type);
if (rs.length()>0) {
- QString pointXml="<point>";
- pointXml+="<name>"+rs+"</name>";
- pointXml+="<type>"+QString(item_to_name(item->type))+"</type>";
- pointXml+="</point>";
-
- retXml+=pointXml;
+ QDomElement entry=retDoc.createElement("point");
+ QDomElement nameTag=retDoc.createElement("name");
+ QDomElement typeTag=retDoc.createElement("type");
+ QDomText nameT=retDoc.createTextNode(rs);
+ QDomText typeT=retDoc.createTextNode(QString(item_to_name(item->type)));
+ nameTag.appendChild(nameT);
+ typeTag.appendChild(typeT);
+ entry.appendChild(nameTag);
+ entry.appendChild(typeTag);
+ entries.appendChild(entry);
}
}
}
map_selection_destroy(sel);
mapset_close(h);
- retXml+=QString("</%1>").arg(attr_name);
- dbg(0,"Reulsting xml: %s\n",retXml.toLocal8Bit().constData());
- return retXml;
+ return retDoc.toString();
}
protected:
QString _coordString() {