Engauge Digitizer  2
TutorialButton.h
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 
12 class QGraphicsRectItem;
13 class QGraphicsScene;
14 class QGraphicsTextItem;
15 class QString;
16 class TutorialButtonRect;
17 class TutorialButtonText;
18 
20 class TutorialButton : public QObject
21 {
22  Q_OBJECT;
23 
24  public:
26  TutorialButton(const QString &text,
27  QGraphicsScene &scene);
28  ~TutorialButton();
29 
31  void handleTriggered();
32 
34  void setGeometry (const QPoint &pos);
35 
37  QSize size () const;
38 
39  signals:
41  void signalTriggered ();
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
QSize size() const
Size of this button.
void setGeometry(const QPoint &pos)
Set the position. This is called after creation so screen extent is available for positioning calcula...
void signalTriggered()
Signal that button was triggered.
Show a button with text for clicking ion. The button is implemented using layering of two graphics it...
This class customizes QGraphicsTextItem so it performs a callback after a mouse event.
This class customizes QGraphicsRectItem so it performs a callback after a mouse event.
void handleTriggered()
Callback to be called when button was triggered by mouse event.