File tree Expand file tree Collapse file tree 2 files changed +43
-0
lines changed
Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Original file line number Diff line number Diff line change @@ -150,3 +150,42 @@ int astigPolargraph::findClosestPoint(const QPointF clickedPoint){
150150 }
151151 return closeNdx;
152152}
153+
154+ void astigPolargraph::on_waveFrontTable_itemClicked (QTableWidgetItem *item)
155+ {
156+ QString name = ui->waveFrontTable ->item (item->row (),0 )->text ();
157+ emit waveSeleted (name);
158+
159+ int lastndx = name.lastIndexOf (' /' );
160+ if (lastndx != -1 )
161+ name = name.mid (lastndx);
162+
163+
164+ int seriesCount = chart->series ().count ();
165+
166+ for (int i = 0 ; i < seriesCount; ++i) {
167+ QAbstractSeries* series = chart->series ().at (i);
168+ if (series) {
169+
170+ if (series->type ()== QAbstractSeries::SeriesTypeLine){
171+ if (series->name () == name){
172+ QLineSeries *line = static_cast <QLineSeries*>(series);
173+ // Create a pen object to get the current pen attributes.
174+ QPen pen = line->pen ();
175+ if (pen.style () == Qt::DotLine){
176+ pen.setStyle (Qt::SolidLine);
177+ pen.setWidth (pen.width ()/4 );
178+ }
179+ else {
180+ pen.setStyle (Qt::DotLine);
181+ pen.setWidth (pen.width () * 4 );
182+ }
183+
184+ line->setPen (pen);
185+ }
186+ }
187+
188+ }
189+ }
190+ }
191+
Original file line number Diff line number Diff line change 99#include < QtCharts/QValueAxis>
1010#include < QtCharts/QPolarChart>
1111#include " wavefront.h"
12+ #include < QTableWidgetItem>
13+
1214QT_CHARTS_USE_NAMESPACE
1315namespace Ui {
1416class astigPolargraph ;
@@ -35,6 +37,8 @@ class astigPolargraph : public QDialog
3537private slots:
3638 void tooltip (QPointF point, bool state);
3739
40+ void on_waveFrontTable_itemClicked (QTableWidgetItem *item);
41+
3842private:
3943 int findClosestPoint (const QPointF clickedPoint );
4044 Ui::astigPolargraph *ui;
You can’t perform that action at this time.
0 commit comments