# HG changeset patch # User John Kern # Date 1270159020 25200 # Node ID 92f7e918c7b5ea64d826d1dae823ddae276cc38f # Parent 60c644f011c73e2c5cb795afbe6ea3702e594db0 display context menus diff -r 60c644f011c7 -r 92f7e918c7b5 Seafood/main.cpp --- a/Seafood/main.cpp Thu Apr 01 13:36:35 2010 -0700 +++ b/Seafood/main.cpp Thu Apr 01 14:57:00 2010 -0700 @@ -1,11 +1,26 @@ #include +#include + #include "mainwindow.h" +// 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); MainWindow w; w.createMenus(); + disableContextMenu(); w.setWindowTitle("Seafood"); w.setStyleSheet("* { background-color:rgb(199,147,88); padding: 7px ; color:rgb(255,255,255)}"); #if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)