tech tip: workaround for Action on Options menu
authorJohn Kern <johnk@symbian.org>
Mon, 16 Aug 2010 15:57:18 -0700
changeset 33 f6cf541961ad
parent 32 884c1b5354d7
child 34 93c5a58496b6
tech tip: workaround for Action on Options menu
contactengine/main.cpp
--- a/contactengine/main.cpp	Fri Aug 13 16:18:58 2010 -0700
+++ b/contactengine/main.cpp	Mon Aug 16 15:57:18 2010 -0700
@@ -5,6 +5,19 @@
 #include "dbtools.h"
 #include <QDebug>
 
+// Tech Tip: By default, Actions is added to the Options menu. The
+// idea is to support context menus on non-touch mobiles.
+void disableContextMenu()
+{
+    QWidgetList widgets = QApplication::allWidgets();
+    QWidget* wid=0;
+    foreach(wid,widgets)
+    {
+        wid->setContextMenuPolicy(Qt::NoContextMenu);
+    }
+}
+
+
 int main(int argc, char *argv[])
 {
     QApplication a(argc, argv);
@@ -16,6 +29,8 @@
     qDebug() << "dbLocation=" << dbLocation << endl;
     dbt.importCSV(dbLocation);
 
+    disableContextMenu();
+
 #if defined(Q_WS_S60)
     w.showMaximized();
 #else