summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@qt.io>2016-09-30 12:14:43 +0200
committerKai Koehne <kai.koehne@qt.io>2016-10-04 13:32:06 +0000
commit484be9a4d6b24697a6355bf6a3f1cde52baedd32 (patch)
treeb28bf896ed71b6d5960e0663542cb2798ad01ebd /examples
parent0a336d5110cdc677768f9f50151ee77663cfe6c3 (diff)
MarkDownEditor: Hide context menu
Most actions do not make sense. A custom context menu might be good for text actions, but would require reimplementing QWebEngineView. Change-Id: Idf94939c16469e1dcee96d9ecfd0eb5309589fdd Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/webenginewidgets/markdowneditor/doc/src/markdowneditor.qdoc9
-rw-r--r--examples/webenginewidgets/markdowneditor/mainwindow.cpp1
2 files changed, 8 insertions, 2 deletions
diff --git a/examples/webenginewidgets/markdowneditor/doc/src/markdowneditor.qdoc b/examples/webenginewidgets/markdowneditor/doc/src/markdowneditor.qdoc
index 3a9908ea6..0239c1065 100644
--- a/examples/webenginewidgets/markdowneditor/doc/src/markdowneditor.qdoc
+++ b/examples/webenginewidgets/markdowneditor/doc/src/markdowneditor.qdoc
@@ -113,11 +113,16 @@
\quotefromfile webenginewidgets/markdowneditor/mainwindow.cpp
\skipto MainWindow::MainWindow
- \printto connect
+ \printto PreviewPage
The constructor first calls \c setupUi to construct the widgets and menu
actions according to the UI file. The text editor font is set to one
- with a fixed character width. It then makes sure our custom
+ with a fixed character width, and the QWebEngineView widget is told not
+ to show a context menu.
+
+ \printto connect
+
+ Here the constructor makes sure our custom
\c PreviewPage is used by the QWebEngineView instance in \c{ui->preview}.
\printto ui->preview
diff --git a/examples/webenginewidgets/markdowneditor/mainwindow.cpp b/examples/webenginewidgets/markdowneditor/mainwindow.cpp
index 417858d8d..9981d177d 100644
--- a/examples/webenginewidgets/markdowneditor/mainwindow.cpp
+++ b/examples/webenginewidgets/markdowneditor/mainwindow.cpp
@@ -65,6 +65,7 @@ MainWindow::MainWindow(QWidget *parent) :
{
ui->setupUi(this);
ui->editor->setFont(QFontDatabase::systemFont(QFontDatabase::FixedFont));
+ ui->preview->setContextMenuPolicy(Qt::NoContextMenu);
PreviewPage *page = new PreviewPage(this);
ui->preview->setPage(page);