add universe description edit
This commit is contained in:
parent
bfb46eb0df
commit
9b918b858e
|
@ -25,6 +25,19 @@ UniverseView::UniverseView(QWidget *parent, QSacnUniverse *universe)
|
|||
connect(model, &UniverseModel::recievedUpdate,
|
||||
this, &UniverseView::updateStatus);
|
||||
|
||||
// add universe description editor
|
||||
descriptionEdit = new QLineEdit(this);
|
||||
descriptionEdit->setMaxLength(64);
|
||||
descriptionEdit->setText(universe->description());
|
||||
if (universe->isEditable())
|
||||
connect(descriptionEdit, &QLineEdit::textChanged,
|
||||
universe, &QSacnUniverse::setDescription);
|
||||
else
|
||||
descriptionEdit->setEnabled(false);
|
||||
ui->toolBar->addWidget(descriptionEdit);
|
||||
|
||||
ui->toolBar->addSeparator();
|
||||
|
||||
// add data format combobox to toolbar
|
||||
auto formatLabel = new QLabel(this);
|
||||
formatLabel->setText(tr("Data Format") + ": ");
|
||||
|
@ -93,6 +106,9 @@ void UniverseView::updateStatus(QSacnUniverse* universe)
|
|||
QString::number(universe->rxRate()));
|
||||
ui->statusbar->showMessage(message, 2500);
|
||||
|
||||
// component name
|
||||
descriptionEdit->setText(universe->description());
|
||||
|
||||
// priority spinbox
|
||||
prioritySpinBox->setValue(universe->priority());
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
#include "qsacnuniverse.h"
|
||||
#include <QMainWindow>
|
||||
#include <QLineEdit>
|
||||
#include <QSpinBox>
|
||||
|
||||
|
||||
|
@ -26,5 +27,6 @@ public slots:
|
|||
|
||||
private:
|
||||
Ui::UniverseView *ui;
|
||||
QLineEdit *descriptionEdit;
|
||||
QSpinBox *prioritySpinBox;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue