summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qwidgettextcontrol.cpp
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@theqtcompany.com>2015-02-13 14:11:20 +0100
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2015-02-15 14:24:58 +0000
commit25e19acca692489cd5212920861b157278833eff (patch)
tree0ff788abe9558293f5a7c3a3f9ee7f57753a44f4 /src/widgets/widgets/qwidgettextcontrol.cpp
parentb6b5ba0e232fa812b471a1a567db760e6fadae95 (diff)
QWidgetTextControl: add object names for standard context menu actions
Mainly for auto testing purposes. Change-Id: I776f9d7f28f9a04ba3f9a6bbc549d6e86bece876 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'src/widgets/widgets/qwidgettextcontrol.cpp')
-rw-r--r--src/widgets/widgets/qwidgettextcontrol.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/widgets/widgets/qwidgettextcontrol.cpp b/src/widgets/widgets/qwidgettextcontrol.cpp
index c023a83951..39e0aa5b7a 100644
--- a/src/widgets/widgets/qwidgettextcontrol.cpp
+++ b/src/widgets/widgets/qwidgettextcontrol.cpp
@@ -2227,15 +2227,18 @@ QMenu *QWidgetTextControl::createStandardContextMenu(const QPointF &pos, QWidget
if (d->interactionFlags & Qt::TextEditable) {
a = menu->addAction(tr("&Undo") + ACCEL_KEY(QKeySequence::Undo), this, SLOT(undo()));
a->setEnabled(d->doc->isUndoAvailable());
+ a->setObjectName(QStringLiteral("edit-undo"));
setActionIcon(a, QStringLiteral("edit-undo"));
a = menu->addAction(tr("&Redo") + ACCEL_KEY(QKeySequence::Redo), this, SLOT(redo()));
a->setEnabled(d->doc->isRedoAvailable());
+ a->setObjectName(QStringLiteral("edit-redo"));
setActionIcon(a, QStringLiteral("edit-redo"));
menu->addSeparator();
#ifndef QT_NO_CLIPBOARD
a = menu->addAction(tr("Cu&t") + ACCEL_KEY(QKeySequence::Cut), this, SLOT(cut()));
a->setEnabled(d->cursor.hasSelection());
+ a->setObjectName(QStringLiteral("edit-cut"));
setActionIcon(a, QStringLiteral("edit-cut"));
#endif
}
@@ -2244,6 +2247,7 @@ QMenu *QWidgetTextControl::createStandardContextMenu(const QPointF &pos, QWidget
if (showTextSelectionActions) {
a = menu->addAction(tr("&Copy") + ACCEL_KEY(QKeySequence::Copy), this, SLOT(copy()));
a->setEnabled(d->cursor.hasSelection());
+ a->setObjectName(QStringLiteral("edit-copy"));
setActionIcon(a, QStringLiteral("edit-copy"));
}
@@ -2252,6 +2256,7 @@ QMenu *QWidgetTextControl::createStandardContextMenu(const QPointF &pos, QWidget
a = menu->addAction(tr("Copy &Link Location"), this, SLOT(_q_copyLink()));
a->setEnabled(!d->linkToCopy.isEmpty());
+ a->setObjectName(QStringLiteral("link-copy"));
}
#endif // QT_NO_CLIPBOARD
@@ -2259,10 +2264,12 @@ QMenu *QWidgetTextControl::createStandardContextMenu(const QPointF &pos, QWidget
#ifndef QT_NO_CLIPBOARD
a = menu->addAction(tr("&Paste") + ACCEL_KEY(QKeySequence::Paste), this, SLOT(paste()));
a->setEnabled(canPaste());
+ a->setObjectName(QStringLiteral("edit-paste"));
setActionIcon(a, QStringLiteral("edit-paste"));
#endif
a = menu->addAction(tr("Delete"), this, SLOT(_q_deleteSelected()));
a->setEnabled(d->cursor.hasSelection());
+ a->setObjectName(QStringLiteral("edit-delete"));
setActionIcon(a, QStringLiteral("edit-delete"));
}
@@ -2271,6 +2278,7 @@ QMenu *QWidgetTextControl::createStandardContextMenu(const QPointF &pos, QWidget
menu->addSeparator();
a = menu->addAction(tr("Select All") + ACCEL_KEY(QKeySequence::SelectAll), this, SLOT(selectAll()));
a->setEnabled(!d->doc->isEmpty());
+ a->setObjectName(QStringLiteral("select-all"));
}
if ((d->interactionFlags & Qt::TextEditable) && qApp->styleHints()->useRtlExtensions()) {