Engauge Digitizer 2
Loading...
Searching...
No Matches
ChecklistGuidePage Class Reference

This class customizes QWizardPage for ChecklistGuideWizard. More...

#include <ChecklistGuidePage.h>

Inheritance diagram for ChecklistGuidePage:
Inheritance graph
Collaboration diagram for ChecklistGuidePage:
Collaboration graph

Public Member Functions

 ChecklistGuidePage (const QString &title)
 Single constructor.
void addHtml (const QString &html)
 Insert html for display.
QRadioButton * addLabelAndRadioButton (const QString &label, const QString &whatsThis)
 Insert radio button and corresponding label.
void addLineEdit (ChecklistLineEdit *edit, const QString &whatsThis)
 Insert line edit.

Detailed Description

This class customizes QWizardPage for ChecklistGuideWizard.

Definition at line 19 of file ChecklistGuidePage.h.

Constructor & Destructor Documentation

◆ ChecklistGuidePage()

ChecklistGuidePage::ChecklistGuidePage ( const QString & title)

Single constructor.

Definition at line 16 of file ChecklistGuidePage.cpp.

16 :
17 m_row (0),
18 m_checklineLineEditContainer (nullptr),
19 m_checklineLineEditLayout (nullptr)
20{
21 setTitle (title);
22
23 m_layout = new QGridLayout;
24 m_layout->setColumnStretch (0, 0);
25 m_layout->setColumnStretch (1, 1);
26 setLayout (m_layout);
27}

Member Function Documentation

◆ addHtml()

void ChecklistGuidePage::addHtml ( const QString & html)

Insert html for display.

Definition at line 29 of file ChecklistGuidePage.cpp.

30{
31 LOG4CPP_INFO_S ((*mainCat)) << "ChecklistGuidePage::addHtml";
32
33 QLabel *label = new QLabel (html);
34 label->setWordWrap (true);
35
36 m_layout->addWidget (label, m_row++, 0, 1, 2, Qt::AlignTop);
37}
log4cpp::Category * mainCat
Definition Logger.cpp:14
#define LOG4CPP_INFO_S(logger)
Definition convenience.h:18

◆ addLabelAndRadioButton()

QRadioButton * ChecklistGuidePage::addLabelAndRadioButton ( const QString & label,
const QString & whatsThis )

Insert radio button and corresponding label.

Definition at line 39 of file ChecklistGuidePage.cpp.

41{
42 LOG4CPP_INFO_S ((*mainCat)) << "ChecklistGuidePage::addLabelAndRadioButton";
43
44 QRadioButton *button = new QRadioButton;
45 button->setWhatsThis (whatsThis);
46 m_layout->addWidget (button, m_row, 0, 1, 1, Qt::AlignTop);
47
48 QLabel *lbl = new QLabel (label);
49 lbl->setWordWrap(true);
50 m_layout->addWidget (lbl, m_row++, 1, 1, 1, Qt::AlignTop);
51
52 return button;
53}

◆ addLineEdit()

void ChecklistGuidePage::addLineEdit ( ChecklistLineEdit * edit,
const QString & whatsThis )

Insert line edit.

Definition at line 55 of file ChecklistGuidePage.cpp.

57{
58 LOG4CPP_INFO_S ((*mainCat)) << "ChecklistGuidePage::addLineEdit";
59
60 bool isFirst = false;
61
62 if (m_checklineLineEditContainer == nullptr) {
63
64 isFirst = true;
65
66 // This is the first ChecklistLineEdit, so we create a container for it and any more that get added
67 m_checklineLineEditLayout = new QVBoxLayout;
68 m_checklineLineEditLayout->setSpacing (0); // This is the whole reason we wrap the ChecklineLineEdits in a container
69
70 m_checklineLineEditContainer = new QWidget;
71 m_checklineLineEditContainer->setLayout (m_checklineLineEditLayout);
72 m_layout->addWidget (m_checklineLineEditContainer, m_row++, 0, 1, 2, Qt::AlignTop);
73 }
74
75 edit->setWhatsThis (whatsThis);
76 m_checklineLineEditLayout->addWidget (edit);
77
78 // Windows border is missing on left side so border is made complete here
79 QString style = QString ("QLineEdit { "
80 "border-left : 1px solid gray; "
81 "border-right: 1px solid gray; "
82 "border-top: %1px solid gray; "
83 "border-bottom:1px solid gray; }")
84 .arg (isFirst ? 1 : 0);
85 edit->setStyleSheet (style);
86}

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