summaryrefslogtreecommitdiff
path: root/examples/simple-icon/simple.h
blob: 00965cd9507b54ff49945733396f4b63016f87a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58

/*
 * A Simple widget with a button to quit
 * and Pixmaps and Sound
 */

/*
 * The below sequence is called a guard and guards
 * against multiple inclusion of header files
 */
#ifndef QUIET_SIMPLE_DEMO_H
#define QUIET_SIMPLE_DEMO_H




#include <qwidget.h>  // from this class we will inherit

class QPushButton; // forward declaration to not include the header. This can save time when compiling


/*
 * Simple inherits from QWidget
 * Remeber each example is based on the other
 */
class Simple : public QWidget {
    Q_OBJECT
public:
    /*
     * C'tor for the Simple
     * make sure to always have these three when you use
     * the quicklaunch factory ( explained in the implementation )
     */
    Simple( QWidget* parent = 0, const char * name = 0,  WFlags fl = 0 );
    ~Simple();

    /*
     * appName is used by the Application factory.
     * make sure the name matches the one of the executable
     */
    static QString appName() { return QString::fromLatin1("simple-icon"); }

    /*
     * use private slots: to mark your slots as such
     * A slot can also be called as a normal method
     */
private slots:
    void slotQuit();

private:
    /* my variable */
    QPushButton* m_button;
};




#endif