add method for get each potentials in a diagram and revamp method for reset all conductors text in a diagram

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@2121 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2013-04-19 14:59:20 +00:00
parent acb7e21a6d
commit 73d78ea623
5 changed files with 45 additions and 11 deletions

View File

@@ -26,6 +26,16 @@ ConductorAutoNumerotation::ConductorAutoNumerotation(Conductor *c) :
strategy_ (0)
{}
/**
* Constructor
* @param d a diagram to apply automatic numerotation
*/
ConductorAutoNumerotation::ConductorAutoNumerotation(Diagram *d) :
conductor_ (0),
diagram_ (d),
strategy_ (0)
{}
/**
*destructor
*/
@@ -120,15 +130,17 @@ void ConductorAutoNumerotation::setNumStrategy() {}
/**
* @brief Set the default text to all conductors of the diagram
* @brief Set the default text to all potentials of the diagram
* @param dg the diagram
*/
void ConductorAutoNumerotation::removeNum_ofDiagram(Diagram *dg) {
// Get all conductors presents in diagram
QList<Conductor *> Conductors = dg -> content().conductors();
// Browse all conductors and set the default value
for (int i=0; i<Conductors.count(); i++) {
Conductors.at(i) -> setText( dg ->defaultConductorProperties.text );
void ConductorAutoNumerotation::removeNum_ofDiagram() {
if (!diagram_) return;
//Get all potentials presents in diagram
QList <QSet <Conductor *> > potential_list = diagram_ -> potentials();
//Browse all potentials and set the default text
for (int i=0; i < potential_list.size(); i++) {
ConductorAutoNumerotation can (potential_list.at(i).toList().first());
can.applyText(diagram_ -> defaultConductorProperties.text);
}
}