summaryrefslogtreecommitdiffstats
path: root/src/webenginewidgets
diff options
context:
space:
mode:
authorJocelyn Turcotte <jocelyn.turcotte@digia.com>2014-02-18 14:06:54 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-20 11:41:53 +0100
commita6b35538acf4e3a8aad64932d8514040e2d36e68 (patch)
treedfa6d713350c75f71183c74bbbe3d6c05014a377 /src/webenginewidgets
parentc00319052b7dafd76ea400a022afb15d4746453e (diff)
Implement basic editing actions for QWebEnginePage
Change-Id: I1b58d2b2e86f60e296ae48095ed8d5e8172e0d1e Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
Diffstat (limited to 'src/webenginewidgets')
-rw-r--r--src/webenginewidgets/api/qwebenginepage.cpp44
1 files changed, 43 insertions, 1 deletions
diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp
index ca1c203dd..74b74abf1 100644
--- a/src/webenginewidgets/api/qwebenginepage.cpp
+++ b/src/webenginewidgets/api/qwebenginepage.cpp
@@ -289,7 +289,7 @@ void QWebEnginePagePrivate::updateAction(QWebEnginePage::WebAction action) const
if (!a)
return;
- bool enabled = false;
+ bool enabled = true;
switch (action) {
case QWebEnginePage::Back:
@@ -405,6 +405,27 @@ QAction *QWebEnginePage::action(WebAction action) const
text = tr("Reload");
icon = style->standardIcon(QStyle::SP_BrowserReload);
break;
+ case Cut:
+ text = tr("Cut");
+ break;
+ case Copy:
+ text = tr("Copy");
+ break;
+ case Paste:
+ text = tr("Paste");
+ break;
+ case Undo:
+ text = tr("Undo");
+ break;
+ case Redo:
+ text = tr("Redo");
+ break;
+ case SelectAll:
+ text = tr("Select All");
+ break;
+ case PasteAndMatchStyle:
+ text = tr("Paste and Match Style");
+ break;
default:
break;
}
@@ -438,6 +459,27 @@ void QWebEnginePage::triggerAction(WebAction action, bool)
case Reload:
d->adapter->reload();
break;
+ case Cut:
+ d->adapter->cut();
+ break;
+ case Copy:
+ d->adapter->copy();
+ break;
+ case Paste:
+ d->adapter->paste();
+ break;
+ case Undo:
+ d->adapter->undo();
+ break;
+ case Redo:
+ d->adapter->redo();
+ break;
+ case SelectAll:
+ d->adapter->selectAll();
+ break;
+ case PasteAndMatchStyle:
+ d->adapter->pasteAndMatchStyle();
+ break;
default:
Q_UNREACHABLE();
}