1 #include <QGraphicsPixmapItem>
2 #include <QGraphicsScene>
3 #include <QGraphicsTextItem>
4 #include "TutorialDlg.h"
5 #include "TutorialStateAbstractBase.h"
6 #include "TutorialStateContext.h"
8 const int DELTA_FONT_SIZE = 2;
9 const int TITLE_PADDING = 5;
10 const double Z_TITLE = 2.0;
17 TutorialStateAbstractBase::~TutorialStateAbstractBase()
34 QGraphicsPixmapItem *item =
new QGraphicsPixmapItem (QPixmap (resource));
44 QGraphicsTextItem *item =
new QGraphicsTextItem (text);
55 QGraphicsTextItem *item =
new QGraphicsTextItem (text);
56 item->setZValue(Z_TITLE);
57 item->setPos (backgroundSize.width() / 2.0 - item->boundingRect().width() / 2.0,
62 QFont font = item->font();
int buttonMargin() const
Buttons are placed up against bottom side, and left or right side, separated by this margin...
QGraphicsScene & scene()
Single scene the covers the entire tutorial dialog.
TutorialStateContext & context()
Context class for the tutorial state machine.
QGraphicsTextItem * createTextItem(const QString &text, const QPoint &pos)
Factory method for text items.
QSize backgroundSize() const
Make geometry available for layout.
QGraphicsTextItem * createTitle(const QString &text)
Factory method for title items.
QGraphicsPixmapItem * createPixmapItem(const QString &resource, const QPoint &pos)
Factory method for pixmap items.
Context class for tutorial state machine.
TutorialStateAbstractBase(TutorialStateContext &context)
Single constructor.
TutorialDlg & tutorialDlg()
Access to tutorial dialogs and its scene.