Engauge Digitizer 2
Loading...
Searching...
No Matches
DlgSettingsSegments.cpp
Go to the documentation of this file.
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 "ButtonWhatsThis.h"
8#include "CmdMediator.h"
10#include "DlgSettingsSegments.h"
11#include "EngaugeAssert.h"
12#include "GeometryWindow.h"
13#include "InactiveOpacity.h"
14#include "Logger.h"
15#include "MainWindow.h"
16#include "PointStyle.h"
17#include <QCheckBox>
18#include <QComboBox>
19#include <QGridLayout>
20#include <QGraphicsScene>
21#include <QLabel>
22#include <qmath.h>
23#include <QSpinBox>
24#include <QWhatsThis>
25#include "Segment.h"
26#include "SegmentFactory.h"
27#include "ViewPreview.h"
28
29const int MINIMUM_HEIGHT = 540;
30const int MIN_LENGTH_MIN = 1;
31const int MIN_LENGTH_MAX = 10000;
33const int POINT_SEPARATION_MAX = 10000;
34
35const int IMAGE_WIDTH = 200;
36const int IMAGE_HEIGHT = 350;
37
38const double BRUSH_WIDTH = 2.0;
39
41 DlgSettingsAbstractBase (tr ("Segment Fill"),
42 "DlgSettingsSegments",
44 m_scenePreviewActive (nullptr),
45 m_scenePreviewInactive (nullptr),
46 m_viewPreviewActive (nullptr),
47 m_viewPreviewInactive (nullptr),
48 m_modelSegmentsBefore (nullptr),
49 m_modelSegmentsAfter (nullptr),
50 m_loading (false)
51{
52 LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsSegments::DlgSettingsSegments";
53
54 QWidget *subPanel = createSubPanel ();
55 finishPanel (subPanel);
56}
57
59{
60 LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsSegments::~DlgSettingsSegments";
61}
62
63void DlgSettingsSegments::clearPointsOneScene (GraphicsPoints &points)
64{
65 QList<GraphicsPoint*>::iterator itrP;
66 for (itrP = points.begin(); itrP != points.end(); itrP++) {
67 GraphicsPoint *point = *itrP;
68 delete point;
69 }
70
71 points.clear();
72}
73
74void DlgSettingsSegments::createControls (QGridLayout *layout,
75 int &row)
76{
77 LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsSegments::createControls";
78
79 QLabel *labelMinLength = new QLabel(QString ("%1:").arg (tr ("Minimum length (points)")));
80 layout->addWidget(labelMinLength, row, 1);
81
82 m_spinMinLength = new QSpinBox;
83 m_spinMinLength->setRange (MIN_LENGTH_MIN, MIN_LENGTH_MAX);
84 m_spinMinLength->setWhatsThis (tr ("Select a minimum number of points in a segment.\n\n"
85 "Only segments with more points will be created.\n\n"
86 "This value should be as large as possible to reduce memory usage. This value has "
87 "a lower limit"));
88 connect (m_spinMinLength, SIGNAL (valueChanged (const QString &)), this, SLOT (slotMinLength (const QString &)));
89 layout->addWidget(m_spinMinLength, row++, 2);
90
91 QLabel *labelPointSeparation = new QLabel(QString ("%1:").arg (tr ("Point separation (pixels)")));
92 layout->addWidget (labelPointSeparation, row, 1);
93
94 m_spinPointSeparation = new QSpinBox;
95 m_spinPointSeparation->setRange (POINT_SEPARATION_MIN, POINT_SEPARATION_MAX);
96 m_spinPointSeparation->setWhatsThis (tr ("Select a point separation in pixels.\n\n"
97 "Successive points added to a segment will be separated by this number of pixels. "
98 "If Fill Corners is enabled, then additional points will be inserted at corners so some points "
99 "will be closer.\n\n"
100 "This value has a lower limit"));
101 connect (m_spinPointSeparation, SIGNAL (valueChanged (const QString &)), this, SLOT (slotPointSeparation (const QString &)));
102 layout->addWidget (m_spinPointSeparation, row++, 2);
103
104 QLabel *labelFillCorners = new QLabel (QString ("%1:").arg (tr ("Fill corners")));
105 layout->addWidget (labelFillCorners, row, 1);
106
107 m_chkFillCorners = new QCheckBox;
108 m_chkFillCorners->setWhatsThis (tr ("Fill corners.\n\n"
109 "In addition to the points placed at regular intervals, this option causes a point to be "
110 "placed at each corner. This option can capture important information in piecewise linear graphs, "
111 "but gradually curving graphs may not benefit from the additional points"));
112 connect (m_chkFillCorners, SIGNAL (stateChanged (int)), this, SLOT (slotFillCorners (int)));
113 layout->addWidget (m_chkFillCorners, row++, 2);
114
115 QLabel *labelLineWidthActive = new QLabel(QString ("%1:").arg (tr ("Active line width")));
116 layout->addWidget (labelLineWidthActive, row, 1);
117
118 m_spinLineWidthActive = new QSpinBox;
119 m_spinLineWidthActive->setWhatsThis (tr ("Select a size for the lines drawn along a segment when hovering over the segment"));
120 m_spinLineWidthActive->setMinimum(1);
121 connect (m_spinLineWidthActive, SIGNAL (valueChanged (int)), this, SLOT (slotLineWidthActive (int)));
122 layout->addWidget (m_spinLineWidthActive, row++, 2);
123
124 QLabel *labelLineWidthInactive = new QLabel(QString ("%1:").arg (tr ("Inactive line width")));
125 layout->addWidget (labelLineWidthInactive, row, 1);
126
127 m_spinLineWidthInactive = new QSpinBox;
128 m_spinLineWidthInactive->setWhatsThis (tr ("Select a size for the lines drawn along a segment when not hovering over the segment"));
129 m_spinLineWidthInactive->setMinimum(1);
130 connect (m_spinLineWidthInactive, SIGNAL (valueChanged (int)), this, SLOT (slotLineWidthInactive (int)));
131 layout->addWidget (m_spinLineWidthInactive, row++, 2);
132
133 QLabel *labelLineColor = new QLabel(QString ("%1:").arg (tr ("Line color")));
134 layout->addWidget (labelLineColor, row, 1);
135
136 m_cmbLineColor = new QComboBox;
137 m_cmbLineColor->setWhatsThis (tr ("Select a color for the lines drawn along a segment"));
138 populateColorComboWithTransparent (*m_cmbLineColor);
139 connect (m_cmbLineColor, SIGNAL (activated (const QString &)),
140 this, SLOT (slotLineColor (const QString &))); // activated() ignores code changes
141 layout->addWidget (m_cmbLineColor, row++, 2);
142
143 QLabel *labelInactiveOpacity = new QLabel(QString ("%1:").arg (tr ("Inactive opacity")));
144 layout->addWidget (labelInactiveOpacity, row, 1);
145
146 m_cmbInactiveOpacity = new QComboBox;
147 m_cmbInactiveOpacity->setWhatsThis (tr ("Select an opacity for the inactive segments that are not under the cursor"));
148 m_cmbInactiveOpacity->addItem (inactiveOpacityEnumToQString (INACTIVE_OPACITY_0),
149 QVariant (INACTIVE_OPACITY_0));
150 m_cmbInactiveOpacity->addItem (inactiveOpacityEnumToQString (INACTIVE_OPACITY_32),
151 QVariant (INACTIVE_OPACITY_32));
152 m_cmbInactiveOpacity->addItem (inactiveOpacityEnumToQString (INACTIVE_OPACITY_64),
153 QVariant (INACTIVE_OPACITY_64));
154 m_cmbInactiveOpacity->addItem (inactiveOpacityEnumToQString (INACTIVE_OPACITY_96),
155 QVariant (INACTIVE_OPACITY_96));
156 m_cmbInactiveOpacity->addItem (inactiveOpacityEnumToQString (INACTIVE_OPACITY_128),
157 QVariant (INACTIVE_OPACITY_128));
158 m_cmbInactiveOpacity->addItem (inactiveOpacityEnumToQString (INACTIVE_OPACITY_160),
159 QVariant (INACTIVE_OPACITY_160));
160 m_cmbInactiveOpacity->addItem (inactiveOpacityEnumToQString (INACTIVE_OPACITY_192),
161 QVariant (INACTIVE_OPACITY_192));
162 m_cmbInactiveOpacity->addItem (inactiveOpacityEnumToQString (INACTIVE_OPACITY_224),
163 QVariant (INACTIVE_OPACITY_224));
164 m_cmbInactiveOpacity->addItem (inactiveOpacityEnumToQString (INACTIVE_OPACITY_256),
165 QVariant (INACTIVE_OPACITY_256));
166 connect (m_cmbInactiveOpacity, SIGNAL (activated (const QString &)),
167 this, SLOT (slotInactiveOpacity (const QString &))); // activated() ignores code changes
168 layout->addWidget (m_cmbInactiveOpacity, row++, 2);
169}
170
171void DlgSettingsSegments::createOptionalSaveDefault (QHBoxLayout * /* layout */)
172{
173}
174
175void DlgSettingsSegments::createPreview (QGridLayout *layout,
176 int &row)
177{
178 LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsSegments::createPreview";
179
180 QLabel *labelPreviewActive = new QLabel (tr ("Hover Preview"));
181 layout->addWidget (labelPreviewActive, row, 0, 1, 2);
182
183 QLabel *labelPreviewInactive = new QLabel (tr ("Inactive Preview"));
184 layout->addWidget (labelPreviewInactive, row++, 2, 1, 2);
185
186 m_scenePreviewActive = new QGraphicsScene (this);
187 m_viewPreviewActive = new ViewPreview (m_scenePreviewActive,
189 this);
190 m_viewPreviewActive->setWhatsThis (tr ("For segments under the cursor, this preview window shows the shortest "
191 "line that can be segment filled, "
192 "and the effects of current settings on segments and points generated by segment fill"));
193 m_viewPreviewActive->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
194 m_viewPreviewActive->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
195 m_viewPreviewActive->setMinimumHeight (MINIMUM_PREVIEW_HEIGHT);
196 layout->addWidget (m_viewPreviewActive, row, 0, 1, 2);
197
198 m_scenePreviewInactive = new QGraphicsScene (this);
199 m_viewPreviewInactive = new ViewPreview (m_scenePreviewInactive,
201 this);
202 m_viewPreviewInactive->setWhatsThis (tr ("For segments not under the cursor, this preview window shows the shortest "
203 "line that can be segment filled, "
204 "and the effects of current settings on segments and points generated by segment fill"));
205 m_viewPreviewInactive->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
206 m_viewPreviewInactive->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
207 m_viewPreviewInactive->setMinimumHeight (MINIMUM_PREVIEW_HEIGHT);
208 layout->addWidget (m_viewPreviewInactive, row++, 2, 1, 2);
209}
210
211QImage DlgSettingsSegments::createPreviewImage () const
212{
213 LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsSegments::createPreviewImage";
214
215 QImage image (IMAGE_WIDTH,
217 QImage::Format_RGB32);
218 image.fill (Qt::white);
219 QPainter painter (&image);
220 painter.setRenderHint(QPainter::Antialiasing);
221 painter.setPen (QPen (QBrush (Qt::black), BRUSH_WIDTH));
222
223 int margin = IMAGE_WIDTH / 15;
224 int yCenter = IMAGE_HEIGHT / 2;
225 int yHeight = IMAGE_HEIGHT / 4;
226 int x, y, xLast = 0, yLast = 0;
227 bool isFirst;
228
229 // Draw sinusoid
230 isFirst = true;
231 int xStart = margin, xEnd = IMAGE_WIDTH / 2 - margin;
232 for (x = xStart; x < xEnd; x++) {
233 double s = double (x - xStart) / double (xEnd - xStart);
234 int y = qFloor (yCenter - yHeight * qSin (2.0 * M_PI * s));
235
236 if (!isFirst) {
237 painter.drawLine (xLast, yLast, x, y);
238 }
239 isFirst = false;
240 xLast = x;
241 yLast = y;
242 }
243
244 // Draw triangular waveform that looks like sinusoid straightened up into line segments
245 isFirst = true;
246 xStart = IMAGE_WIDTH / 2 + margin;
247 xEnd = IMAGE_WIDTH - margin;
248 for (x = xStart; x < xEnd; x++) {
249 double s = double (x - xStart) / double (xEnd - xStart);
250 if (s <= 0.25) {
251 y = qFloor (yCenter - yHeight * (4.0 * s));
252 } else if (s < 0.75) {
253 y = qFloor (yCenter - yHeight * (1.0 - 4.0 * (s - 0.25)));
254 } else {
255 y = qFloor (yCenter + yHeight * (1.0 - 4 * (s - 0.75)));
256 }
257
258 if (!isFirst) {
259 painter.drawLine (xLast, yLast, x, y);
260 }
261 isFirst = false;
262 xLast = x;
263 yLast = y;
264 }
265
266 return image;
267}
268
270{
271 LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsSegments::createSubPanel";
272
273 QWidget *subPanel = new QWidget ();
274 QGridLayout *layout = new QGridLayout (subPanel);
275 subPanel->setLayout (layout);
276
277 layout->setColumnStretch (0, 1); // Empty first column
278 layout->setColumnStretch (1, 0); // Labels
279 layout->setColumnStretch (2, 0); // User controls
280 layout->setColumnStretch (3, 1); // Empty last column
281
282 int row = 0;
283 createWhatsThis (layout,
284 m_btnWhatsThis,
285 row++,
286 3);
287 createControls(layout, row);
288 createPreview (layout, row);
289 QPixmap pixmap = QPixmap::fromImage (createPreviewImage());
290 addPixmap (*m_scenePreviewActive,
291 pixmap);
292 pixmap = QPixmap::fromImage (createPreviewImage());
293 addPixmap (*m_scenePreviewInactive,
294 pixmap);
295
296 return subPanel;
297}
298
300{
301 LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsSegments::handleOk";
302
304 cmdMediator ().document(),
305 *m_modelSegmentsBefore,
306 *m_modelSegmentsAfter);
307 cmdMediator ().push (cmd);
308
309 hide ();
310}
311
313{
314 LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsSegments::load";
315
316 // Loading starts here
317 m_loading = true;
318
320
321 // Flush old data
322 delete m_modelSegmentsBefore;
323 delete m_modelSegmentsAfter;
324
325 // Save new data
326 m_modelSegmentsBefore = new DocumentModelSegments (cmdMediator.document());
327 m_modelSegmentsAfter = new DocumentModelSegments (cmdMediator.document());
328
329 // Sanity checks. Incoming defaults must be acceptable to the local limits
331 ENGAUGE_ASSERT (MIN_LENGTH_MAX >= m_modelSegmentsAfter->minLength ());
333 ENGAUGE_ASSERT (POINT_SEPARATION_MAX >= m_modelSegmentsAfter->pointSeparation());
334
335 // Populate controls
336 m_spinPointSeparation->setValue (qFloor (m_modelSegmentsAfter->pointSeparation()));
337 m_spinMinLength->setValue (qFloor (m_modelSegmentsAfter->minLength()));
338 m_chkFillCorners->setChecked (m_modelSegmentsAfter->fillCorners ());
339 m_spinLineWidthActive->setValue (qFloor (m_modelSegmentsAfter->lineWidthActive()));
340 m_spinLineWidthInactive->setValue (qFloor (m_modelSegmentsAfter->lineWidthInactive()));
341
342 int indexLineColor = m_cmbLineColor->findData(QVariant (m_modelSegmentsAfter->lineColor()));
343 ENGAUGE_ASSERT (indexLineColor >= 0);
344 m_cmbLineColor->setCurrentIndex(indexLineColor);
345
346 int indexInactiveOpacity = m_cmbInactiveOpacity->findData (QVariant (m_modelSegmentsAfter->inactiveOpacity()));
347 ENGAUGE_ASSERT (indexInactiveOpacity >= 0);
348 m_cmbInactiveOpacity->setCurrentIndex (indexInactiveOpacity);
349
350 // Loading finishes here
351 m_loading = false;
352
353 updateControls();
354 enableOk (false); // Disable Ok button since there not yet any changes
355 updatePreview();
356}
357
359{
360 if (!smallDialogs) {
361 setMinimumHeight (MINIMUM_HEIGHT);
362 }
363}
364
365void DlgSettingsSegments::slotFillCorners (int state)
366{
367 LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsSegments::slotFillCorner";
368
369 m_modelSegmentsAfter->setFillCorners(state == Qt::Checked);
370 updateControls();
371 updatePreview();
372}
373
374void DlgSettingsSegments::slotInactiveOpacity (const QString &)
375{
376 LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsSegments::slotInactiveOpacity";
377
378 InactiveOpacity inactiveOpacity = static_cast<InactiveOpacity> (m_cmbInactiveOpacity->currentData().toInt());
379 m_modelSegmentsAfter->setInactiveOpacity(inactiveOpacity);
380 updateControls();
381 updatePreview();
382}
383
384void DlgSettingsSegments::slotLineColor (const QString &)
385{
386 LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsSegments::slotLineColor";
387
388 m_modelSegmentsAfter->setLineColor(static_cast<ColorPalette> (m_cmbLineColor->currentData().toInt()));
389 updateControls();
390 updatePreview();
391}
392
393void DlgSettingsSegments::slotLineWidthActive (int lineWidthActive)
394{
395 LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsSegments::slotLineWidthActive";
396
397 m_modelSegmentsAfter->setLineWidthActive(lineWidthActive);
398 updateControls();
399 updatePreview();
400}
401
402void DlgSettingsSegments::slotLineWidthInactive (int lineWidthInactive)
403{
404 LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsSegments::slotLineWidthInactive";
405
406 m_modelSegmentsAfter->setLineWidthInactive(lineWidthInactive);
407 updateControls();
408 updatePreview();
409}
410
411void DlgSettingsSegments::slotMinLength (const QString &minLength)
412{
413 LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsSegments::slotMinLength";
414
415 m_modelSegmentsAfter->setMinLength(minLength.toDouble());
416 updateControls();
417 updatePreview();
418}
419
420void DlgSettingsSegments::slotPointSeparation (const QString &pointSeparation)
421{
422 LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsSegments::slotPointSeparation";
423
424 m_modelSegmentsAfter->setPointSeparation(pointSeparation.toDouble());
425 updateControls();
426 updatePreview();
427}
428
429void DlgSettingsSegments::slotWhatsThis ()
430{
431 QWhatsThis::enterWhatsThisMode();
432}
433
434void DlgSettingsSegments::updateControls()
435{
436 enableOk (true);
437}
438
439void DlgSettingsSegments::updatePreview()
440{
441 LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsSegments::updatePreview"
442 << " loading=" << (m_loading ? "true" : "false");
443
444 updatePreviewOneScene (m_scenePreviewActive,
445 m_segmentsActive,
446 m_pointsActive,
447 HOVER_ACTIVE);
448 updatePreviewOneScene (m_scenePreviewInactive,
449 m_segmentsInactive,
450 m_pointsInactive,
451 HOVER_INACTIVE);
452}
453
454void DlgSettingsSegments::updatePreviewOneScene (QGraphicsScene *scenePreview,
455 QList<Segment*> &segments,
456 GraphicsPoints &points,
457 HoverState hoverState)
458{
459 const QString ARBITRARY_IDENTIFIER ("");
460 const QColor COLOR (Qt::blue);
461 const int RADIUS = 5;
462 GeometryWindow *NULL_GEOMETRY_WINDOW = nullptr;
463 const bool NO_DIALOG = false; // If true then dueling modal dialogs will trigger infinite loops in QSpinBox up/down
464
465 if (!m_loading) {
466
467 SegmentFactory segmentFactory (*scenePreview,
468 mainWindow().isGnuplot());
469
470 clearPointsOneScene (points);
471 segmentFactory.clearSegments (segments);
472
473 // Create new segments
474 segmentFactory.makeSegments (createPreviewImage(),
475 *m_modelSegmentsAfter,
476 segments,
477 NO_DIALOG);
478
479 // Make the segment visible
480 QList<Segment*>::iterator itrS;
481 for (itrS = segments.begin(); itrS != segments.end(); itrS++) {
482 Segment *segment = *itrS;
483
484 segment->slotHover (hoverState == HOVER_ACTIVE);
485 segment->lockHoverState ();
486 }
487
488 // Create some points
489 PointStyle pointStyle (POINT_SHAPE_CROSS,
490 RADIUS,
491 qFloor (BRUSH_WIDTH),
493 QPolygonF polygon = pointStyle.polygon();
494 QList<QPoint> pointsFill = segmentFactory.fillPoints (*m_modelSegmentsAfter,
495 segments);
496
497 QList<QPoint>::iterator itrP;
498 for (itrP = pointsFill.begin(); itrP != pointsFill.end(); itrP++) {
499 QPoint pos = *itrP;
500 GraphicsPoint *graphicsPoint = new GraphicsPoint (*scenePreview,
501 ARBITRARY_IDENTIFIER,
502 pos,
503 COLOR,
504 polygon,
506 NULL_GEOMETRY_WINDOW);
507
508 points.push_back (graphicsPoint);
509 }
510 }
511}
ColorPalette
@ COLOR_PALETTE_BLUE
const int MINIMUM_HEIGHT
const int IMAGE_WIDTH
const int IMAGE_HEIGHT
const int MIN_LENGTH_MAX
const int POINT_SEPARATION_MIN
const int POINT_SEPARATION_MAX
const double BRUSH_WIDTH
const int MIN_LENGTH_MIN
QList< GraphicsPoint * > GraphicsPoints
#define ENGAUGE_ASSERT(cond)
Drop in replacement for Q_ASSERT.
QString inactiveOpacityEnumToQString(InactiveOpacity inactiveOpacity)
Map InactiveOpacity enum to corresponding string value.
InactiveOpacity
Enum for opacity/alpha values used for segments that are not currently under hover.
@ INACTIVE_OPACITY_64
@ INACTIVE_OPACITY_96
@ INACTIVE_OPACITY_256
@ INACTIVE_OPACITY_160
@ INACTIVE_OPACITY_0
@ INACTIVE_OPACITY_32
@ INACTIVE_OPACITY_192
@ INACTIVE_OPACITY_224
@ INACTIVE_OPACITY_128
log4cpp::Category * mainCat
Definition Logger.cpp:14
@ POINT_SHAPE_CROSS
Definition PointShape.h:14
Command queue stack.
Definition CmdMediator.h:24
Command for DlgSettingsSegments.
DlgSettingsAbstractBase(const QString &title, const QString &dialogName, MainWindow &mainWindow)
Single constructor.
void setCmdMediator(CmdMediator &cmdMediator)
Store CmdMediator for easy access by the leaf class.
void finishPanel(QWidget *subPanel, int minimumWidth=MINIMUM_DIALOG_WIDTH, int minimumHeightOrZero=0)
Add Ok and Cancel buttons to subpanel to get the whole dialog.
void populateColorComboWithTransparent(QComboBox &combo)
Add colors in color palette to combobox, with transparent entry at end.
CmdMediator & cmdMediator()
Provide access to Document information wrapped inside CmdMediator.
void createWhatsThis(QGridLayout *layout, ButtonWhatsThis *button, int row, int column)
Create a WhatsThis button in a grid layout.
void addPixmap(QGraphicsScene &scene, const QPixmap &pixmap)
Adds pixmap to the scene.
void enableOk(bool enable)
Let leaf subclass control the Ok button.
static int MINIMUM_PREVIEW_HEIGHT
Dialog layout constant that guarantees preview has sufficent room.
MainWindow & mainWindow()
Get method for MainWindow.
virtual void handleOk()
Process slotOk.
virtual void load(CmdMediator &cmdMediator)
Load settings from Document.
virtual QWidget * createSubPanel()
Create dialog-specific panel to which base class will add Ok and Cancel buttons.
virtual void createOptionalSaveDefault(QHBoxLayout *layout)
Let subclass define an optional Save As Default button.
DlgSettingsSegments(MainWindow &mainWindow)
Single constructor.
virtual void setSmallDialogs(bool smallDialogs)
If false then dialogs have a minimum size so all controls are visible.
Model for DlgSettingsSegments and CmdSettingsSegments.
void setFillCorners(bool fillCorners)
Set method for fill corners.
Graphics item for drawing a circular or polygonal Point.
Main window consisting of menu, graphics scene, status bar and optional toolbars as a Single Document...
Definition MainWindow.h:95
void lockHoverState()
Disable hover events. This is used only by DlgSettingsSegments to stop hover events in the preview wi...
Definition Segment.cpp:386
void slotHover(bool hover)
Slot for hover enter/leave events in the associated SegmentLines.
Definition Segment.cpp:539
Class that modifies QGraphicsView to automatically expand/shrink the view to fit the window,...
Definition ViewPreview.h:15
@ VIEW_ASPECT_RATIO_VARIABLE
Definition ViewPreview.h:22
#define LOG4CPP_INFO_S(logger)
Definition convenience.h:18