equal
deleted
inserted
replaced
1 #include <QtGui/QApplication> |
1 #include <QtGui/QApplication> |
2 #include <QDesktopServices> |
2 #include <QDesktopServices> |
3 #include <QDir> |
3 #include <QDir> |
|
4 #include <QDebug> |
|
5 #include <QLabel> |
|
6 |
|
7 #ifdef USE_ORANGE_FW |
|
8 #include <OLApplication.h> |
|
9 #include <OLPixmapWidget.h> |
|
10 #include "mainview.h" |
|
11 #include "contactlist.h" |
|
12 #else |
4 #include "mainwindow.h" |
13 #include "mainwindow.h" |
5 #include "dbtools.h" |
14 #include "dbtools.h" |
6 #include <QDebug> |
15 #endif |
7 |
16 |
8 // Tech Tip: By default, Actions is added to the Options menu. The |
17 // Tech Tip: By default, Actions is added to the Options menu. The |
9 // idea is to support context menus on non-touch mobiles. |
18 // idea is to support context menus on non-touch mobiles. |
10 void disableContextMenu() |
19 void disableContextMenu() |
11 { |
20 { |
15 { |
24 { |
16 wid->setContextMenuPolicy(Qt::NoContextMenu); |
25 wid->setContextMenuPolicy(Qt::NoContextMenu); |
17 } |
26 } |
18 } |
27 } |
19 |
28 |
20 |
29 #ifdef USE_ORANGE_FW |
21 int main(int argc, char *argv[]) |
30 int main(int argc, char *argv[]) |
22 { |
31 { |
|
32 OLApplication a(argc, argv); |
|
33 |
|
34 MainView *mainView = new MainView(NULL); |
|
35 |
|
36 disableContextMenu(); |
|
37 |
|
38 a.setWindowTitle("(OL)Contact App"); |
|
39 mainView->resize(a.viewSize()); |
|
40 // QLabel* test = new QLabel("main base view", mainView); |
|
41 // Q_UNUSED(test); |
|
42 ContactList *cl = new ContactList(mainView); |
|
43 Q_UNUSED(cl) |
|
44 mainView->connect(&a, SIGNAL(appStarted()), mainView, SLOT(startApp())); |
|
45 |
|
46 return a.exec(); |
|
47 } |
|
48 #else |
|
49 int main(int argc, char *argv[]) |
|
50 { |
|
51 |
23 QApplication a(argc, argv); |
52 QApplication a(argc, argv); |
24 MainWindow w; |
53 MainWindow w; |
|
54 |
|
55 |
25 |
56 |
26 DBTools dbt; |
57 DBTools dbt; |
27 QString dbLocation(":/contacts.csv"); |
58 QString dbLocation(":/contacts.csv"); |
28 |
59 |
29 qDebug() << "dbLocation=" << dbLocation << endl; |
60 qDebug() << "dbLocation=" << dbLocation << endl; |
30 dbt.importCSV(dbLocation); |
61 dbt.importCSV(dbLocation); |
31 |
62 |
32 disableContextMenu(); |
63 disableContextMenu(); |
33 |
64 |
34 w.setWindowTitle("Qt Study App"); |
65 w.setWindowTitle("Contact App"); |
35 #if defined(Q_WS_S60) |
66 #if defined(Q_WS_S60) |
36 w.showMaximized(); |
67 w.showMaximized(); |
37 #else |
68 #else |
38 w.show(); |
69 w.show(); |
39 #endif |
70 #endif |
40 |
|
41 return a.exec(); |
71 return a.exec(); |
42 } |
72 } |
|
73 #endif |