0029470: Samples - eliminate references to deprecated Local Context from MFC sample
[occt.git] / samples / qt / FuncDemo / src / mainwindow.h
CommitLineData
aff5997d 1/****************************************************************************
2**
3** Copyright (C) 2004-2007 Trolltech ASA. All rights reserved.
4**
5** This file is part of the example classes of the Qt Toolkit.
6**
7** Licensees holding a valid Qt License Agreement may use this file in
8** accordance with the rights, responsibilities and obligations
9** contained therein. Please consult your licensing agreement or
10** contact sales@trolltech.com if any conditions of this licensing
11** agreement are not clear to you.
12**
13** Further information about Qt licensing is available at:
14** http://www.trolltech.com/products/qt/licensing.html or by
15** contacting info@trolltech.com.
16**
17** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
18** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
19**
20****************************************************************************/
21
22#ifndef MAINWINDOW_H
23#define MAINWINDOW_H
24
25#include <QMainWindow>
26#include <AppStd_Application.hxx>
27
28class QAction;
29class QMenu;
30class GraphWidget;
31
32static Handle(AppStd_Application) gApplication;
33
34class MainWindow : public QMainWindow
35{
36 Q_OBJECT
37
38public:
39 MainWindow();
40
41 static Handle(AppStd_Application) getApplication();
42
43protected:
44 void closeEvent(QCloseEvent *event);
45
46private slots:
47 void model1();
48 void model2();
49 void compute();
50 void nbThreads();
51 void about();
52
53private:
54 void createActions();
55 void createMenus();
56 void createToolBars();
57 void createStatusBar();
58
59 GraphWidget* graph;
60
61 QMenu *computeMenu;
62 QMenu *helpMenu;
63 QToolBar *computeToolBar;
64 QAction *model1Act;
65 QAction *model2Act;
66 QAction *computeAct;
67 QAction *nbThreadsAct;
68 QAction *exitAct;
69 QAction *aboutAct;
70
71 // Default models.
72 // The Model 1 consists of a set of simple functions
73 // of the same type.
74 // These functions have a double parameter: relative time of execution, and
75 // a "forced" parameter: another function.
76 // Actually, the functions are independent,
77 // but we "force" a dependency between them to test the Function Mechanism using simple functions.
78 // So, a function uses a double parameter and produces nothing.
79 // I use a TDF_Reference to refer from a function to another function.
80 // This way I define a dependency.
81 void createDefaultModel1();
82
83 // Another default model, topological.
84 void createDefaultModel2();
85
86 // Redraw the nodes (change their colour).
87 void redrawGraph();
88};
89
90#endif