author | John Kern <johnk@symbian.org> |
Mon, 16 Aug 2010 15:57:18 -0700 | |
changeset 33 | f6cf541961ad |
parent 16 | e26c25b72a12 |
permissions | -rwxr-xr-x |
3
e6d1a78b6db9
wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff
changeset
|
1 |
#include <QtGui/QApplication> |
13 | 2 |
#include <QWidget> |
3 |
||
3
e6d1a78b6db9
wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff
changeset
|
4 |
#include "mainwindow.h" |
e6d1a78b6db9
wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff
changeset
|
5 |
|
16
e26c25b72a12
fix the table layout looks presentable
John Kern <johnk@symbian.org>
parents:
13
diff
changeset
|
6 |
// Tech Tip: By default, Actions is added to the Options menu. The |
13 | 7 |
// idea is to support context menus on non-touch mobiles. |
8 |
void disableContextMenu() |
|
9 |
{ |
|
10 |
QWidgetList widgets = QApplication::allWidgets(); |
|
11 |
QWidget* wid=0; |
|
12 |
foreach(wid,widgets) |
|
13 |
{ |
|
14 |
wid->setContextMenuPolicy(Qt::NoContextMenu); |
|
15 |
} |
|
16 |
} |
|
17 |
||
3
e6d1a78b6db9
wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff
changeset
|
18 |
int main(int argc, char *argv[]) |
e6d1a78b6db9
wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff
changeset
|
19 |
{ |
e6d1a78b6db9
wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff
changeset
|
20 |
QApplication a(argc, argv); |
e6d1a78b6db9
wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff
changeset
|
21 |
MainWindow w; |
e6d1a78b6db9
wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff
changeset
|
22 |
w.createMenus(); |
13 | 23 |
disableContextMenu(); |
12 | 24 |
w.setWindowTitle("Seafood"); |
11
f3dbeee07821
instrumented with debugging output
John Kern <johnk@symbian.org>
parents:
3
diff
changeset
|
25 |
w.setStyleSheet("* { background-color:rgb(199,147,88); padding: 7px ; color:rgb(255,255,255)}"); |
3
e6d1a78b6db9
wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff
changeset
|
26 |
#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5) |
e6d1a78b6db9
wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff
changeset
|
27 |
w.showMaximized(); |
e6d1a78b6db9
wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff
changeset
|
28 |
#else |
e6d1a78b6db9
wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff
changeset
|
29 |
w.show(); |
e6d1a78b6db9
wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff
changeset
|
30 |
#endif |
e6d1a78b6db9
wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff
changeset
|
31 |
return a.exec(); |
e6d1a78b6db9
wip - start of an example for my forthcoming presentation
John Kern <johnk@symbian.org>
parents:
diff
changeset
|
32 |
} |