Changes: fixed buttons and table
[ptas] / zouba / main.cpp
1 #include "routedata.h"
2 #include "route.h"
3 #include "ui.h"
4 #include "uicontroller.h"
5 #include "location.h"
6 #include "gpscontroller.h"
7
8 #include "ytv.h"
9
10 #include <QDebug>
11 #include <QObject>
12 #include <QApplication>
13 #include <QMainWindow>
14
15 int main(int argc, char *argv[] )
16 {
17   QApplication app(argc, argv);
18   QMainWindow *mainWindow = new QMainWindow;
19   Ui ui;
20   ui.setupUi(mainWindow);
21
22   UiController  *uiController  = new UiController( &ui );
23   Route         *route         = new Route();
24   GpsController *gpsController = new GpsController();
25
26   QObject::connect(
27       route, SIGNAL( routeReady( RouteData ) ),
28       uiController, SLOT( displayRoute( RouteData ) )
29       );
30
31   QObject::connect(
32       gpsController, SIGNAL( locationChanged( Location ) ),
33       route, SLOT( setFromLocation( Location ) )
34       );
35
36   QObject::connect(
37       uiController, SIGNAL( destinationChanged( Location ) ),
38       route, SLOT( setToLocation( Location ) )
39     );
40
41   QObject::connect(
42       uiController, SIGNAL( buttonClicked() ),
43       gpsController, SLOT( startGps() )
44     );
45
46   mainWindow->show();
47
48   return app.exec();
49 }