Engauge Digitizer
2
Toggle main menu visibility
Loading...
Searching...
No Matches
Tutorial
TutorialStateChecklistWizardAbstract.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 "
Logger.h
"
8
#include <qdebug.h>
9
#include <QGraphicsPixmapItem>
10
#include <QGraphicsScene>
11
#include <QGraphicsView>
12
#include "
TutorialButton.h
"
13
#include "
TutorialDlg.h
"
14
#include "
TutorialStateChecklistWizardAbstract.h
"
15
#include "
TutorialStateContext.h
"
16
17
TutorialStateChecklistWizardAbstract::TutorialStateChecklistWizardAbstract
(
TutorialStateContext
&
context
) :
18
TutorialStateAbstractBase
(
context
),
19
m_title (nullptr),
20
m_background (nullptr),
21
m_text0 (nullptr),
22
m_text1 (nullptr),
23
m_text2 (nullptr),
24
m_text3 (nullptr),
25
m_previous (nullptr)
26
{
27
}
28
29
void
TutorialStateChecklistWizardAbstract::begin
()
30
{
31
qCInfo(ENGAUGE_LOG) <<
"TutorialStateChecklistWizardAbstract::begin ()"
;
32
33
context
().
tutorialDlg
().
scene
().clear ();
34
35
m_title =
createTitle
(tr (
"Checklist Wizard and Checklist Guide"
));
36
m_background =
createPixmapItem
(
":/engauge/img/panel_checklist.png"
,
37
QPoint (0, 30));
38
m_text0 =
createTextItem
(tr (
"For new Engauge users, a Checklist Wizard\n"
39
"is available when importing an image file.\n"
40
"This wizard produces a helpful checklist of\n"
41
"steps to follow to digitize the image file."
),
42
QPoint (260, 30));
43
m_text1 =
createTextItem
(tr (
"Step 1 - Enable the menu option Help /\n"
44
"Checklist Guide Wizard."
),
45
QPoint (285, 125));
46
m_text2 =
createTextItem
(tr (
"Step 2 - Import the file using File /\n"
47
"Import. The Checklist Wizard will appear\n"
48
"and ask some simple questions to\n"
49
"determine how the image can be\n"
50
"digitized."
),
51
QPoint (285, 175));
52
m_text3 =
createTextItem
(tr (
"Additional options are available in\n"
53
"the various Settings menus.\n\n"
54
"This ends the tutorial. Good luck!"
),
55
QPoint (285, 270));
56
57
QSize backgroundSize =
context
().
tutorialDlg
().
backgroundSize
();
58
59
m_previous =
new
TutorialButton
(tr (
"Previous"
),
60
context
().tutorialDlg().scene());
61
m_previous->setGeometry (QPoint (
buttonMargin
(),
62
backgroundSize.height () -
buttonMargin
() - m_previous->size().height()));
63
}
64
65
void
TutorialStateChecklistWizardAbstract::end
()
66
{
67
qCInfo(ENGAUGE_LOG) <<
"TutorialStateChecklistWizardAbstract::end ()"
;
68
69
// It is not safe to remove and deallocate items here since an active TutorialButton
70
// may be on the stack. So we clear the scene as the first step in the next begin()
71
}
72
73
TutorialButton
*
TutorialStateChecklistWizardAbstract::previous
()
74
{
75
return
m_previous;
76
}
Logger.h
TutorialButton.h
TutorialDlg.h
TutorialStateChecklistWizardAbstract.h
TutorialStateContext.h
TutorialButton
Show a button with text for clicking ion. The button is implemented using layering of two graphics it...
Definition
TutorialButton.h:21
TutorialDlg::scene
QGraphicsScene & scene()
Single scene the covers the entire tutorial dialog.
Definition
TutorialDlg.cpp:76
TutorialDlg::backgroundSize
QSize backgroundSize() const
Make geometry available for layout.
Definition
TutorialDlg.cpp:44
TutorialStateAbstractBase::TutorialStateAbstractBase
TutorialStateAbstractBase(TutorialStateContext &context)
Single constructor.
Definition
TutorialStateAbstractBase.cpp:18
TutorialStateAbstractBase::createTitle
QGraphicsTextItem * createTitle(const QString &text)
Factory method for title items.
Definition
TutorialStateAbstractBase.cpp:57
TutorialStateAbstractBase::createTextItem
QGraphicsTextItem * createTextItem(const QString &text, const QPoint &pos)
Factory method for text items.
Definition
TutorialStateAbstractBase.cpp:47
TutorialStateAbstractBase::context
TutorialStateContext & context()
Context class for the tutorial state machine.
Definition
TutorialStateAbstractBase.cpp:32
TutorialStateAbstractBase::createPixmapItem
QGraphicsPixmapItem * createPixmapItem(const QString &resource, const QPoint &pos)
Factory method for pixmap items.
Definition
TutorialStateAbstractBase.cpp:37
TutorialStateAbstractBase::buttonMargin
int buttonMargin() const
Buttons are placed up against bottom side, and left or right side, separated by this margin.
Definition
TutorialStateAbstractBase.cpp:27
TutorialStateChecklistWizardAbstract::TutorialStateChecklistWizardAbstract
TutorialStateChecklistWizardAbstract(TutorialStateContext &context)
Single constructor.
Definition
TutorialStateChecklistWizardAbstract.cpp:17
TutorialStateChecklistWizardAbstract::end
void end()
Common end processing.
Definition
TutorialStateChecklistWizardAbstract.cpp:65
TutorialStateChecklistWizardAbstract::previous
TutorialButton * previous()
Previous button for hooking up button to slot.
Definition
TutorialStateChecklistWizardAbstract.cpp:73
TutorialStateChecklistWizardAbstract::begin
void begin()
Common begin processing.
Definition
TutorialStateChecklistWizardAbstract.cpp:29
TutorialStateContext
Context class for tutorial state machine.
Definition
TutorialStateContext.h:21
TutorialStateContext::tutorialDlg
TutorialDlg & tutorialDlg()
Access to tutorial dialogs and its scene.
Definition
TutorialStateContext.cpp:109
Generated on
for Engauge Digitizer by
1.17.0