Engauge Digitizer  2
 All Classes Files Functions Variables Enumerations Enumerator Friends Pages
DlgSettingsGridRemoval.cpp
1 #include "CmdMediator.h"
2 #include "CmdSettingsGridRemoval.h"
3 #include "DlgSettingsGridRemoval.h"
4 #include "EngaugeAssert.h"
5 #include "Logger.h"
6 #include "MainWindow.h"
7 #include <QCheckBox>
8 #include <QComboBox>
9 #include <QDoubleValidator>
10 #include <QGraphicsScene>
11 #include <QGridLayout>
12 #include <QGroupBox>
13 #include <QHBoxLayout>
14 #include <QLabel>
15 #include <QLineEdit>
16 #include "ViewPreview.h"
17 
18 const double CLOSE_DISTANCE_MAX = 64;
19 const double CLOSE_DISTANCE_MIN = 0;
20 const int CLOSE_DECIMALS = 1;
21 const int COUNT_MIN = 1;
22 const int COUNT_MAX = 100;
23 const int COUNT_DECIMALS = 0;
24 
26  DlgSettingsAbstractBase ("Grid Removal",
27  "DlgSettingsGridRemoval",
28  mainWindow),
29  m_scenePreview (0),
30  m_viewPreview (0),
31  m_modelGridRemovalBefore (0),
32  m_modelGridRemovalAfter (0)
33 {
34  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::DlgSettingsGridRemoval";
35 
36  QWidget *subPanel = createSubPanel ();
37  finishPanel (subPanel);
38 }
39 
40 DlgSettingsGridRemoval::~DlgSettingsGridRemoval()
41 {
42  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::~DlgSettingsGridRemoval";
43 }
44 
45 void DlgSettingsGridRemoval::createOptionalSaveDefault (QHBoxLayout * /* layout */)
46 {
47 }
48 
49 void DlgSettingsGridRemoval::createPreview (QGridLayout *layout, int &row)
50 {
51  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::createPreview";
52 
53  QLabel *labelPreview = new QLabel ("Preview");
54  layout->addWidget (labelPreview, row++, 0, 1, 5);
55 
56  m_scenePreview = new QGraphicsScene (this);
57  m_viewPreview = new ViewPreview (m_scenePreview,
58  ViewPreview::VIEW_ASPECT_RATIO_VARIABLE,
59  this);
60  m_viewPreview->setWhatsThis (tr ("Preview window that shows how current settings affect grid removal"));
61  m_viewPreview->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
62  m_viewPreview->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
63  m_viewPreview->setMinimumHeight (MINIMUM_PREVIEW_HEIGHT);
64  layout->addWidget (m_viewPreview, row++, 0, 1, 5);
65 }
66 
67 void DlgSettingsGridRemoval::createRemoveGridLines (QGridLayout *layout, int &row)
68 {
69  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::createRemoveGridLines";
70 
71  m_chkRemoveGridLines = new QCheckBox ("Remove pixels close to defined grid lines");
72  m_chkRemoveGridLines->setWhatsThis ("Check this box to have pixels close to regularly spaced gridlines removed.\n\n"
73  "This option is only available when the axis points have all been defined.");
74  connect (m_chkRemoveGridLines, SIGNAL (stateChanged (int)), this, SLOT (slotRemoveGridLines (int)));
75  layout->addWidget (m_chkRemoveGridLines, row++, 1, 1, 3);
76 
77  QLabel *labelCloseDistance = new QLabel ("Close distance (pixels):");
78  layout->addWidget (labelCloseDistance, row, 2);
79 
80  m_editCloseDistance = new QLineEdit;
81  m_editCloseDistance->setWhatsThis ("Set closeness distance in pixels.\n\n"
82  "Pixels that are closer to the regularly spaced gridlines, than this distance, "
83  "will be removed.\n\n"
84  "This value cannot be negative. A zero value disables this feature. Decimal values are allowed");
85  m_validatorCloseDistance = new QDoubleValidator (CLOSE_DISTANCE_MIN, CLOSE_DISTANCE_MAX, CLOSE_DECIMALS);
86  m_editCloseDistance->setValidator (m_validatorCloseDistance);
87  connect (m_editCloseDistance, SIGNAL (textChanged (const QString &)), this, SLOT (slotCloseDistance (const QString &)));
88  layout->addWidget (m_editCloseDistance, row++, 3);
89 
90  createRemoveGridLinesX (layout, row);
91  createRemoveGridLinesY (layout, row);
92 }
93 
94 void DlgSettingsGridRemoval::createRemoveGridLinesX (QGridLayout *layout, int &row)
95 {
96  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::createRemoveGridLinesX";
97 
98  QString titleX = "X Grid Lines";
99  if (false) {
100  titleX = QString (QChar (0x98, 0x03)) + QString (" Grid Lines");
101  }
102  QGroupBox *groupX = new QGroupBox (titleX);
103  layout->addWidget (groupX, row, 2);
104 
105  QGridLayout *layoutGroup = new QGridLayout;
106  groupX->setLayout (layoutGroup);
107 
108  QLabel *labelDisable = new QLabel ("Disable:");
109  layoutGroup->addWidget (labelDisable, 0, 0);
110 
111  m_cmbDisableX = new QComboBox;
112  m_cmbDisableX->setWhatsThis ("Disabled value.\n\n"
113  "The X grid lines are specified using only three values at a time. For flexibility, four values "
114  "are offered so you must chose which value is disabled. Once disabled, that value is simply "
115  "updated as the other values change");
116  m_cmbDisableX->addItem(gridCoordDisableToString (GRID_COORD_DISABLE_COUNT),
117  QVariant (GRID_COORD_DISABLE_COUNT));
118  m_cmbDisableX->addItem(gridCoordDisableToString (GRID_COORD_DISABLE_START),
119  QVariant (GRID_COORD_DISABLE_START));
120  m_cmbDisableX->addItem(gridCoordDisableToString (GRID_COORD_DISABLE_STEP),
121  QVariant (GRID_COORD_DISABLE_STEP));
122  m_cmbDisableX->addItem(gridCoordDisableToString (GRID_COORD_DISABLE_STOP),
123  QVariant (GRID_COORD_DISABLE_STOP));
124  connect (m_cmbDisableX, SIGNAL (activated (const QString &)), this, SLOT (slotDisableX (const QString &))); // activated() ignores code changes
125  layoutGroup->addWidget (m_cmbDisableX, 0, 1);
126 
127  QLabel *labelCount = new QLabel ("Count:");
128  layoutGroup->addWidget (labelCount, 1, 0);
129 
130  m_editCountX = new QLineEdit;
131  m_editCountX->setWhatsThis ("Number of X grid lines.\n\n"
132  "The number of X grid lines must be entered as an integer greater than zero");
133  m_validatorCountX = new QDoubleValidator (COUNT_MIN, COUNT_MAX, COUNT_DECIMALS);
134  m_editCountX->setValidator (m_validatorCountX);
135  connect (m_editCountX, SIGNAL (textChanged (const QString &)), this, SLOT (slotCountX (const QString &)));
136  layoutGroup->addWidget (m_editCountX, 1, 1);
137 
138  QLabel *labelStart = new QLabel ("Start:");
139  layoutGroup->addWidget (labelStart, 2, 0);
140 
141  m_editStartX = new QLineEdit;
142  m_editStartX->setWhatsThis ("Value of the first X grid line.\n\n"
143  "The start value cannot be greater than the stop value");
144  m_validatorStartX = new QDoubleValidator;
145  m_editStartX->setValidator (m_validatorStartX);
146  connect (m_editStartX, SIGNAL (textChanged (const QString &)), this, SLOT (slotStartX (const QString &)));
147  layoutGroup->addWidget (m_editStartX, 2, 1);
148 
149  QLabel *labelStep = new QLabel ("Step:");
150  layoutGroup->addWidget (labelStep, 3, 0);
151 
152  m_editStepX = new QLineEdit;
153  m_editStepX->setWhatsThis ("Difference in value between two successive X grid lines.\n\n"
154  "The step value must be greater than zero");
155  m_validatorStepX = new QDoubleValidator;
156  m_editStepX->setValidator (m_validatorStepX);
157  connect (m_editStepX, SIGNAL (textChanged (const QString &)), this, SLOT (slotStepX (const QString &)));
158  layoutGroup->addWidget (m_editStepX, 3, 1);
159 
160  QLabel *labelStop = new QLabel ("Stop:");
161  layoutGroup->addWidget (labelStop, 4, 0);
162 
163  m_editStopX = new QLineEdit;
164  m_editStopX->setWhatsThis ("Value of the last X grid line.\n\n"
165  "The stop value cannot be less than the start value");
166  m_validatorStopX = new QDoubleValidator;
167  m_editStopX->setValidator (m_validatorStopX);
168  connect (m_editStopX, SIGNAL (textChanged (const QString &)), this, SLOT (slotStopX (const QString &)));
169  layoutGroup->addWidget (m_editStopX, 4, 1);
170 }
171 
172 void DlgSettingsGridRemoval::createRemoveGridLinesY (QGridLayout *layout, int &row)
173 {
174  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::createRemoveGridLinesY";
175 
176  QString titleY = "Y Grid Lines";
177  if (false) {
178  titleY = QString ("R Grid Lines");
179  }
180  QGroupBox *groupY = new QGroupBox (titleY);
181  layout->addWidget (groupY, row++, 3);
182 
183  QGridLayout *layoutGroup = new QGridLayout;
184  groupY->setLayout (layoutGroup);
185 
186  QLabel *labelDisable = new QLabel ("Disable:");
187  layoutGroup->addWidget (labelDisable, 0, 0);
188 
189  m_cmbDisableY = new QComboBox;
190  m_cmbDisableY->setWhatsThis ("Disabled value.\n\n"
191  "The Y grid lines are specified using only three values at a time. For flexibility, four values "
192  "are offered so you must chose which value is disabled. Once disabled, that value is simply "
193  "updated as the other values change");
194  m_cmbDisableY->addItem(gridCoordDisableToString (GRID_COORD_DISABLE_COUNT),
195  QVariant (GRID_COORD_DISABLE_COUNT));
196  m_cmbDisableY->addItem(gridCoordDisableToString (GRID_COORD_DISABLE_START),
197  QVariant (GRID_COORD_DISABLE_START));
198  m_cmbDisableY->addItem(gridCoordDisableToString (GRID_COORD_DISABLE_STEP),
199  QVariant (GRID_COORD_DISABLE_STEP));
200  m_cmbDisableY->addItem(gridCoordDisableToString (GRID_COORD_DISABLE_STOP),
201  QVariant (GRID_COORD_DISABLE_STOP));
202  connect (m_cmbDisableY, SIGNAL (activated (const QString &)), this, SLOT (slotDisableY (const QString &))); // activated() ignores code changes
203  layoutGroup->addWidget (m_cmbDisableY, 0, 1);
204 
205  QLabel *labelCount = new QLabel ("Count:");
206  layoutGroup->addWidget (labelCount, 1, 0);
207 
208  m_editCountY = new QLineEdit;
209  m_editCountY->setWhatsThis ("Number of Y grid lines.\n\n"
210  "The number of Y grid lines must be entered as an integer greater than zero");
211  m_validatorCountY = new QDoubleValidator (COUNT_MIN, COUNT_MAX, COUNT_DECIMALS);
212  m_editCountY->setValidator (m_validatorCountY);
213  connect (m_editCountY, SIGNAL (textChanged (const QString &)), this, SLOT (slotCountY (const QString &)));
214  layoutGroup->addWidget (m_editCountY, 1, 1);
215 
216  QLabel *labelStart = new QLabel ("Start:");
217  layoutGroup->addWidget (labelStart, 2, 0);
218 
219  m_editStartY = new QLineEdit;
220  m_editStartY->setWhatsThis ("Value of the first Y grid line.\n\n"
221  "The start value cannot be greater than the stop value");
222  m_validatorStartY = new QDoubleValidator;
223  m_editStartY->setValidator (m_validatorStartY);
224  connect (m_editStartY, SIGNAL (textChanged (const QString &)), this, SLOT (slotStartY (const QString &)));
225  layoutGroup->addWidget (m_editStartY, 2, 1);
226 
227  QLabel *labelStep = new QLabel ("Step:");
228  layoutGroup->addWidget (labelStep, 3, 0);
229 
230  m_editStepY = new QLineEdit;
231  m_editStepY->setWhatsThis ("Difference in value between two successive Y grid lines.\n\n"
232  "The step value must be greater than zero");
233  m_validatorStepY = new QDoubleValidator;
234  m_editStepY->setValidator (m_validatorStepY);
235  connect (m_editStepY, SIGNAL (textChanged (const QString &)), this, SLOT (slotStepY (const QString &)));
236  layoutGroup->addWidget (m_editStepY, 3, 1);
237 
238  QLabel *labelStop = new QLabel ("Stop:");
239  layoutGroup->addWidget (labelStop, 4, 0);
240 
241  m_editStopY = new QLineEdit;
242  m_editStopY->setWhatsThis ("Value of the last Y grid line.\n\n"
243  "The stop value cannot be less than the start value");
244  m_validatorStopY = new QDoubleValidator;
245  m_editStopY->setValidator (m_validatorStopY);
246  connect (m_editStopY, SIGNAL (textChanged (const QString &)), this, SLOT (slotStopY (const QString &)));
247  layoutGroup->addWidget (m_editStopY, 4, 1);
248 }
249 
251 {
252  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::createSubPanel";
253 
254  const int COLUMN_CHECKBOX_WIDTH = 60;
255 
256  QWidget *subPanel = new QWidget ();
257  QGridLayout *layout = new QGridLayout (subPanel);
258  subPanel->setLayout (layout);
259 
260  layout->setColumnStretch(0, 1); // Empty first column
261  layout->setColumnStretch(1, 0); // Checkbox part of "section" checkboxes. In other rows this has empty space as indentation
262  layout->setColumnMinimumWidth(1, COLUMN_CHECKBOX_WIDTH);
263  layout->setColumnStretch(2, 0); // X
264  layout->setColumnStretch(3, 0); // Y
265  layout->setColumnStretch(4, 1); // Empty last column
266 
267  int row = 0;
268  createRemoveGridLines (layout, row);
269  createPreview (layout, row);
270 
271  return subPanel;
272 }
273 
275 {
276  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::handleOk";
277 
278  // Set the stable flag
279  m_modelGridRemovalAfter->setStable ();
280 
282  cmdMediator ().document(),
283  *m_modelGridRemovalBefore,
284  *m_modelGridRemovalAfter);
285  cmdMediator ().push (cmd);
286 
287  hide ();
288 }
289 
291 {
292  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::load";
293 
294  setCmdMediator (cmdMediator);
295 
296  // Flush old data
297  if (m_modelGridRemovalBefore != 0) {
298  delete m_modelGridRemovalBefore;
299  }
300  if (m_modelGridRemovalAfter != 0) {
301  delete m_modelGridRemovalAfter;
302  }
303 
304  // Save new data
305  m_modelGridRemovalBefore = new DocumentModelGridRemoval (cmdMediator.document());
306  m_modelGridRemovalAfter = new DocumentModelGridRemoval (cmdMediator.document());
307 
308  // Sanity checks. Incoming defaults must be acceptable to the local limits
309  ENGAUGE_ASSERT (CLOSE_DISTANCE_MIN <= m_modelGridRemovalAfter->closeDistance());
310  ENGAUGE_ASSERT (CLOSE_DISTANCE_MAX >= m_modelGridRemovalAfter->closeDistance());
311 
312  // Populate controls
313  m_chkRemoveGridLines->setChecked (m_modelGridRemovalAfter->removeDefinedGridLines());
314 
315  m_editCloseDistance->setText (QString::number (m_modelGridRemovalAfter->closeDistance()));
316 
317  int indexDisableX = m_cmbDisableX->findData (QVariant (m_modelGridRemovalAfter->gridCoordDisableX()));
318  m_cmbDisableX->setCurrentIndex (indexDisableX);
319 
320  m_editCountX->setText(QString::number(m_modelGridRemovalAfter->countX()));
321  m_editStartX->setText(QString::number(m_modelGridRemovalAfter->startX()));
322  m_editStepX->setText(QString::number(m_modelGridRemovalAfter->stepX()));
323  m_editStopX->setText(QString::number(m_modelGridRemovalAfter->stopX()));
324 
325  int indexDisableY = m_cmbDisableX->findData (QVariant (m_modelGridRemovalAfter->gridCoordDisableY()));
326  m_cmbDisableY->setCurrentIndex (indexDisableY);
327 
328  m_editCountY->setText(QString::number(m_modelGridRemovalAfter->countY()));
329  m_editStartY->setText(QString::number(m_modelGridRemovalAfter->startY()));
330  m_editStepY->setText(QString::number(m_modelGridRemovalAfter->stepY()));
331  m_editStopY->setText(QString::number(m_modelGridRemovalAfter->stopY()));
332 
333  m_scenePreview->clear();
334  m_scenePreview->addPixmap (cmdMediator.document().pixmap());
335 
336  updateControls ();
337  enableOk (false); // Disable Ok button since there not yet any changes
338  updatePreview();
339 }
340 
341 void DlgSettingsGridRemoval::slotCloseDistance(const QString &)
342 {
343  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::slotCloseDistance";
344 
345  m_modelGridRemovalAfter->setCloseDistance(m_editCloseDistance->text().toDouble());
346  updateControls ();
347  updatePreview();
348 }
349 
350 void DlgSettingsGridRemoval::slotCountX(const QString &count)
351 {
352  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::slotCountX";
353 
354  m_modelGridRemovalAfter->setCountX(count.toInt());
355  updateControls ();
356  updatePreview();
357 }
358 
359 void DlgSettingsGridRemoval::slotCountY(const QString &count)
360 {
361  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::slotCountY";
362 
363  m_modelGridRemovalAfter->setCountY(count.toInt());
364  updateControls ();
365  updatePreview();
366 }
367 
368 void DlgSettingsGridRemoval::slotDisableX(const QString &)
369 {
370  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::slotDisableX";
371 
372  GridCoordDisable gridCoordDisable = (GridCoordDisable) m_cmbDisableX->currentData().toInt();
373  m_modelGridRemovalAfter->setGridCoordDisableX(gridCoordDisable);
374  updateControls();
375  updatePreview();
376 }
377 
378 void DlgSettingsGridRemoval::slotDisableY(const QString &)
379 {
380  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::slotDisableY";
381 
382  GridCoordDisable gridCoordDisable = (GridCoordDisable) m_cmbDisableY->currentData().toInt();
383  m_modelGridRemovalAfter->setGridCoordDisableY(gridCoordDisable);
384  updateControls();
385  updatePreview();
386 }
387 
388 void DlgSettingsGridRemoval::slotRemoveGridLines (int state)
389 {
390  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::slotRemoveGridLines";
391 
392  m_modelGridRemovalAfter->setRemoveDefinedGridLines(state == Qt::Checked);
393  updateControls();
394  updatePreview();
395 }
396 
397 void DlgSettingsGridRemoval::slotStartX(const QString &startX)
398 {
399  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::slotStartX";
400 
401  m_modelGridRemovalAfter->setStartX(startX.toDouble());
402  updateControls();
403  updatePreview();
404 }
405 
406 void DlgSettingsGridRemoval::slotStartY(const QString &startY)
407 {
408  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::slotStartY";
409 
410  m_modelGridRemovalAfter->setStartY(startY.toDouble());
411  updateControls();
412  updatePreview();
413 }
414 
415 void DlgSettingsGridRemoval::slotStepX(const QString &stepX)
416 {
417  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::slotStepX";
418 
419  m_modelGridRemovalAfter->setStepX(stepX.toDouble());
420  updateControls();
421  updatePreview();
422 }
423 
424 void DlgSettingsGridRemoval::slotStepY(const QString &stepY)
425 {
426  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::slotStepY";
427 
428  m_modelGridRemovalAfter->setStepY(stepY.toDouble());
429  updateControls();
430  updatePreview();
431 }
432 
433 void DlgSettingsGridRemoval::slotStopX(const QString &stopX)
434 {
435  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::slotStopX";
436 
437  m_modelGridRemovalAfter->setStopX(stopX.toDouble());
438  updateControls();
439  updatePreview();
440 }
441 
442 void DlgSettingsGridRemoval::slotStopY(const QString &stopY)
443 {
444  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsGridRemoval::slotStopY";
445 
446  m_modelGridRemovalAfter->setStopY(stopY.toDouble());
447  updateControls();
448  updatePreview();
449 }
450 
451 void DlgSettingsGridRemoval::updateControls ()
452 {
453  m_editCloseDistance->setEnabled (m_chkRemoveGridLines->isChecked ());
454 
455  m_cmbDisableX->setEnabled (m_chkRemoveGridLines->isChecked ());
456 
457  GridCoordDisable disableX = (GridCoordDisable) m_cmbDisableX->currentData().toInt();
458  m_editCountX->setEnabled (m_chkRemoveGridLines->isChecked () && (disableX != GRID_COORD_DISABLE_COUNT));
459  m_editStartX->setEnabled (m_chkRemoveGridLines->isChecked () && (disableX != GRID_COORD_DISABLE_START));
460  m_editStepX->setEnabled (m_chkRemoveGridLines->isChecked () && (disableX != GRID_COORD_DISABLE_STEP));
461  m_editStopX->setEnabled (m_chkRemoveGridLines->isChecked () && (disableX != GRID_COORD_DISABLE_STOP));
462 
463  m_cmbDisableY->setEnabled (m_chkRemoveGridLines->isChecked ());
464 
465  GridCoordDisable disableY = (GridCoordDisable) m_cmbDisableY->currentData().toInt();
466  m_editCountY->setEnabled (m_chkRemoveGridLines->isChecked () && (disableY != GRID_COORD_DISABLE_COUNT));
467  m_editStartY->setEnabled (m_chkRemoveGridLines->isChecked () && (disableY != GRID_COORD_DISABLE_START));
468  m_editStepY->setEnabled (m_chkRemoveGridLines->isChecked () && (disableY != GRID_COORD_DISABLE_STEP));
469  m_editStopY->setEnabled (m_chkRemoveGridLines->isChecked () && (disableY != GRID_COORD_DISABLE_STOP));
470 
471  QString textCloseDistance = m_editCloseDistance->text();
472  QString textCountX = m_editCountX->text();
473  QString textStartX = m_editStartX->text();
474  QString textStepX = m_editStepX->text();
475  QString textStopX = m_editStopX->text();
476  QString textCountY = m_editCountY->text();
477  QString textStartY = m_editStartY->text();
478  QString textStepY = m_editStepY->text();
479  QString textStopY = m_editStopY->text();
480 
481  int pos;
482  bool isOk = (m_validatorCloseDistance->validate (textCloseDistance, pos) == QValidator::Acceptable) &&
483  (m_validatorCountX->validate (textCountX, pos) == QValidator::Acceptable) &&
484  (m_validatorStartX->validate (textStartX, pos) == QValidator::Acceptable) &&
485  (m_validatorStepX->validate (textStepX, pos) == QValidator::Acceptable) &&
486  (m_validatorStopX->validate (textStopX, pos) == QValidator::Acceptable) &&
487  (m_validatorCountY->validate (textCountY, pos) == QValidator::Acceptable) &&
488  (m_validatorStartY->validate (textStartY, pos) == QValidator::Acceptable) &&
489  (m_validatorStepY->validate (textStepY, pos) == QValidator::Acceptable) &&
490  (m_validatorStopY->validate (textStopY, pos) == QValidator::Acceptable);
491  enableOk (isOk);
492 }
493 
494 void DlgSettingsGridRemoval::updatePreview ()
495 {
496 
497 }
double closeDistance() const
Get method for close distance.
bool removeDefinedGridLines() const
Get method for removing defined grid lines.
void setCloseDistance(double closeDistance)
Set method for close distance.
double startY() const
Get method for y start.
void setCountX(int countX)
Set method for x count.
void setStopY(double stopY)
Set method for y stop.
void setCmdMediator(CmdMediator &cmdMediator)
Store CmdMediator for easy access by the leaf class.
virtual void load(CmdMediator &cmdMediator)
Load settings from Document.
void setStartY(double startY)
Set method for y start.
GridCoordDisable gridCoordDisableX() const
Get method for x coord parameter to disable.
void setStepY(double stepY)
Set method for y step.
QPixmap pixmap() const
Return the image that is being digitized.
Definition: Document.cpp:721
Document & document()
Provide the Document to commands, primarily for undo/redo processing.
Definition: CmdMediator.cpp:61
double stepY() const
Get method for y step.
GridCoordDisable gridCoordDisableY() const
Get method for y coord parameter to disable.
void setStartX(double startX)
Set method for x start.
virtual void handleOk()
Process slotOk.
void setCountY(int countY)
Set method for y count.
virtual void createOptionalSaveDefault(QHBoxLayout *layout)
Let subclass define an optional Save As Default button.
DlgSettingsGridRemoval(MainWindow &mainWindow)
Single constructor.
Class that modifies QGraphicsView to automatically expand/shrink the view to fit the window...
Definition: ViewPreview.h:8
void setStepX(double stepX)
Set method for x step.
double stopX() const
Get method for x stop.
void setRemoveDefinedGridLines(bool removeDefinedGridLines)
Set method for removing defined grid lines.
double startX() const
Get method for x start.
double stopY() const
Get method for y stop.
void setGridCoordDisableY(GridCoordDisable gridCoordDisable)
Set method for y coord parameter to disable.
Command for DlgSettingsGridRemoval.
void setGridCoordDisableX(GridCoordDisable gridCoordDisable)
Set method for x coord parameter to disable.
void finishPanel(QWidget *subPanel)
Add Ok and Cancel buttons to subpanel to get the whole dialog.
int countX() const
Get method for x count.
int countY() const
Get method for y count.
static int MINIMUM_PREVIEW_HEIGHT
Dialog layout constant that guarantees preview has sufficent room.
double stepX() const
Get method for x step.
void setStable()
Set the stable flag to true. This public version has no argument since it cannot be undone...
void enableOk(bool enable)
Let leaf subclass control the Ok button.
Command queue stack.
Definition: CmdMediator.h:16
Abstract base class for all Settings dialogs.
virtual QWidget * createSubPanel()
Create dialog-specific panel to which base class will add Ok and Cancel buttons.
Model for DlgSettingsGridRemoval and CmdSettingsGridRemoval. The settings are unstable until the user...
MainWindow & mainWindow()
Get method for MainWindow.
Main window consisting of menu, graphics scene, status bar and optional toolbars as a Single Document...
Definition: MainWindow.h:66
CmdMediator & cmdMediator()
Provide access to Document information wrapped inside CmdMediator.
void setStopX(double stopX)
Set method for x stop.