Engauge Digitizer  2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Slots | Public Member Functions | List of all members
ChecklistGuidePageCurves Class Reference

This class adds validation to the Curves page. More...

#include <ChecklistGuidePageCurves.h>

Inheritance diagram for ChecklistGuidePageCurves:
Inheritance graph
Collaboration diagram for ChecklistGuidePageCurves:
Collaboration graph

Public Slots

void slotTableChanged ()
 Update after curve table update. More...
 
bool withLines () const
 Drawn with lines, else points. More...
 

Public Member Functions

 ChecklistGuidePageCurves (const QString &title)
 Single constructor. More...
 
QStringList curveNames () const
 Wizard selection for curve names. More...
 
virtual bool isComplete () const
 Validate the contents of this page. More...
 
- Public Member Functions inherited from ChecklistGuidePage
 ChecklistGuidePage (const QString &title)
 Single constructor. More...
 
void addHtml (const QString &html)
 Insert html for display. More...
 
QRadioButton * addLabelAndRadioButton (const QString &label, const QString &whatsThis)
 Insert radio button and corresponding label. More...
 
void addLineEdit (ChecklistLineEdit *edit, const QString &whatsThis)
 Insert line edit. More...
 

Detailed Description

This class adds validation to the Curves page.

Definition at line 17 of file ChecklistGuidePageCurves.h.

Constructor & Destructor Documentation

ChecklistGuidePageCurves::ChecklistGuidePageCurves ( const QString &  title)

Single constructor.

Definition at line 16 of file ChecklistGuidePageCurves.cpp.

16  :
17  ChecklistGuidePage (title)
18 {
19  LOG4CPP_INFO_S ((*mainCat)) << "ChecklistGuidePageCurves::ChecklistGuidePageCurves";
20 
21  const QString WHATS_THIS_CURVE (tr ("Curve name. Empty if unused."));
22  const QString WHATS_THIS_LINES (tr ("Draw lines between points in each curve."));
23  const QString WHATS_THIS_POINTS (tr ("Draw points in each curve, without lines between the points."));
24 
25  addHtml (QString ("<p>%1</p>")
26  .arg (tr ("What are the names of the curves that are to be digitized? At least one entry is required.")));
27 
28  m_edit = new ChecklistLineEdit* [unsigned (NUM_CURVE_NAMES())];
29 
30  for (int i = 0; i < NUM_CURVE_NAMES(); i++) {
31  m_edit [i] = new ChecklistLineEdit;
32  connect (m_edit [i], SIGNAL (signalKeyRelease()), this, SLOT (slotTableChanged()));
33  addLineEdit (m_edit [i],
34  WHATS_THIS_CURVE);
35  }
36 
37  SettingsForGraph settingsForGraph;
38  QString curveName = settingsForGraph.defaultCurveName (1,
40 
41  m_edit [0]->setText (curveName);
42 
43  addHtml ("<p>&nbsp;</p>");
44 
45  addHtml (QString ("<p>%1</p>")
46  .arg (tr ("How are those curves drawn?")));
47 
48  m_btnLines = addLabelAndRadioButton (tr ("With lines (with or without points)"),
49  WHATS_THIS_LINES);
50  m_btnPoints = addLabelAndRadioButton (tr ("With points only (no lines between points)"),
51  WHATS_THIS_POINTS);
52 
53  m_btnLines->setChecked (true); // Default encourages digitizing using the lines, since that is easier
54 }
Manage storage and retrieval of the settings for the curves.
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
QString defaultCurveName(int indexOneBased, const QString &defaultName) const
Default graph name for the specified curve index.
This class customizes QWizardPage for ChecklistGuideWizard.
void addLineEdit(ChecklistLineEdit *edit, const QString &whatsThis)
Insert line edit.
QRadioButton * addLabelAndRadioButton(const QString &label, const QString &whatsThis)
Insert radio button and corresponding label.
log4cpp::Category * mainCat
Definition: Logger.cpp:14
const QString DEFAULT_GRAPH_CURVE_NAME
void addHtml(const QString &html)
Insert html for display.
Adds key event handling to QLineEdit.
void slotTableChanged()
Update after curve table update.

Member Function Documentation

QStringList ChecklistGuidePageCurves::curveNames ( ) const

Wizard selection for curve names.

Definition at line 56 of file ChecklistGuidePageCurves.cpp.

57 {
58  QStringList curveNames;
59 
60  for (int i = 0; i < NUM_CURVE_NAMES(); i++) {
61  const QLineEdit *edit = m_edit [i];
62  QString text = edit->text();
63  if (!text.isEmpty()) {
64  curveNames << text;
65  }
66  }
67 
68  return curveNames;
69 }
QStringList curveNames() const
Wizard selection for curve names.
bool ChecklistGuidePageCurves::isComplete ( ) const
virtual

Validate the contents of this page.

Definition at line 82 of file ChecklistGuidePageCurves.cpp.

83 {
84  LOG4CPP_INFO_S ((*mainCat)) << "ChecklistGuidePageCurves::isComplete";
85 
86  return !curveNames().isEmpty () &&
87  curveNamesAreAllUnique ();
88 }
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
log4cpp::Category * mainCat
Definition: Logger.cpp:14
QStringList curveNames() const
Wizard selection for curve names.
void ChecklistGuidePageCurves::slotTableChanged ( )
slot

Update after curve table update.

Definition at line 90 of file ChecklistGuidePageCurves.cpp.

91 {
92  LOG4CPP_INFO_S ((*mainCat)) << "ChecklistGuidePageCurves::slotTableChanged";
93 
94  emit completeChanged();
95 }
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
log4cpp::Category * mainCat
Definition: Logger.cpp:14
bool ChecklistGuidePageCurves::withLines ( ) const
slot

Drawn with lines, else points.

Definition at line 97 of file ChecklistGuidePageCurves.cpp.

98 {
99  return m_btnLines->isChecked();
100 }

The documentation for this class was generated from the following files: