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