Resolved Issue #424. Improve Formula Wizard dialog.
--HG-- branch : feature
This commit is contained in:
parent
0ece6cee6c
commit
09a9ec2855
|
@ -946,3 +946,9 @@ void VTranslateVars::Retranslate()
|
|||
InitFunctions();
|
||||
InitPostfixOperators();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QMap<QString, QmuTranslation> VTranslateVars::GetFunctions() const
|
||||
{
|
||||
return functions;
|
||||
}
|
||||
|
|
|
@ -61,6 +61,7 @@ public:
|
|||
QString FormulaToUser(const QString &formula, bool osSeparator) const;
|
||||
|
||||
virtual void Retranslate() Q_DECL_OVERRIDE;
|
||||
QMap<QString, qmu::QmuTranslation> GetFunctions() const;
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(VTranslateVars)
|
||||
|
|
|
@ -217,6 +217,11 @@ void DialogEditWrongFormula::ValChanged(int row)
|
|||
degreeSymbol, tr("Curve angle"));
|
||||
return;
|
||||
}
|
||||
if (ui->radioButtonFunctions->isChecked())
|
||||
{
|
||||
ui->labelDescription->setText(item->toolTip());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
@ -309,6 +314,16 @@ void DialogEditWrongFormula::Increments()
|
|||
ShowVariable(data->DataIncrements());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* @brief Functions show in list functions
|
||||
*/
|
||||
void DialogEditWrongFormula::Functions()
|
||||
{
|
||||
ui->checkBoxHideEmpty->setEnabled(false);
|
||||
ShowFunctions();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogEditWrongFormula::CheckState()
|
||||
{
|
||||
|
@ -384,6 +399,7 @@ void DialogEditWrongFormula::InitVariables()
|
|||
connect(ui->checkBoxHideEmpty, &QCheckBox::stateChanged, this, &DialogEditWrongFormula::Measurements);
|
||||
connect(ui->radioButtonRadiusesArcs, &QRadioButton::clicked, this, &DialogEditWrongFormula::RadiusArcs);
|
||||
connect(ui->radioButtonAnglesCurves, &QRadioButton::clicked, this, &DialogEditWrongFormula::AnglesCurves);
|
||||
connect(ui->radioButtonFunctions, &QRadioButton::clicked, this, &DialogEditWrongFormula::Functions);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
@ -477,3 +493,32 @@ void DialogEditWrongFormula::ShowMeasurements(const QMap<QString, QSharedPointer
|
|||
ui->tableWidget->selectRow(0);
|
||||
ui->tableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* @brief ShowFunctions show functions in list
|
||||
*/
|
||||
void DialogEditWrongFormula::ShowFunctions()
|
||||
{
|
||||
ui->tableWidget->blockSignals(true);
|
||||
ui->tableWidget->clearContents();
|
||||
ui->tableWidget->setRowCount(0);
|
||||
ui->tableWidget->setColumnHidden(ColumnFullName, true);
|
||||
ui->labelDescription->setText("");
|
||||
|
||||
QMap<QString, qmu::QmuTranslation> var = qApp->TrVars()->GetFunctions();
|
||||
QMapIterator<QString, qmu::QmuTranslation> iMap(var);
|
||||
while (iMap.hasNext())
|
||||
{
|
||||
iMap.next();
|
||||
ui->tableWidget->setRowCount(ui->tableWidget->rowCount() + 1);
|
||||
QTableWidgetItem *item = new QTableWidgetItem(iMap.key());
|
||||
item->setFont(QFont("Times", 12, QFont::Bold));
|
||||
ui->tableWidget->setItem(ui->tableWidget->rowCount()-1, ColumnName, item);
|
||||
item->setToolTip(iMap.value().getMdisambiguation());
|
||||
}
|
||||
|
||||
ui->tableWidget->blockSignals(false);
|
||||
ui->tableWidget->selectRow(0);
|
||||
ui->tableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
|
||||
}
|
||||
|
|
|
@ -90,6 +90,7 @@ public slots:
|
|||
void LengthCurves();
|
||||
void AngleLines();
|
||||
void Increments();
|
||||
void Functions();
|
||||
protected:
|
||||
virtual void CheckState() Q_DECL_OVERRIDE;
|
||||
virtual void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE;
|
||||
|
@ -113,6 +114,7 @@ private:
|
|||
template <class key, class val>
|
||||
void ShowVariable(const QMap<key, val> &var);
|
||||
void ShowMeasurements(const QMap<QString, QSharedPointer<VMeasurement> > &var);
|
||||
void ShowFunctions();
|
||||
|
||||
void SetDescription(const QString &name, qreal value, const QString &unit, const QString &description);
|
||||
};
|
||||
|
|
|
@ -329,6 +329,13 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioButtonFunctions">
|
||||
<property name="text">
|
||||
<string>Functions</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
|
|
Loading…
Reference in New Issue
Block a user