summaryrefslogtreecommitdiff
path: root/tools/build/example/qt/qt3/hello/main.cpp
blob: 8f1ffc2fbab612cfb747873ad54f3dd90985cfa8 (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
// Copyright Vladimir Prus 2004.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt
// or copy at http://www.boost.org/LICENSE_1_0.txt)

#include "canvas.h"
#include <qapplication.h>
#include <qvbox.h>
#include <qpushbutton.h>

class Window : public QMainWindow
{
public:
    Window()
    {
        setCaption("QCanvas test");
        QVBox* vb = new QVBox(this);
        setCentralWidget(vb);   
    
        Canvas* c = new Canvas(vb); 
        QPushButton* b = new QPushButton("Change color", vb);
        connect(b, SIGNAL(clicked()), c, SLOT(change_color())); 
    }        
};

int main(int argc, char **argv)
{
    QApplication app(argc, argv);
    Window *w = new Window();

    app.setMainWidget(w);
    w->show();
    
    return app.exec();
}