Engauge Digitizer 2
Loading...
Searching...
No Matches
TutorialButton.h
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#ifndef TUTORIAL_BUTTON_H
8#define TUTORIAL_BUTTON_H
9
10#include <QObject>
11
12class QGraphicsRectItem;
13class QGraphicsScene;
14class QGraphicsTextItem;
15class QString;
18
20class TutorialButton : public QObject
21{
22 Q_OBJECT;
23
24 public:
26 TutorialButton(const QString &text,
27 QGraphicsScene &scene);
29
31 void handleTriggered();
32
34 void setGeometry (const QPoint &pos);
35
37 QSize size () const;
38
39 signals:
42
43 private:
45
46 void createRect (QGraphicsScene &scene);
47 void createText (const QString &text);
48
49 TutorialButtonRect *m_rect;
50 TutorialButtonText *m_text; // Child to rectangle
51};
52
53#endif // TUTORIAL_BUTTON_H
This class customizes QGraphicsRectItem so it performs a callback after a mouse event.
This class customizes QGraphicsTextItem so it performs a callback after a mouse event.
void signalTriggered()
Signal that button was triggered.
QSize size() const
Size of this button.
void handleTriggered()
Callback to be called when button was triggered by mouse event.
TutorialButton(const QString &text, QGraphicsScene &scene)
Single constructor. Position is set after creation using setGeometry.
void setGeometry(const QPoint &pos)
Set the position. This is called after creation so screen extent is available for positioning calcula...