Commit 61533ad9 authored by Samikshan Bairagya's avatar Samikshan Bairagya

Show position of skyobjects on the details view of the QML user interface.

parent a8127f0a
......@@ -158,11 +158,28 @@ Rectangle {
objectName: "sonameObj"
x: 17
y: 24
width: 268
height: 230
width: 117
height: 51
color: "#ffffff"
text: qsTr("text")
font.bold: true
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
font.pixelSize: 16
}
Text {
id: posText
objectName: "posTextObj"
x: 17
y: 111
width: 273
height: 31
color: "#ffffff"
text: qsTr("text")
font.underline: true
font.italic: true
font.bold: true
font.pixelSize: 12
}
}
......
......@@ -128,6 +128,8 @@ void WIView::onSoListItemClicked(QString type, int index)
void WIView::loadDetailsView(SkyObjItem* soitem)
{
QObject* sonameObj = detailsViewObj->findChild<QObject *>("sonameObj");
QObject* posTextObj = detailsViewObj->findChild<QObject *>("posTextObj");
sonameObj->setProperty("text", soitem->getName());
posTextObj->setProperty("text", soitem->getPosition());
detailsViewObj->setProperty("visible", true);
}
......@@ -67,3 +67,8 @@ void SkyObjItem::setPosition(SkyObject* so)
position = QString::number(rounded_altitude).append(" degrees above the ").append(cardinals[rounded_azimuth]).append(" horizon ");
kDebug()<<position;
}
QString SkyObjItem::getPosition()
{
return position;
}
......@@ -40,6 +40,7 @@ public:
inline QString getName() { return name; }
inline QString getType() { return type; }
void setPosition(SkyObject* so);
QString getPosition();
private:
QString name;
QString type;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment