From 3e697f500db7f7f47854359909c390cf872ccd93 Mon Sep 17 00:00:00 2001
From: Matthias Puchner <github@mpuchner.de>
Date: Fri, 22 Oct 2021 16:27:08 +0200
Subject: [PATCH] add access to value descriptor in DoubleLineEdit

---
 GUI/Views/CommonWidgets/DoubleLineEdit.cpp | 5 +++++
 GUI/Views/CommonWidgets/DoubleLineEdit.h   | 3 +++
 2 files changed, 8 insertions(+)

diff --git a/GUI/Views/CommonWidgets/DoubleLineEdit.cpp b/GUI/Views/CommonWidgets/DoubleLineEdit.cpp
index 2bff7cdcfde..c4110275e85 100644
--- a/GUI/Views/CommonWidgets/DoubleLineEdit.cpp
+++ b/GUI/Views/CommonWidgets/DoubleLineEdit.cpp
@@ -38,6 +38,11 @@ void DoubleLineEdit::setBaseValue(double baseValue)
     setText(QString::number(baseValue, 'g'));
 }
 
+const DoubleDescriptor& DoubleLineEdit::valueDescriptor() const
+{
+    return m_valueDescriptor;
+}
+
 void DoubleLineEdit::onEditingFinished()
 {
     const double new_value = text().toDouble();
diff --git a/GUI/Views/CommonWidgets/DoubleLineEdit.h b/GUI/Views/CommonWidgets/DoubleLineEdit.h
index 4aff9d7dfce..d865ba8463d 100644
--- a/GUI/Views/CommonWidgets/DoubleLineEdit.h
+++ b/GUI/Views/CommonWidgets/DoubleLineEdit.h
@@ -33,6 +33,9 @@ public:
     //! Set the base value (unit is the one of the contained descriptor).
     void setBaseValue(double baseValue);
 
+    //! The descriptor on which this line edit operates.
+    const DoubleDescriptor& valueDescriptor() const;
+
 signals:
     //! Emitted whenever the value changes.
     //!
-- 
GitLab