diff --git a/pothos-widgets/ControlWidgets/DropDown.cpp b/pothos-widgets/ControlWidgets/DropDown.cpp index f5d9b0e6..13f26598 100644 --- a/pothos-widgets/ControlWidgets/DropDown.cpp +++ b/pothos-widgets/ControlWidgets/DropDown.cpp @@ -60,10 +60,12 @@ class DropDown : public QWidget, public Pothos::Block this->registerCall(this, POTHOS_FCN_TUPLE(DropDown, widget)); this->registerCall(this, POTHOS_FCN_TUPLE(DropDown, value)); + this->registerCall(this, POTHOS_FCN_TUPLE(DropDown, label)); this->registerCall(this, POTHOS_FCN_TUPLE(DropDown, setTitle)); this->registerCall(this, POTHOS_FCN_TUPLE(DropDown, setValue)); this->registerCall(this, POTHOS_FCN_TUPLE(DropDown, setOptions)); this->registerSignal("valueChanged"); + this->registerSignal("labelChanged"); qRegisterMetaType("Pothos::Object"); qRegisterMetaType("Pothos::ObjectVector"); @@ -99,6 +101,7 @@ class DropDown : public QWidget, public Pothos::Block void activate(void) { //emit current value when design becomes active + this->callVoid("labelChanged", this->label()); this->callVoid("valueChanged", this->value()); } @@ -115,6 +118,11 @@ class DropDown : public QWidget, public Pothos::Block QMetaObject::invokeMethod(this, "__setValue", Qt::QueuedConnection, Q_ARG(Pothos::Object, value)); } + QString label(void) const + { + return _comboBox->currentText(); + } + void setOptions(const Pothos::ObjectVector &options) { //validate first @@ -166,6 +174,7 @@ private slots: void handleIndexChanged(int) { this->callVoid("valueChanged", this->value()); + this->callVoid("labelChanged", this->label()); } private: