mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +01:00
@@ -105,6 +105,14 @@ QHash<QString, QString> QETInformation::folioReportInfoKeyToVar()
|
||||
return H_;
|
||||
}
|
||||
|
||||
QString QETInformation::folioReportInfoToVar(const QString &info)
|
||||
{
|
||||
if (QETInformation::folioReportInfoKeys().contains(info))
|
||||
return infoToVar(info);
|
||||
else
|
||||
return (QString ("%{void}"));
|
||||
}
|
||||
|
||||
QStringList QETInformation::conductorInfoKeys()
|
||||
{
|
||||
QStringList list = { COND_FORMULA,
|
||||
|
||||
@@ -99,6 +99,7 @@ namespace QETInformation
|
||||
|
||||
QStringList folioReportInfoKeys();
|
||||
QHash <QString, QString> folioReportInfoKeyToVar();
|
||||
QString folioReportInfoToVar(const QString &info);
|
||||
|
||||
QStringList conductorInfoKeys();
|
||||
QStringList diagramInfoKeys();
|
||||
|
||||
@@ -53,10 +53,14 @@ QString CompositeTextEditDialog::plainText() const
|
||||
void CompositeTextEditDialog::setUpComboBox()
|
||||
{
|
||||
QStringList qstrl;
|
||||
bool is_report = false;
|
||||
if (m_text && m_text->parentElement()->linkType() & Element::AllReport) {
|
||||
is_report = true;
|
||||
}
|
||||
|
||||
if(m_text && (m_text->parentElement()->linkType() & Element::AllReport)) //Special treatment for text owned by a folio report
|
||||
if(is_report) //Special treatment for text owned by a folio report
|
||||
{
|
||||
qstrl << "label" << "function" << "tension_protocol" << "conductor_color" << "conductor_section";
|
||||
qstrl = QETInformation::folioReportInfoKeys();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -68,7 +72,8 @@ void CompositeTextEditDialog::setUpComboBox()
|
||||
//the value of the combo box are always alphabetically sorted
|
||||
QMap <QString, QString> info_map;
|
||||
for(const QString& str : qstrl) {
|
||||
info_map.insert(QETInformation::translatedInfoKey(str), QETInformation::elementInfoToVar(str));
|
||||
info_map.insert(QETInformation::translatedInfoKey(str),
|
||||
is_report ? QETInformation::folioReportInfoToVar(str) : QETInformation::elementInfoToVar(str));
|
||||
}
|
||||
for(const QString& key : info_map.keys()) {
|
||||
ui->m_info_cb->addItem(key, info_map.value(key));
|
||||
|
||||
Reference in New Issue
Block a user