remove context menu when running in release mode
Stefan Bund [Fri, 28 Jan 2011 09:51:47 +0000 (10:51 +0100)]
Viewer.cc

index 46b8419..0076481 100644 (file)
--- a/Viewer.cc
+++ b/Viewer.cc
@@ -98,6 +98,8 @@ prefix_ pykit::Viewer::Viewer(QUrl const & url, Publisher * publisher, QWidget *
     : QWebView (parent)
 {
     QWebSettings::globalSettings()->setAttribute(QWebSettings::PluginsEnabled, true);
+    if (! QWebSettings::globalSettings()->testAttribute(QWebSettings::DeveloperExtrasEnabled))
+        setContextMenuPolicy(Qt::NoContextMenu);
     page()->setNetworkAccessManager(
         new InternalNetworkAccessManager(page()->networkAccessManager(), this, publisher));
 #ifdef POPPLER