qTbot 0.2.123.6f57966
qTbot is base back end library for your c++ Qt projects.
telegramlocation.cpp
Go to the documentation of this file.
1//#
2//# Copyright (C) 2023-2026 QuasarApp.
3//# Distributed under the GPLv3 software license, see the accompanying
4//# Everyone is permitted to copy and distribute verbatim copies
5//# of this license document, but changing it is not allowed.
6//#
7
8#include "telegramlocation.h"
9#include "qpoint.h"
10
11namespace qTbot {
12
17
18TelegramLocation::TelegramLocation(const QJsonObject &jsonObject):
19 IJsonBasedObject(jsonObject) {
20
21}
22
24 return rawJson()["latitude"].toDouble();
25
26}
27
29 return rawJson()["longitude"].toDouble();
30
31}
32
34 return QPointF(latitude(), longitude());
35}
36}
const QJsonObject & rawJson() const
rawJson Telegram uses a rest api with json objects. So all received messages are parsed into a json o...
IJsonBasedObject()
IJsonBasedObject default constructor.
double latitude() const
latitude This is the float value of the latitude.
TelegramLocation()
TelegramLocation default constructor.
QPointF toQPoint() const
toQPoint This method converts the location data to the general qt class.
double longitude() const
longitude This is the float value of the longitude.