Engauge Digitizer  2
DlgSettingsCurveAddRemove.cpp
1 /******************************************************************************************************
2  * (C) 2014 markummitchell@github.com. This file is part of Engauge Digitizer, which is released *
3  * under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *
4  * LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. *
5  ******************************************************************************************************/
6 
7 #include "CmdMediator.h"
8 #include "CmdSettingsCurveAddRemove.h"
9 #include "CurveNameList.h"
10 #include "DlgSettingsCurveAddRemove.h"
11 #include "EngaugeAssert.h"
12 #include "Logger.h"
13 #include "MainWindow.h"
14 #include <QCheckBox>
15 #include <QDebug>
16 #include <QGridLayout>
17 #include <QLabel>
18 #include <QListView>
19 #include <QMessageBox>
20 #include <QPushButton>
21 #include <QSettings>
22 #include <QSpacerItem>
23 #include <QTableView>
24 #include "QtToString.h"
25 #include "Settings.h"
26 #include "SettingsForGraph.h"
27 
28 const int FIRST_COLUMN = 0;
29 const int MINIMUM_HEIGHT = 500;
30 
32  DlgSettingsAbstractBase (tr ("Curve Add/Remove"),
33  "DlgSettingsCurveAddRemove",
34  mainWindow)
35 {
36  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsCurveAddRemove::DlgSettingsCurveAddRemove";
37 
38  QWidget *subPanel = createSubPanel ();
39  finishPanel (subPanel);
40 }
41 
42 DlgSettingsCurveAddRemove::~DlgSettingsCurveAddRemove()
43 {
44  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsCurveAddRemove::~DlgSettingsCurveAddRemove";
45 }
46 
47 void DlgSettingsCurveAddRemove::appendCurveName (const QString &curveNameNew,
48  const QString &curveNameOriginal,
49  int numPoints)
50 {
51  ENGAUGE_CHECK_PTR (m_curveNameList);
52 
53  int row = m_curveNameList->rowCount ();
54  insertCurveName (row,
55  curveNameNew,
56  curveNameOriginal,
57  numPoints);
58 }
59 
60 void DlgSettingsCurveAddRemove::createButtons (QGridLayout *layout,
61  int &row)
62 {
63  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsCurveAddRemove::createButtons";
64 
65  m_btnAdd = new QPushButton (tr ("Add..."));
66  m_btnAdd->setWhatsThis (tr ("Adds a new curve to the curve list. The curve name can be edited in the curve name list.\n\n"
67  "Every curve name must be unique"));
68  m_btnAdd->setSizePolicy (QSizePolicy::Fixed, QSizePolicy::Fixed);
69  connect (m_btnAdd, SIGNAL (released ()), this, SLOT (slotNew()));
70  layout->addWidget (m_btnAdd, row, 1, 1, 1, Qt::AlignLeft);
71 
72  m_btnRemove = new QPushButton (tr ("Remove"));
73  m_btnRemove->setWhatsThis (tr ("Removes the currently selected curve from the curve list.\n\n"
74  "There must always be at least one curve"));
75  m_btnRemove->setSizePolicy (QSizePolicy::Fixed, QSizePolicy::Fixed);
76  connect (m_btnRemove, SIGNAL (released ()), this, SLOT (slotRemove()));
77  layout->addWidget (m_btnRemove, row++, 2, 1, 1, Qt::AlignRight);
78 }
79 
80 void DlgSettingsCurveAddRemove::createListCurves (QGridLayout *layout,
81  int &row)
82 {
83  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsCurveAddRemove::createListCurves";
84 
85  QLabel *label = new QLabel (tr ("Curve Names:"));
86  layout->addWidget (label, row++, 1);
87 
88  m_curveNameList = new CurveNameList;
89 
90  // There is no Qt::ItemIsEditable flag for QListView, so instead we set that flag for the QListViewItems
91 #ifdef DLG_SETTINGS_DEBUG
92  m_listCurves = new QTableView;
93 #else
94  m_listCurves = new QListView;
95 #endif
96 
97  m_listCurves->setWhatsThis (tr ("List of the curves belonging to this document.\n\n"
98  "Click on a curve name to edit it. Each curve name must be unique.\n\n"
99  "Reorder curves by dragging them around."));
100  m_listCurves->setMinimumHeight (200);
101  m_listCurves->setSelectionMode (QAbstractItemView::SingleSelection);
102  m_listCurves->setDefaultDropAction (Qt::MoveAction);
103  m_listCurves->setDragDropOverwriteMode (false);
104  m_listCurves->setDragEnabled (true);
105  m_listCurves->setDropIndicatorShown (true);
106  m_listCurves->setDragDropMode (QAbstractItemView::InternalMove);
107 #ifndef DLG_SETTINGS_DEBUG
108  m_listCurves->setViewMode (QListView::ListMode);
109  m_listCurves->setMovement (QListView::Snap);
110 #endif
111  m_listCurves->setModel (m_curveNameList);
112  layout->addWidget (m_listCurves, row++, 1, 1, 2);
113  connect (m_curveNameList, SIGNAL (dataChanged (const QModelIndex &, const QModelIndex &, const QVector<int> &)),
114  this, SLOT (slotDataChanged (const QModelIndex &, const QModelIndex &, const QVector<int> &)));
115  connect (m_listCurves->selectionModel (), SIGNAL (selectionChanged (QItemSelection, QItemSelection)),
116  this, SLOT (slotSelectionChanged (QItemSelection, QItemSelection)));
117 }
118 
120 {
121  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsCurveAddRemove::createOptionalSaveDefault";
122 
123  m_btnSaveDefault = new QPushButton (tr ("Save As Default"));
124  m_btnSaveDefault->setWhatsThis (tr ("Save the curve names for use as defaults for future graph curves."));
125  connect (m_btnSaveDefault, SIGNAL (released ()), this, SLOT (slotSaveDefault ()));
126  layout->addWidget (m_btnSaveDefault, 0, Qt::AlignLeft);
127 
128  m_btnResetDefault = new QPushButton (tr ("Reset Default"));
129  m_btnResetDefault->setWhatsThis (tr ("Reset the defaults for future graph curves to the original settings."));
130  connect (m_btnResetDefault, SIGNAL (released ()), this, SLOT (slotResetDefault()));
131  layout->addWidget (m_btnResetDefault, 0, Qt::AlignRight);
132 
133  QSpacerItem *spacer = new QSpacerItem (40, 2);
134  layout->addItem (spacer);
135 }
136 
138 {
139  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsCurveAddRemove::createSubPanel";
140 
141  const int EMPTY_COLUMN_WIDTH = 30;
142 
143  QWidget *subPanel = new QWidget ();
144  QGridLayout *layout = new QGridLayout (subPanel);
145  subPanel->setLayout (layout);
146 
147  int row = 1;
148  createListCurves (layout, row);
149  createButtons (layout, row);
150 
151  layout->setColumnStretch (0, 0); // Empty first column
152  layout->setColumnMinimumWidth (0, EMPTY_COLUMN_WIDTH);
153  layout->setColumnStretch (1, 1); // New
154  layout->setColumnStretch (2, 1); // Remove
155  layout->setColumnStretch (3, 0); // Empty last column
156  layout->setColumnMinimumWidth (3, EMPTY_COLUMN_WIDTH);
157 
158  return subPanel;
159 }
160 
161 bool DlgSettingsCurveAddRemove::endsWithNumber (const QString &str) const
162 {
163  bool success = false;
164 
165  if (!str.isEmpty ()) {
166 
167  success = (str.right (1).at (0).digitValue() >= 0);
168  }
169 
170  return success;
171 }
172 
174 {
175  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsCurveAddRemove::handleOk";
176 
178  cmdMediator ().document(),
179  *m_curveNameList);
180  cmdMediator ().push (cmd);
181 
182  hide ();
183 }
184 
185 void DlgSettingsCurveAddRemove::insertCurveName (int row,
186  const QString &curveNameNew,
187  const QString &curveNameOriginal,
188  int numPoints)
189 {
190  if (m_curveNameList->insertRow (row)) {
191 
192  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsCurveAddRemove::insertCurveName curveName=" << curveNameNew.toLatin1 ().data ();
193 
194  CurveNameListEntry curvesEntry (curveNameNew,
195  curveNameOriginal,
196  numPoints);
197 
198  m_curveNameList->setData (m_curveNameList->index (row, 0),
199  curvesEntry.curveNameCurrent ());
200  m_curveNameList->setData (m_curveNameList->index (row, 1),
201  curvesEntry.curveNameOriginal ());
202  m_curveNameList->setData (m_curveNameList->index (row, 2),
203  numPoints);
204 
205  } else {
206 
207  LOG4CPP_ERROR_S ((*mainCat)) << "DlgSettingsCurveAddRemove::insertCurveName failed curveName="
208  << curveNameNew.toLatin1 ().data ();
209 
210  }
211 }
212 
214 {
215  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsCurveAddRemove::load";
216 
217  setCmdMediator (cmdMediator);
218 
219  // Remove any data from previous showing of dialog
220  while (m_curveNameList->rowCount () > 0) {
221  m_curveNameList->removeRow (0);
222  }
223 
224  QStringList curveNames = cmdMediator.curvesGraphsNames ();
225  QStringList::const_iterator itr;
226  for (itr = curveNames.begin (); itr != curveNames.end (); itr++) {
227  QString curveName = *itr;
228  appendCurveName (curveName,
229  curveName,
230  cmdMediator.curvesGraphsNumPoints (curveName));
231  }
232 
233  selectCurveName (curveNames.first());
234 
235  enableOk (false); // Disable Ok button since there not yet any changes
236 }
237 
238 int DlgSettingsCurveAddRemove::newIndexFromSelection () const
239 {
240  int numSelectedItems = m_listCurves->selectionModel ()->selectedIndexes ().count ();
241  int numItems = m_listCurves->model ()->rowCount ();
242 
243  // Determine index where new entry will be inserted
244  int newIndex = -1;
245  if ((numSelectedItems == 0) &&
246  (numItems > 0)) {
247 
248  // Append after list which has at least one entry
249  newIndex = numItems;
250 
251  } else if (numSelectedItems == 1) {
252 
253  // Insert after the selected index
254  newIndex = 1 + m_listCurves->selectionModel ()->selectedIndexes ().at (0).row ();
255 
256  }
257 
258  return newIndex;
259 }
260 
261 QString DlgSettingsCurveAddRemove::nextCurveName () const
262 {
263  const QString DASH_ONE ("-1"); // Nice value to start a new range at a lower level than the current level
264 
265  ENGAUGE_CHECK_PTR (m_listCurves);
266 
267  int newIndex = newIndexFromSelection ();
268  int numItems = m_listCurves->model ()->rowCount ();
269 
270  // Curves names of existing before/after curves
271  QString curveNameBefore, curveNameAfter;
272  if (newIndex > 0) {
273 
274  QModelIndex index = m_curveNameList->index (newIndex - 1, 0);
275  curveNameBefore = m_curveNameList->data (index).toString ();
276 
277  }
278 
279  if ((0 <= newIndex) && (newIndex < numItems)) {
280 
281  QModelIndex index = m_curveNameList->index (newIndex, 0);
282  curveNameAfter = m_curveNameList->data (index).toString ();
283 
284  }
285 
286  // New curve name computed from previous curve name
287  QString curveNameNext;
288  if (curveNameBefore.isEmpty () && !curveNameAfter.isEmpty () && endsWithNumber (curveNameAfter)) {
289 
290  // Pick a name before curveNameAfter
291  int numberAfter = numberAtEnd (curveNameAfter);
292  int numberNew = numberAfter - 1;
293  int pos = curveNameAfter.lastIndexOf (QString::number (numberAfter));
294  if (pos >= 0) {
295 
296  curveNameNext = QString ("%1%2")
297  .arg (curveNameAfter.left (pos))
298  .arg (numberNew);
299 
300  } else {
301 
302  curveNameNext = curveNameAfter; // Better than nothing
303 
304  }
305 
306  } else if (curveNameBefore.isEmpty ()) {
307 
308  curveNameNext = DEFAULT_GRAPH_CURVE_NAME; // If necessary, this will be deconflicted below
309 
310  } else {
311 
312  curveNameNext = curveNameBefore; // This will be deconflicted below
313 
314  if (endsWithNumber (curveNameBefore)) {
315 
316  // Curve name ends with a number. Pick a name after curveNameBefore, being sure to not match curveNameAfter
317  int numberBefore = numberAtEnd (curveNameBefore);
318  int numberNew = numberBefore + 1;
319  int pos = curveNameBefore.lastIndexOf (QString::number (numberBefore));
320  if (pos >= 0) {
321 
322  curveNameNext = QString ("%1%2")
323  .arg (curveNameBefore.left (pos))
324  .arg (numberNew);
325  if (curveNameNext == curveNameAfter) {
326 
327  // The difference between before and after is exactly one so we go to a lower level
328  curveNameNext = QString ("%1%2")
329  .arg (curveNameBefore)
330  .arg (DASH_ONE);
331  }
332  }
333  }
334  }
335 
336  // Curve name from settings takes precedence
337  SettingsForGraph settingsForGraph;
338  int indexOneBasedNext = numItems + 1;
339  curveNameNext = settingsForGraph.defaultCurveName (indexOneBasedNext,
340  curveNameNext);
341 
342  // At this point we have curveNameNext which does not conflict with curveNameBefore or
343  // curveNameAfter, but it may in rare cases conflict with some other curve name. We keep
344  // adding to the name until there is no conflict
345  while (m_curveNameList->containsCurveNameCurrent (curveNameNext)) {
346  curveNameNext += DASH_ONE;
347  }
348 
349  return curveNameNext;
350 }
351 
352 int DlgSettingsCurveAddRemove::numberAtEnd (const QString &str) const
353 {
354  ENGAUGE_ASSERT (endsWithNumber (str));
355 
356  // Go backward until the first nondigit
357  int sign = +1;
358  int ch = str.size () - 1;
359  while (str.at (ch).digitValue() >= 0) {
360  --ch;
361 
362  if (ch < 0) {
363  break;
364  }
365  }
366  ++ch;
367 
368  return sign * str.mid (ch).toInt ();
369 }
370 
371 void DlgSettingsCurveAddRemove::removeSelectedCurves ()
372 {
373  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsCurveAddRemove::removeSelectedCurves";
374 
375  ENGAUGE_ASSERT (m_listCurves->selectionModel ()->selectedIndexes ().count () > 0); // Also guarantees number of indexes > 0
376 
377  // Identify the first index after the last selected index
378  QString firstCurveAfter; // Empty case means there was no index afer the last selected index
379  for (int row = m_listCurves->model()->rowCount() - 1; row >= 0; row--) {
380 
381  QModelIndex indexCurrent = m_listCurves->model()->index(row, FIRST_COLUMN);
382  if (indexCurrent == m_listCurves->selectionModel()->selectedIndexes().last()) {
383 
384  // This is the last selected index, which will be removed below. Exit immediately with firstCurveAfter set
385  break;
386  }
387 
388  firstCurveAfter = indexCurrent.data().toString();
389  }
390 
391  // Delete the selected indexes from last to first
392  for (int i = m_listCurves->selectionModel ()->selectedIndexes ().count () - 1; i >= 0; i--) {
393 
394  int row = m_listCurves->selectionModel ()->selectedIndexes ().at (i).row ();
395 
396  m_curveNameList->removeRow (row);
397  }
398 
399  if (firstCurveAfter.isEmpty ()) {
400 
401  // Select the last remaining curve. These steps seem more complicated than necessary
402  int numItems = m_listCurves->model()->rowCount();
403  QModelIndex indexLast = m_listCurves->model()->index (numItems - 1, FIRST_COLUMN);
404  firstCurveAfter = m_listCurves->model()->data (indexLast).toString();
405 
406  }
407 
408 
409  // Select an item
410  selectCurveName(firstCurveAfter);
411 }
412 
413 void DlgSettingsCurveAddRemove::selectCurveName (const QString &curveWanted)
414 {
415  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsCurveAddRemove::selectCurveName"
416  << " curve=" << curveWanted.toLatin1().data();
417 
418  for (int row = 0; m_listCurves->model()->rowCount(); row++) {
419 
420  QModelIndex index = m_listCurves->model()->index (row, FIRST_COLUMN);
421  QString curveGot = index.data ().toString ();
422 
423  if (curveWanted == curveGot) {
424 
425  // Found the curve we want to select
426  m_listCurves->setCurrentIndex (index);
427  break;
428 
429  }
430  }
431 }
432 
434 {
435  if (!smallDialogs) {
436  setMinimumHeight (MINIMUM_HEIGHT);
437  }
438 }
439 
440 void DlgSettingsCurveAddRemove::slotDataChanged (const QModelIndex &topLeft,
441  const QModelIndex &bottomRight,
442  const QVector<int> &roles)
443 {
444  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsCurveAddRemove::slotDataChanged"
445  << " topLeft=(" << topLeft.row () << "," << topLeft.column () << ")"
446  << " bottomRight=(" << bottomRight.row () << "," << bottomRight.column () << ")"
447  << " roles=" << rolesAsString (roles).toLatin1 ().data ()
448  << " defaultDragOption=" << (m_listCurves->defaultDropAction() == Qt::MoveAction ? "MoveAction" : "CopyAction");
449 
450  updateControls ();
451 }
452 
453 void DlgSettingsCurveAddRemove::slotNew ()
454 {
455  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsCurveAddRemove::slotNew";
456 
457  const QString NO_ORIGINAL_CURVE_NAME;
458  const int NO_POINTS = 0;
459 
460  QString curveNameSuggestion = nextCurveName ();
461 
462  int row = newIndexFromSelection();
463 
464  insertCurveName (row,
465  curveNameSuggestion,
466  NO_ORIGINAL_CURVE_NAME,
467  NO_POINTS);
468 
469  selectCurveName (curveNameSuggestion);
470 
471  updateControls();
472 }
473 
474 void DlgSettingsCurveAddRemove::slotRemove ()
475 {
476  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsCurveAddRemove::slotRemove";
477 
478  int numPoints = 0;
479  for (int i = 0; i < m_listCurves->selectionModel ()->selectedIndexes ().count (); i++) {
480 
481  int row = m_listCurves->selectionModel ()->selectedIndexes ().at (i).row ();
482  QModelIndex idx = m_curveNameList->index (row, CurveNameListEntry::COL_NUM_POINTS ());
483  int curvePoints = m_curveNameList->data (idx, Qt::DisplayRole).toInt ();
484 
485  numPoints += curvePoints;
486  }
487 
488  int rtn = QMessageBox::Ok;
489  if (numPoints > 0) {
490 
491  QString msg;
492  if (m_listCurves->selectionModel ()->selectedIndexes ().count () == 1) {
493  msg = QString ("%1 %2 %3")
494  .arg (tr ("Removing this curve will also remove"))
495  .arg (numPoints)
496  .arg (tr ("points. Continue?"));
497  } else {
498  msg = QString ("%1 %2 %3")
499  .arg (tr ("Removing these curves will also remove"))
500  .arg (numPoints)
501  .arg (tr ("points. Continue?"));
502  }
503 
504  rtn = QMessageBox::warning (0,
505  tr ("Curves With Points"),
506  msg,
507  QMessageBox::Ok,
508  QMessageBox::Cancel);
509  }
510 
511  if (rtn == QMessageBox::Ok) {
512  removeSelectedCurves ();
513  }
514 
515  updateControls();
516 }
517 
518 void DlgSettingsCurveAddRemove::slotResetDefault()
519 {
520  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsCurveAddRemove::slotResetDefault";
521 
522  const QString REMOVE_ALL_SETTINGS_IN_GROUP; // Empty string
523 
524  QSettings settings (SETTINGS_ENGAUGE, SETTINGS_DIGITIZER);
525 
526  int indexOneBased = 1;
527 
528  SettingsForGraph settingsForGraph;
529  QString groupName = settingsForGraph.groupNameForNthCurve (indexOneBased);
530  while (settings.childGroups().contains (groupName)) {
531 
532  settings.beginGroup (groupName);
533  settings.remove (REMOVE_ALL_SETTINGS_IN_GROUP); // Remove this group by removing its settings
534  settings.endGroup ();
535 
536  ++indexOneBased;
537  groupName = settingsForGraph.groupNameForNthCurve (indexOneBased);
538  }
539 }
540 
541 void DlgSettingsCurveAddRemove::slotSaveDefault()
542 {
543  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsCurveAddRemove::slotSaveDefault";
544 
545  QSettings settings (SETTINGS_ENGAUGE, SETTINGS_DIGITIZER);
546 
547  for (int row = 0; row < m_curveNameList->rowCount (); row++) {
548 
549  QModelIndex idxCurrent = m_curveNameList->index (row, 0);
550 
551  QString curveNameCurrent = m_curveNameList->data (idxCurrent).toString ();
552 
553  int indexOneBased = row + 1;
554 
555  SettingsForGraph settingsForGraph;
556  QString groupName = settingsForGraph.groupNameForNthCurve (indexOneBased);
557 
558  settings.beginGroup (groupName);
559  settings.setValue (SETTINGS_CURVE_NAME,
560  curveNameCurrent);
561  settings.endGroup ();
562  }
563 }
564 
565 void DlgSettingsCurveAddRemove::slotSelectionChanged (QItemSelection, QItemSelection)
566 {
567  updateControls ();
568 }
569 
570 void DlgSettingsCurveAddRemove::updateControls ()
571 {
572  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsCurveAddRemove::updateControls";
573 
574  enableOk (true);
575 
576  ENGAUGE_CHECK_PTR (m_listCurves);
577 
578  int numSelectedItems = m_listCurves->selectionModel ()->selectedIndexes ().count ();
579  int numItems = m_curveNameList->rowCount ();
580 
581  // Leave at least one curve
582  m_btnRemove->setEnabled ((numSelectedItems > 0) && (numSelectedItems < numItems));
583 }
Manage storage and retrieval of the settings for the curves.
virtual void setSmallDialogs(bool smallDialogs)
If false then dialogs have a minimum size so all controls are visible.
bool containsCurveNameCurrent(const QString &curveName) const
Return true if specified curve name is already in the list.
QString curveNameOriginal() const
Original curve name in document. Empty if there was no original curve.
void setCmdMediator(CmdMediator &cmdMediator)
Store CmdMediator for easy access by the leaf class.
Utility class for converting the QVariant in CurveNameList to/from the curve names as QStrings...
void finishPanel(QWidget *subPanel, int minimumWidth=MINIMUM_DIALOG_WIDTH, int minimumHeightOrZero=0)
Add Ok and Cancel buttons to subpanel to get the whole dialog.
Command for DlgSettingsCurveAddRemove.
virtual void createOptionalSaveDefault(QHBoxLayout *layout)
Let subclass define an optional Save As Default button.
virtual QWidget * createSubPanel()
Create dialog-specific panel to which base class will add Ok and Cancel buttons.
virtual bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
Store one curve name data.
virtual int rowCount(const QModelIndex &parent=QModelIndex()) const
One row per curve name.
static int COL_NUM_POINTS()
Get method for number of points constant.
void load(CmdMediator &cmdMediator)
Load settings from Document.
void enableOk(bool enable)
Let leaf subclass control the Ok button.
QString groupNameForNthCurve(int indexOneBased) const
Return the group name, that appears in the settings file/registry, for the specified curve index...
Command queue stack.
Definition: CmdMediator.h:23
QString curveNameCurrent() const
Curve name displayed in DlgSettingsCurveAddRemove.
Abstract base class for all Settings dialogs.
int curvesGraphsNumPoints(const QString &curveName) const
See CurvesGraphs::curvesGraphsNumPoints.
Definition: CmdMediator.cpp:67
virtual QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
Retrieve data from model.
Model for DlgSettingsCurveAddRemove and CmdSettingsCurveAddRemove.
Definition: CurveNameList.h:16
MainWindow & mainWindow()
Get method for MainWindow.
QString defaultCurveName(int indexOneBased, const QString &defaultName) const
Default graph name for the specified curve index.
Main window consisting of menu, graphics scene, status bar and optional toolbars as a Single Document...
Definition: MainWindow.h:83
DlgSettingsCurveAddRemove(MainWindow &mainWindow)
Single constructor.
QStringList curvesGraphsNames() const
See CurvesGraphs::curvesGraphsNames.
Definition: CmdMediator.cpp:62
CmdMediator & cmdMediator()
Provide access to Document information wrapped inside CmdMediator.
virtual void handleOk()
Process slotOk.