# HG changeset patch # User John Kern # Date 1281999438 25200 # Node ID f6cf541961ad0212b39af8d520aebf3928ca321c # Parent 884c1b5354d7956ce5ec98f906a781a3157dabcb tech tip: workaround for Action on Options menu diff -r 884c1b5354d7 -r f6cf541961ad 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 +// 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