Dynamic element text item :

when text is owned by a folio report, the only information available to the text is :
the label (formula used for the Xref between linked report), the function of the potential and tension/protocol of the potential.
Unlike other elements there is no more information, because a report is not a real element.


git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5039 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2017-09-13 16:38:16 +00:00
parent e8b602915e
commit 2e389fb80f
5 changed files with 539 additions and 50 deletions

View File

@@ -3,6 +3,7 @@
#include "dynamicelementtextitem.h"
#include "element.h"
#include "qetapp.h"
#include "conductor.h"
CompositeTextEditDialog::CompositeTextEditDialog(DynamicElementTextItem *text, QWidget *parent) :
QDialog(parent),
@@ -37,18 +38,34 @@ QString CompositeTextEditDialog::plainText() const {
void CompositeTextEditDialog::setUpComboBox()
{
QStringList qstrl;
Element *elmt = m_text->elementUseForInfo();
if(!elmt)
return;
QStringList info_list = QETApp::elementInfoKeys();
info_list.removeAll("formula"); //No need to have formula
DiagramContext dc = elmt->elementInformations();
for(QString info : info_list)
if(m_text->parentElement()->linkType() & Element::AllReport) //Special treatment for text owned by a folio report
{
if(dc.contains(info))
qstrl << info;
qstrl << "label";
if(!m_text->m_watched_conductor.isNull())
{
Conductor *cond = m_text->m_watched_conductor.data();
if (!cond->properties().m_function.isEmpty())
qstrl << "function";
if(!cond->properties().m_tension_protocol.isEmpty())
qstrl << "tension-protocol";
}
}
else
{
Element *elmt = m_text->elementUseForInfo();
if(!elmt)
return;
QStringList info_list = QETApp::elementInfoKeys();
info_list.removeAll("formula"); //No need to have formula
DiagramContext dc = elmt->elementInformations();
for(QString info : info_list)
{
if(dc.contains(info))
qstrl << info;
}
}
//We use a QMap because the keys of the map are sorted, then no matter the curent local,