diff --git a/qucs/qucs/dialogs/sweepdialog.cpp b/qucs/qucs/dialogs/sweepdialog.cpp index 4dd940e2d4..4a2268f316 100644 --- a/qucs/qucs/dialogs/sweepdialog.cpp +++ b/qucs/qucs/dialogs/sweepdialog.cpp @@ -46,12 +46,16 @@ mySpinBox::mySpinBox(int Min, int Max, int Step, double *Val, QWidget *Parent) using namespace std; QString mySpinBox::textFromValue(int Val) const { + if (Values == NULL) return ""; + cout<<"Values + Val"<<*(Values+Val)<ValueSize)return QValidator::Invalid; if(QString::number(*(Values+pos))==text) return QValidator::Acceptable; @@ -128,15 +132,18 @@ void SweepDialog::slotNewValue(int) DataX *pD = pGraph->cPointsX.first(); int Factor = 1, Index = 0; QList::const_iterator it; - for(it = BoxList.constBegin(); it != BoxList.constEnd(); it++) { + + for (it = BoxList.constBegin(); it != BoxList.constEnd(); it++) { Index += (*it)->value() * Factor; Factor *= pD->count; } + Index *= 2; // because of complex values QList::iterator node_it; - QList::const_iterator value_it; - for(node_it = NodeList.begin(); node_it != NodeList.end(); node_it++) { + QList::const_iterator value_it = ValueList.begin(); + + for (node_it = NodeList.begin(); node_it != NodeList.end(); node_it++) { (*node_it)->Name = misc::num2str(*((*value_it)+Index)); (*node_it)->Name += ((*node_it)->x1 & 0x10)? "A" : "V"; value_it++; diff --git a/qucs/qucs/dialogs/sweepdialog.h b/qucs/qucs/dialogs/sweepdialog.h index d77e74e416..2b2af39888 100644 --- a/qucs/qucs/dialogs/sweepdialog.h +++ b/qucs/qucs/dialogs/sweepdialog.h @@ -42,7 +42,7 @@ class mySpinBox : public QSpinBox { QValidator::State validate ( QString & text, int & pos ) const; private: - double *Values; + double *Values = NULL; int ValueSize; };