Engauge Digitizer 2
Loading...
Searching...
No Matches
TutorialStateAbstractBase Class Referenceabstract

One state manages one panel of the tutorial. More...

#include <TutorialStateAbstractBase.h>

Inheritance diagram for TutorialStateAbstractBase:
Inheritance graph
Collaboration diagram for TutorialStateAbstractBase:
Collaboration graph

Public Member Functions

 TutorialStateAbstractBase (TutorialStateContext &context)
 Single constructor.
virtual ~TutorialStateAbstractBase ()
virtual void begin ()=0
 Transition into this state.
virtual void end ()=0
 Transition out of this state.

Protected Member Functions

int buttonMargin () const
 Buttons are placed up against bottom side, and left or right side, separated by this margin.
TutorialStateContextcontext ()
 Context class for the tutorial state machine.
QGraphicsPixmapItem * createPixmapItem (const QString &resource, const QPoint &pos)
 Factory method for pixmap items.
QGraphicsTextItem * createTextItem (const QString &text, const QPoint &pos)
 Factory method for text items.
QGraphicsTextItem * createTitle (const QString &text)
 Factory method for title items.

Detailed Description

One state manages one panel of the tutorial.

Definition at line 30 of file TutorialStateAbstractBase.h.

Constructor & Destructor Documentation

◆ TutorialStateAbstractBase()

TutorialStateAbstractBase::TutorialStateAbstractBase ( TutorialStateContext & context)

Single constructor.

Definition at line 18 of file TutorialStateAbstractBase.cpp.

18 :
19 m_context (context)
20{
21}
TutorialStateContext & context()
Context class for the tutorial state machine.

◆ ~TutorialStateAbstractBase()

TutorialStateAbstractBase::~TutorialStateAbstractBase ( )
virtual

Definition at line 23 of file TutorialStateAbstractBase.cpp.

24{
25}

Member Function Documentation

◆ begin()

◆ buttonMargin()

int TutorialStateAbstractBase::buttonMargin ( ) const
protected

Buttons are placed up against bottom side, and left or right side, separated by this margin.

Definition at line 27 of file TutorialStateAbstractBase.cpp.

28{
29 return 10;
30}

◆ context()

TutorialStateContext & TutorialStateAbstractBase::context ( )
protected

Context class for the tutorial state machine.

Definition at line 32 of file TutorialStateAbstractBase.cpp.

33{
34 return m_context;
35}

◆ createPixmapItem()

QGraphicsPixmapItem * TutorialStateAbstractBase::createPixmapItem ( const QString & resource,
const QPoint & pos )
protected

Factory method for pixmap items.

Definition at line 37 of file TutorialStateAbstractBase.cpp.

39{
40 QGraphicsPixmapItem *item = new QGraphicsPixmapItem (QPixmap (resource));
41 item->setPos (pos);
42 context().tutorialDlg().scene().addItem (item);
43
44 return item;
45}
QGraphicsScene & scene()
Single scene the covers the entire tutorial dialog.
TutorialDlg & tutorialDlg()
Access to tutorial dialogs and its scene.

◆ createTextItem()

QGraphicsTextItem * TutorialStateAbstractBase::createTextItem ( const QString & text,
const QPoint & pos )
protected

Factory method for text items.

Definition at line 47 of file TutorialStateAbstractBase.cpp.

49{
50 QGraphicsTextItem *item = new QGraphicsTextItem (text);
51 item->setPos (pos);
52 context().tutorialDlg().scene().addItem (item);
53
54 return item;
55}

◆ createTitle()

QGraphicsTextItem * TutorialStateAbstractBase::createTitle ( const QString & text)
protected

Factory method for title items.

Definition at line 57 of file TutorialStateAbstractBase.cpp.

58{
59 QSize backgroundSize = context().tutorialDlg().backgroundSize();
60
61 QGraphicsTextItem *item = new QGraphicsTextItem (text);
62 item->setZValue(Z_TITLE);
63 item->setPos (backgroundSize.width() / 2.0 - item->boundingRect().width() / 2.0,
65 context().tutorialDlg().scene().addItem (item);
66
67 // Highlight the text
68 QFont font = item->font();
69 font.setBold (true);
70// font.setPixelSize (font.pixelSize() + DELTA_FONT_SIZE);
71 item->setFont (font);
72 return item;
73}
const double Z_TITLE
const int TITLE_PADDING
QSize backgroundSize() const
Make geometry available for layout.

◆ end()


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