additional "apply" button in calkit dialog
This commit is contained in:
parent
2c8df0eb83
commit
069f68a5d0
@ -193,12 +193,12 @@ Calkit Calkit::fromFile(QString filename)
|
|||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Calkit::edit(std::function<void (void)> done)
|
void Calkit::edit(std::function<void (void)> updateCal)
|
||||||
{
|
{
|
||||||
auto dialog = new CalkitDialog(*this);
|
auto dialog = new CalkitDialog(*this);
|
||||||
if(done) {
|
if(updateCal) {
|
||||||
QObject::connect(dialog, &QDialog::accepted, [=](){
|
QObject::connect(dialog, &CalkitDialog::settingsChanged, [=](){
|
||||||
done();
|
updateCal();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
dialog->show();
|
dialog->show();
|
||||||
|
@ -40,7 +40,7 @@ public:
|
|||||||
|
|
||||||
void toFile(QString filename);
|
void toFile(QString filename);
|
||||||
static Calkit fromFile(QString filename);
|
static Calkit fromFile(QString filename);
|
||||||
void edit(std::function<void(void)> done = nullptr);
|
void edit(std::function<void(void)> updateCal = nullptr);
|
||||||
bool hasSeparateMaleFemaleStandards();
|
bool hasSeparateMaleFemaleStandards();
|
||||||
SOLT toSOLT(double frequency, bool male_standards = true);
|
SOLT toSOLT(double frequency, bool male_standards = true);
|
||||||
TRL toTRL(double frequency);
|
TRL toTRL(double frequency);
|
||||||
|
@ -172,9 +172,15 @@ CalkitDialog::CalkitDialog(Calkit &c, QWidget *parent) :
|
|||||||
UpdateStatus();
|
UpdateStatus();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
connect(ui->buttonBox->button(QDialogButtonBox::Apply), &QPushButton::clicked, [this]() {
|
||||||
|
parseEntries();
|
||||||
|
editKit = ownKit;
|
||||||
|
emit settingsChanged();
|
||||||
|
});
|
||||||
connect(ui->buttonBox->button(QDialogButtonBox::Ok), &QPushButton::clicked, [this]() {
|
connect(ui->buttonBox->button(QDialogButtonBox::Ok), &QPushButton::clicked, [this]() {
|
||||||
parseEntries();
|
parseEntries();
|
||||||
editKit = ownKit;
|
editKit = ownKit;
|
||||||
|
emit settingsChanged();
|
||||||
accept();
|
accept();
|
||||||
});
|
});
|
||||||
connect(ui->buttonBox->button(QDialogButtonBox::Cancel), &QPushButton::clicked, [this]() {
|
connect(ui->buttonBox->button(QDialogButtonBox::Cancel), &QPushButton::clicked, [this]() {
|
||||||
|
@ -20,6 +20,8 @@ public:
|
|||||||
explicit CalkitDialog(Calkit &c, QWidget *parent = nullptr);
|
explicit CalkitDialog(Calkit &c, QWidget *parent = nullptr);
|
||||||
~CalkitDialog();
|
~CalkitDialog();
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void settingsChanged();
|
||||||
private:
|
private:
|
||||||
void parseEntries();
|
void parseEntries();
|
||||||
void updateEntries();
|
void updateEntries();
|
||||||
|
@ -1310,7 +1310,7 @@
|
|||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="standardButtons">
|
<property name="standardButtons">
|
||||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::Open|QDialogButtonBox::Save</set>
|
<set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::Open|QDialogButtonBox::Save</set>
|
||||||
</property>
|
</property>
|
||||||
<property name="centerButtons">
|
<property name="centerButtons">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
@ -1456,13 +1456,13 @@
|
|||||||
</connection>
|
</connection>
|
||||||
</connections>
|
</connections>
|
||||||
<buttongroups>
|
<buttongroups>
|
||||||
<buttongroup name="OpenType"/>
|
<buttongroup name="ThroughType"/>
|
||||||
<buttongroup name="LoadType"/>
|
<buttongroup name="LoadType"/>
|
||||||
<buttongroup name="ShortType_f"/>
|
|
||||||
<buttongroup name="TRL_Rtype"/>
|
|
||||||
<buttongroup name="LoadType_f"/>
|
<buttongroup name="LoadType_f"/>
|
||||||
<buttongroup name="OpenType_f"/>
|
<buttongroup name="OpenType_f"/>
|
||||||
<buttongroup name="ShortType"/>
|
<buttongroup name="ShortType"/>
|
||||||
<buttongroup name="ThroughType"/>
|
<buttongroup name="OpenType"/>
|
||||||
|
<buttongroup name="TRL_Rtype"/>
|
||||||
|
<buttongroup name="ShortType_f"/>
|
||||||
</buttongroups>
|
</buttongroups>
|
||||||
</ui>
|
</ui>
|
||||||
|
@ -73,6 +73,8 @@ QVariant MeasurementModel::data(const QModelIndex &index, int role) const
|
|||||||
case ColIndex::Date:
|
case ColIndex::Date:
|
||||||
return info.timestamp.toString("dd.MM.yyyy hh:mm:ss");
|
return info.timestamp.toString("dd.MM.yyyy hh:mm:ss");
|
||||||
break;
|
break;
|
||||||
|
case ColIndex::Last:
|
||||||
|
return "";
|
||||||
}
|
}
|
||||||
} else if(role == Qt::SizeHintRole) {
|
} else if(role == Qt::SizeHintRole) {
|
||||||
switch((ColIndex) index.column()) {
|
switch((ColIndex) index.column()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user