Skip to content

Commit

Permalink
move valuelist, nodelist to QList in sweepdialog
Browse files Browse the repository at this point in the history
  • Loading branch information
yodalee committed Nov 7, 2014
1 parent a09e00c commit 0a2f1a7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
19 changes: 9 additions & 10 deletions qucs/qucs/dialogs/sweepdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,9 @@ SweepDialog::~SweepDialog()
{
delete pGraph;

for(double *p = ValueList.first(); p!=0; p = ValueList.next())
delete p;
while(!ValueList.isEmpty()) {
delete ValueList.takeFirst();
}
}

// ---------------------------------------------------------------
Expand All @@ -132,14 +133,12 @@ void SweepDialog::slotNewValue(int)
}
Index *= 2; // because of complex values

double *p = ValueList.first();
for(Node *pn = NodeList.first(); pn!=0; pn = NodeList.next()) {
pn->Name = num2str(*(p+Index));
if(pn->x1 & 0x10)
pn->Name += "A";
else
pn->Name += "V";
p = ValueList.next();
QList<Node *>::iterator node_it;
QList<double *>::const_iterator value_it;
for(node_it = NodeList.begin(); node_it != NodeList.end(); node_it++) {
(*node_it)->Name = num2str(*((*value_it)+Index));
(*node_it)->Name += ((*node_it)->x1 & 0x10)? "A" : "V";
value_it++;
}

Doc->viewport()->update();
Expand Down
5 changes: 2 additions & 3 deletions qucs/qucs/dialogs/sweepdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

#include <QDialog>
#include <QRegExp>
#include <Q3PtrList>
#include <QList>

#include <QSpinBox>
Expand Down Expand Up @@ -66,8 +65,8 @@ private slots:

Graph *pGraph;
Schematic *Doc;
Q3PtrList<Node> NodeList;
Q3PtrList<double> ValueList;
QList<Node *> NodeList;
QList<double *> ValueList;
};

#endif

0 comments on commit 0a2f1a7

Please sign in to comment.