summaryrefslogtreecommitdiff
path: root/navit/gui/qt5_qml/qml_poi.cpp
diff options
context:
space:
mode:
authorPierre GRANDIN <pgrandin@users.noreply.github.com>2017-06-04 19:56:30 -0700
committerGitHub <noreply@github.com>2017-06-04 19:56:30 -0700
commit825a26d1a3740a7d160bda468fd0a21dcd3d32b7 (patch)
tree2a16e57dffda5a66af99574d45a9b315066a85d0 /navit/gui/qt5_qml/qml_poi.cpp
parentd4173e24f4d29988516fc08cb3ccbd7d796005d4 (diff)
downloadnavit-825a26d1a3740a7d160bda468fd0a21dcd3d32b7.tar.gz
Qt5 qml gui - POC update (#263)R7602
* Adding qt5/qml2 UI proof of concept * Code cleanup * Minor cleanup * Apply coding style by clang-format -style=WebKit For better diff tracking, I applied coding style once more. * Removed useless QtQuick.Controls dependency * QML2 : Minor work around POIs * QML2 : Use real POIs icons * More minor work around POIs. This commit adds a draft of POI display, and the possibility to set a POI as destination. Also sets the current position to wherever we clicked on the map, to simulate routing using the Demo vehicle * Renamed default skin to 'modern' This will allow us to easily create other skins and make the skin to load configurable * Added town search capability * Resize the QNavitQuick object when exiting the menu * Minor work on the qml2 gui * Implemented street search * Disabled virtual keyboard until it's ready * More modular default country code * Block draw operations when displaying the menu * Removed useless QML ressources
Diffstat (limited to 'navit/gui/qt5_qml/qml_poi.cpp')
-rw-r--r--navit/gui/qt5_qml/qml_poi.cpp42
1 files changed, 31 insertions, 11 deletions
diff --git a/navit/gui/qt5_qml/qml_poi.cpp b/navit/gui/qt5_qml/qml_poi.cpp
index 0036739fc..6a4c16884 100644
--- a/navit/gui/qt5_qml/qml_poi.cpp
+++ b/navit/gui/qt5_qml/qml_poi.cpp
@@ -8,10 +8,12 @@ PoiObject::PoiObject(QObject *parent)
PoiObject::PoiObject(
const QString &name,
- const bool &active,
- const int idist,
+ const QString &type,
+ const int distance,
+ const QString &icon,
+ struct pcoord &coords,
QObject *parent)
- : QObject(parent), m_name(name), m_active(active)
+ : QObject(parent), m_name(name), m_type(type), m_icon(icon), m_coords(coords)
{
}
@@ -28,22 +30,22 @@ void PoiObject::setName(const QString &name)
}
}
-bool PoiObject::active() const
+QString PoiObject::type() const
{
- return m_active;
+ return m_type;
}
-void PoiObject::setActive(const bool &active)
+void PoiObject::setType(const QString &type)
{
- if (active != m_active) {
- m_active = active;
- emit activeChanged();
+ if (type != m_type) {
+ m_type = type;
+ emit typeChanged();
}
}
-int PoiObject::distance() const
+float PoiObject::distance() const
{
- return m_distance;
+ return m_distance/1000;
}
void PoiObject::setDistance(const int distance)
@@ -53,3 +55,21 @@ void PoiObject::setDistance(const int distance)
emit distanceChanged();
}
}
+
+void PoiObject::setIcon(const QString &icon)
+{
+ if (icon != m_icon) {
+ m_icon = icon;
+ emit iconChanged();
+ }
+}
+
+QString PoiObject::icon() const
+{
+ return m_icon;
+}
+
+struct pcoord PoiObject::coords() const
+{
+ return m_coords;
+} \ No newline at end of file